public int EditBankDetails(string userEmail, string payee_first_name, string payee_last_name, string payee_bank_name, string payee_bank_account, string payee_bank_ifsc, string payee_bank_branch) { //Code to change the bank details submitted by user BankQueriesCommands BankCQ = new BankQueriesCommands(); AuthQueriesCommands AuthCQ = new AuthQueriesCommands(); var account = AuthCQ.GetAccountByEmail(userEmail); if (account != null) { if (IsBankDetailsExistsOf(userEmail)) { var bankDetails = BankCQ.GetBankDetailOf(account); if (bankDetails != null) { bankDetails.Account_Id = account.Id; bankDetails.PayeeBankAccountNumber = payee_bank_account; bankDetails.PayeeBankName = payee_bank_name; bankDetails.PayeeBankIfscNumber = payee_bank_ifsc; bankDetails.PayeeBankBranch = payee_bank_branch; bankDetails.PayeeFirstName = payee_first_name; bankDetails.PayeeLastName = payee_last_name; bankDetails.Detail_Submitted_At = logic.CurrentIndianTime(); var result = BankCQ.EditBankDetails(bankDetails); if (result == 1) { //Changes done successfully return(1); } else { //Internal error occured while changing bank detais return(4); } } else { //No bank details is associated with the account return(3); } } else { //No bank details found for this account return(2); } } else { //No account found with this email id return(0); } }
public BankDetail GetBankDetailOf(string userEmail) { BankQueriesCommands BankCQ = new BankQueriesCommands(); AuthQueriesCommands AuthCQ = new AuthQueriesCommands(); var accountObject = AuthCQ.GetAccountByEmail(userEmail); if (accountObject != null) { //Account found now returning the bank details return(BankCQ.GetBankDetailOf(accountObject)); } else { //No Account found with this email return(null); } }