public static List <CurrentSavingAccountTransaction> GetSavingAccountTransactionList(string accountsCode) { List <CurrentSavingAccountTransaction> theCurrentSavingAccountTransactionList = new List <CurrentSavingAccountTransaction>(); DataTable theCurrentSavingAccountTransactionTable = AccountsTransactionsDataAccess.GetInstance.GetSavingAccountTransactionList(accountsCode); foreach (DataRow dr in theCurrentSavingAccountTransactionTable.Rows) { CurrentSavingAccountTransaction theCurrentSavingAccountTransaction = new CurrentSavingAccountTransaction(); theCurrentSavingAccountTransaction = CurrentSavingAccountTransactionDataRowToObject(dr); theCurrentSavingAccountTransactionList.Add(theCurrentSavingAccountTransaction); } return(theCurrentSavingAccountTransactionList); }
public static CurrentSavingAccountTransaction CurrentSavingAccountTransactionDataRowToObject(DataRow dr) { CurrentSavingAccountTransaction theCurrentSavingAccountTransaction = new CurrentSavingAccountTransaction(); theCurrentSavingAccountTransaction.Particulars = dr["Particulars"].ToString(); theCurrentSavingAccountTransaction.DateOfTransaction = DateTime.Parse(dr["DateOfTransaction"].ToString()).ToString(MicroConstants.DateFormat); theCurrentSavingAccountTransaction.Particulars = dr["Particulars"].ToString(); theCurrentSavingAccountTransaction.CreditAmount = decimal.Parse(dr["CreditAmount"].ToString()); theCurrentSavingAccountTransaction.DebitAmount = decimal.Parse(dr["DebitAmount"].ToString()); theCurrentSavingAccountTransaction.ChallanNo = dr["ChallanNo"].ToString(); theCurrentSavingAccountTransaction.TotalBalance = decimal.Parse(dr["TotalBalance"].ToString()); return(theCurrentSavingAccountTransaction); }