//---------------------------------------------------------------------------------------------------------------- //----------------------------- Update Balance amount after each transaction ------------------------------------- public static double GetBalance(string accountNumber, string transactionType, double amount) { double balanceAmount = TransactionDL.GetBalance(accountNumber); if (transactionType == "Credit") { balanceAmount = balanceAmount + amount; } else { balanceAmount = balanceAmount - amount; } return(balanceAmount); }
//-------------------------------------------------------------------------------------------------------------- //----------------------------- Search for a Transaction ------------------------------------------------------- public static DataSet GetTransactionsLike(string category, string like) { DataSet dsTransactions = null; try { dsTransactions = TransactionDL.GetTransactionsLike(category, like); } catch (Exception ex) { Console.Out.WriteLine(" Error : TransactionBL : GetAddressBookLike() " + ex.Message.ToString()); } return(dsTransactions); }
//--------------------------------------------------------------------------------------------------------------- //----------------------------- Insert a Transaction ------------------------------------------------------------ public static int InsertTransactionDetails(Transaction objTransaction) { int output = 0; try { output = TransactionDL.InsertTransactionDetails(objTransaction); } catch (Exception ex) { Console.WriteLine("Error : TransactionBL : InsertTransactionDetails()" + ex.Message.ToString()); } return(output); }
//--------------------------------------------------------------------------------------------------------------- //----------------------------- Insert a Transaction ------------------------------------------------------------ public static int UpdateCustomerDetails(Customer objCustomer) { int output = 0; try { output = TransactionDL.UpdateCustomerDetails(objCustomer); } catch (Exception ex) { Console.WriteLine("Error : TransactionBL : UpdateCustomerDetails()" + ex.Message.ToString()); } return(output); }
//---------------------------------------------------------------------------------------------------------------- //----------------------------- Generate Account Name after entering Account No ---------------------------------- public static String GetNameLike(string like) { string name = null; try { name = TransactionDL.GetNameLike(like); } catch (Exception ex) { Console.Out.WriteLine(" Error : TransactionBL : GetNameLike() " + ex.Message.ToString()); } return(name); }
//---------------------------------------------------------------------------------------------------------------- //----------------------------- Get Last Transaction Id to generate new transaction Id --------------------------- public static string GetNewTransactionId() { string lastTransactionId = null; string newTransactionId = null; try { lastTransactionId = TransactionDL.GetLastTransactionId(); if (lastTransactionId != null) { newTransactionId = UtilityHelper.GenerateTransactionId(lastTransactionId); } else { newTransactionId = "TRA12101"; } } catch (Exception ex) { Console.Out.WriteLine("Error : TransactionBL : GetNewTransactionId() " + ex.Message.ToString()); } return(newTransactionId); }
//----------------------------------------------------------------------------------------------------------- //----------------------------- Update Balance Amount of customer after each transaction -------------------- public static void UpdateBalanceAmount(string accountNumber, double balance) { TransactionDL.UpdateBalanceAmount(accountNumber, balance); }