Click here to Skip to main content
15,887,822 members
Home / Discussions / C#
   

C#

 
Questionsimple radio button question Pin
dino20945-Mar-07 13:00
dino20945-Mar-07 13:00 
AnswerRe: simple radio button question Pin
Luc Pattyn5-Mar-07 13:21
sitebuilderLuc Pattyn5-Mar-07 13:21 
AnswerRe: simple radio button question Pin
Koocurrent5-Mar-07 15:02
Koocurrent5-Mar-07 15:02 
AnswerRe: simple radio button question Pin
engsrini5-Mar-07 18:42
engsrini5-Mar-07 18:42 
QuestionWindows Service Pin
Darkness845-Mar-07 12:41
Darkness845-Mar-07 12:41 
AnswerRe: Windows Service Pin
Luc Pattyn5-Mar-07 13:22
sitebuilderLuc Pattyn5-Mar-07 13:22 
QuestionTo activate flash or real player plug Ins in widgets Pin
mikkasava5-Mar-07 12:05
mikkasava5-Mar-07 12:05 
QuestionOpton to re-use code Pin
Glen Harvy5-Mar-07 11:53
Glen Harvy5-Mar-07 11:53 
Hi.

I have several datatables that each have the same structure. They represent individual bank accounts.

When the user selects the bank account and then saves the transaction I use the following code:

      if (cbPayBillsWhichAccount.Text == "Administration Fund")<br />
      {<br />
        try<br />
        {<br />
          mybodycorpDataSet.AdminFundRow newRow = this.mybodycorpDataSet.AdminFund.NewAdminFundRow();<br />
<br />
          if (this.dtpPayBillsTransactionDate.Text == string.Empty)<br />
          {<br />
            newRow.Date = DateTime.Today;<br />
          }<br />
          else<br />
          {<br />
            newRow.Date = Convert.ToDateTime(this.dtpPayBillsTransactionDate.Text);<br />
          }<br />
<br />
          newRow.Debit = true;<br />
          newRow.ChequeNumber = this.tbPayBillsChequeNumber.Text.ToString();<br />
          newRow.Payee = paySupplierName;<br />
          newRow.Amount = Convert.ToDecimal(tbPayBillsHowMuch.Text);<br />
          newRow.Reconciled = false;<br />
<br />
          this.mybodycorpDataSet.AdminFund.Rows.Add(newRow);<br />
          this.adminFundTableAdapter.Update(mybodycorpDataSet.AdminFund);<br />
        }


What I wish to do is re-use the code (essentially all the "newRow" lines) as ammended for each chosen bank account.

How would you suggest I go about this?



Glen Harvy

QuestionIs it better to use args to return values or function type? Pin
BRShroyer5-Mar-07 11:13
BRShroyer5-Mar-07 11:13 
AnswerRe: Is it better to use args to return values or function type? Pin
led mike5-Mar-07 11:38
led mike5-Mar-07 11:38 
GeneralRe: Is it better to use args to return values or function type? Pin
Colin Angus Mackay5-Mar-07 13:52
Colin Angus Mackay5-Mar-07 13:52 
AnswerRe: Is it better to use args to return values or function type? Pin
Ed.Poore5-Mar-07 11:38
Ed.Poore5-Mar-07 11:38 
AnswerRe: Is it better to use args to return values or function type? Pin
netJP12L5-Mar-07 11:39
netJP12L5-Mar-07 11:39 
GeneralRe: Is it better to use args to return values or function type? Pin
DavidNohejl5-Mar-07 13:00
DavidNohejl5-Mar-07 13:00 
AnswerRe: Is it better to use args to return values or function type? Pin
Guffa5-Mar-07 12:47
Guffa5-Mar-07 12:47 
AnswerRe: Is it better to use args to return values or function type? Pin
DavidNohejl5-Mar-07 12:59
DavidNohejl5-Mar-07 12:59 
AnswerRe: Is it better to use args to return values or function type? Pin
Mundo Cani5-Mar-07 16:42
Mundo Cani5-Mar-07 16:42 
QuestionFile deleting Pin
SpeedBee5-Mar-07 11:09
SpeedBee5-Mar-07 11:09 
AnswerRe: File deleting Pin
Ed.Poore5-Mar-07 11:37
Ed.Poore5-Mar-07 11:37 
AnswerRe: File deleting Pin
Luc Pattyn5-Mar-07 13:28
sitebuilderLuc Pattyn5-Mar-07 13:28 
AnswerRe: How to convert object type into 'int' type? Pin
Are Jay5-Mar-07 9:41
Are Jay5-Mar-07 9:41 
GeneralRe: How to convert object type into 'int' type? Pin
Khoramdin5-Mar-07 9:51
Khoramdin5-Mar-07 9:51 
GeneralRe: How to convert object type into 'int' type? Pin
Colin Angus Mackay5-Mar-07 13:51
Colin Angus Mackay5-Mar-07 13:51 
QuestionDateTimepicker commercial replacement ? Pin
CAE5-Mar-07 8:45
CAE5-Mar-07 8:45 
Questionsend a wav file through a socket in C# Pin
trab0075-Mar-07 7:33
trab0075-Mar-07 7:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.