public OnBehalfClientTransaction insertOnBehalfClientTransaction(int TRANS_ID, string CURRENT_USR_NBR, Account CURRENT_USR_ACCT, string ADMIN_USR_NBR, string CTRY_CD, string CRCY_CD, decimal TRANS_FEE_AMT, string SRVC_TCD, string TRANS_SCD) { try { var newCmsn = new OnBehalfClientCommission(); decimal CMSN_AMT = newCmsn.getOneOnBehalfClientCommissionAmount(CURRENT_USR_NBR, ADMIN_USR_NBR, CTRY_CD, SRVC_TCD, TRANS_FEE_AMT, CRCY_CD); if (CMSN_AMT == -1.0m) { return(null); } decimal convertCMSN_AMT; if (CRCY_CD != CURRENT_USR_ACCT.CRCY_CD) { var getXchgRT = new CurrencyExchangeRate(); decimal xchgRT = getXchgRT.getExchangeRateByCurrency(CRCY_CD, CURRENT_USR_ACCT.CRCY_CD); if (xchgRT == 0.0m) { return(null); } convertCMSN_AMT = CMSN_AMT * xchgRT; } else { convertCMSN_AMT = CMSN_AMT; } var obj = new OnBehalfClientTransaction(); obj.TRANS_ID = TRANS_ID; obj.USR_NBR = CURRENT_USR_NBR; obj.CMSN_AMT = convertCMSN_AMT; obj.CRCY_CD = CRCY_CD; obj.TRANS_SCD = TRANS_SCD; db.TONBHLF_CLT_TRANS.Add(obj); //update the current user account balance if the status is 1, closed if (TRANS_SCD == "1") { CURRENT_USR_ACCT.ACCT_BAL = CURRENT_USR_ACCT.ACCT_BAL + convertCMSN_AMT; db.Entry(CURRENT_USR_ACCT).State = EntityState.Modified; } //save all db.SaveChanges(); return(obj); } catch { return(null); } }
public TransactionSession createTransactionSession(decimal TRANS_SSN_AMT, string TRANS_SSN_AMT_TXT, string TRANS_SSN_CRCY_CD, string TRANS_SSN_CUST_AMT_IND, string TRANS_SSN_SURL_TXT, string TRANS_SSN_FURL_TXT, int BPCS_NBR, string CLT_USR_NBR, string CLT_ACCT_NBR, string CLT_EMAIL_TXT, string CLT_LANG_CD, string CLT_CTRY_CD, string CLT_BIL_NBR, string TRANS_ID, string OTH1_TXT, string OTH2_TXT, string OTH3_TXT, string OTH4_TXT, string OTH5_TXT) { try { var obj = new TransactionSession(); obj.TRANS_SSN_SECR_ID = Guid.NewGuid().ToString("N"); obj.TRANS_SSN_SECR_ID_TXT = obj.TRANS_SSN_SECR_ID; obj.TRANS_SSN_AMT = TRANS_SSN_AMT; obj.TRANS_SSN_AMT_TXT = TRANS_SSN_AMT_TXT; obj.TRANS_SSN_CRCY_CD = TRANS_SSN_CRCY_CD; obj.TRANS_SSN_CUST_AMT_IND = TRANS_SSN_CUST_AMT_IND; obj.TRANS_SSN_SURL_TXT = TRANS_SSN_SURL_TXT; obj.TRANS_SSN_FURL_TXT = TRANS_SSN_FURL_TXT; obj.BPCS_NBR = BPCS_NBR; obj.CLT_USR_NBR = CLT_USR_NBR; obj.CLT_ACCT_NBR = CLT_ACCT_NBR; obj.CLT_EMAIL_TXT = CLT_EMAIL_TXT; obj.CLT_LANG_CD = CLT_LANG_CD; obj.CLT_CTRY_CD = CLT_CTRY_CD; obj.CLT_BIL_NBR = CLT_BIL_NBR; obj.TRANS_ID = TRANS_ID; obj.TRANS_SSN_OTH1_TXT = OTH1_TXT; obj.TRANS_SSN_OTH2_TXT = OTH2_TXT; obj.TRANS_SSN_OTH3_TXT = OTH3_TXT; obj.TRANS_SSN_OTH4_TXT = OTH4_TXT; obj.TRANS_SSN_OTH5_TXT = OTH5_TXT; db.TTRANS_SSN.Add(obj); db.SaveChanges(); string secureID = TRANS_SSN_SECR_ID + "" + obj.TRANS_ID; obj.TRANS_SSN_SECR_ID_TXT = secureID; db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); return(obj); } catch { return(null); } }
//immediately update the new account number to add the bn number public Account updateNewBusinessAccount(int bn, int acctID) { try { var newAcct = db.TACCT.Find(acctID); if (newAcct == null) { return(null); } string acctNbr = newAcct.ACCT_NBR.Substring(0, 8); string strBN = Convert.ToString(bn); newAcct.ACCT_NBR = string.Concat(strBN, acctNbr); if (string.IsNullOrWhiteSpace(newAcct.ACCT_NBR) || newAcct.ACCT_NBR.Length != 17) { return(null); } db.Entry(newAcct).State = EntityState.Modified; db.SaveChanges(); return(newAcct); } catch { return(null); } }
public async Task <IActionResult> PutUsuario(int id, Usuario usuario) { if (id != usuario.UsuarioID) { return(BadRequest()); } _context.Entry(usuario).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsuarioExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutMesa(int id, Mesa mesa) { if (id != mesa.MesaID) { return(BadRequest()); } _context.Entry(mesa).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MesaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public string editCashierToWithdrawalWithoutPinRole(int BUS_USR_EXCP_ROL_ID, BusinessUser busUsr, string BUS_AGCY_NBR, string SRVC_TCD) { try { var check = db.TBUS_USR_EXCP_ROL.Where(x => x.BUS_USR_NBR == busUsr.BUS_USR_NBR && x.BN == busUsr.BN && x.BUS_AGCY_NBR == busUsr.BUS_AGCY_NBR && x.TRANS_TRSF_CRDT_DBT_TCD == SRVC_TCD).ToList(); if (check.Count() != 0) { return("already_in_role"); } var obj = db.TBUS_USR_EXCP_ROL.Find(BUS_USR_EXCP_ROL_ID); if (obj == null) { return(null); } obj.BUS_USR_NBR = busUsr.BUS_USR_NBR; obj.BN = busUsr.BN; obj.BUS_AGCY_NBR = BUS_AGCY_NBR; db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); return("true"); } catch { return(null); } }
public bool updatePayKapRecipientAccount(int RCPT_USR_BUS_ID, int ACCT_ID, string ACCT_NBR, string ExrlAcctNbr1, string ExrlAcctNbr2, string ExrlAcctNbr3, string rcptUserBusinessNM, string RCPT_TCD, string RCPT_USR_NBR, int?RCPT_BUS_NBR, string RCPT_USR_BUS_TCD, string ACTVT_TCD) { try { var obj = db.TRCPT_USR_BUS.Find(RCPT_USR_BUS_ID); if (obj == null) { return(false); } obj.ACCT_ID = ACCT_ID; obj.ACCT_NBR = ACCT_NBR; obj.RCPT_USR_BUS1_UIN = ExrlAcctNbr1; obj.RCPT_USR_BUS2_UIN = ExrlAcctNbr2; obj.RCPT_USR_BUS3_UIN = ExrlAcctNbr3; obj.RCPT_USR_BUS_NM = rcptUserBusinessNM; obj.RCPT_TCD = RCPT_TCD; obj.RCPT_USR_NBR = RCPT_USR_NBR; obj.RCPT_BUS_NBR = RCPT_BUS_NBR; obj.RCPT_USR_BUS_TCD = RCPT_USR_BUS_TCD; obj.ACTVT_TCD = ACTVT_TCD; db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); return(true); } catch { return(false); } }
public bool updateTransactionSession(long transSsnID, string USR_NBR) { try { var obj = db.TTRANS_START_XSSN_TEMPO.Find(transSsnID); if (obj == null) { return(false); } obj.CLT_USR_NBR = USR_NBR; db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); return(true); } catch { return(false); } }
public bool updateTransaction(int transID, int FROM_TRSF_SERV_ID, int TO_TRSF_SERV_ID, string FROM_CTRY_CD, string TO_CTRY_CD, string FROM_CRCY_CD, string TO_CRCY_CD, decimal CRCY_XCHG_RT, decimal FROM_TRANS_AMT, decimal FROM_FEE_AMT, decimal FROM_TOT_AMT, decimal TO_TRANS_AMT, string TRANS_SCD, DateTime TRANS_XDT, string FROM_USR_NBR, int RCPT_USR_BUS_ID, string TRANS_TCD) { try { var obj = db.TTRANS_TRSF_CRDT_DBT.Find(transID); if (obj == null) { return(false); } obj.FROM_TRSF_SERV_ID = FROM_TRSF_SERV_ID; obj.TO_TRSF_SERV_ID = TO_TRSF_SERV_ID; obj.FROM_CTRY_CD = FROM_CTRY_CD; obj.TO_CTRY_CD = TO_CTRY_CD; obj.FROM_CRCY_CD = FROM_CRCY_CD; obj.TO_CRCY_CD = TO_CRCY_CD; obj.CRCY_XCHG_RT = CRCY_XCHG_RT; obj.FROM_TRANS_AMT = FROM_TRANS_AMT; obj.FROM_FEE_AMT = FROM_FEE_AMT; obj.FROM_TOT_AMT = FROM_TOT_AMT; obj.TO_TRANS_AMT = TO_TRANS_AMT; obj.TRANS_SCD = TRANS_SCD; obj.TRANS_XDT = TRANS_XDT; obj.FROM_USR_NBR = FROM_USR_NBR; obj.RCPT_USR_BUS_ID = RCPT_USR_BUS_ID; obj.TRANS_TRSF_CRDT_DBT_TCD = TRANS_TCD; db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); return(true); } catch { return(false); } }
public bool updateFinancialInstitutionExternalAccount(int EXRL_ACCT_ID, string AcctNm, string AcctTCD, string AcctNbr, string part1, string part2, string part3, string part4, string part5, int partNbr, int fiCtryID, string crcyCD) { try { var obj = db.TFI_EXRL_ACCT.Find(EXRL_ACCT_ID); if (obj == null) { return(false); } //just to handle error obj.RCPT_EXRL_ACCT_USR_NBR = "0000000000"; obj.EXRL_ACCT_NM = AcctNm; obj.EXRL_ACCT_TCD = AcctTCD; obj.EXRL_ACCT_NBR = AcctNbr; obj.EXRL_ACCT_PRT1_NBR = part1; obj.EXRL_ACCT_PRT2_NBR = part2; obj.EXRL_ACCT_PRT3_NBR = part3; obj.EXRL_ACCT_PRT4_NBR = part4; obj.EXRL_ACCT_PRT5_NBR = part5; obj.EXRL_ACCT_PRT_NBR = partNbr; //obj.EXRL_ACCT_VLDT_IND = acctVldIND; obj.FI_CTRY_ID = fiCtryID; obj.CRCY_CD = crcyCD; //obj.EXRL_ACCT_USR_NBR = ExrlAcctUsrNbr; //obj.EXRL_ACCT_BUS_NBR = ExrlAcctBusNbr; //obj.EXRL_ACCT_USR_BUS_TCD = UsrBusTCD; //obj.USR_NBR = usrNbr; //obj.EXRL_ACCT_FOR_CURT_USR_IND = currentUserIND; db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); return(true); } catch { return(false); } }
public bool updateUserDefaultPasswordIndicator(string usrNbr) { try { var user = db.TUSR.Find(usrNbr); if (user == null) { return(false); } if (user.USR_DFLT_PWD_IND == "1") { user.USR_DFLT_PWD_IND = "0"; db.Entry(user).State = EntityState.Modified; db.SaveChanges(); } return(true); } catch { return(false); } }
public bool updateExternalTransaction(int EXRL_TRANS_ID, string returnCode, string PRTR_TRANS_ID) { try { var obj = db.TEXRL_TRANS.Find(EXRL_TRANS_ID); if (obj == null) { return(false); } obj.PRTR_TRANS_RCD = returnCode; obj.PRTR_TRANS_ID = PRTR_TRANS_ID; db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); return(true); } catch { return(false); } }
public string setDefaultBusiness(int BN) { var dfltBus = getDefaultBusinessByBN(BN); if (dfltBus != null) { return("already_default"); } var bus = getBusinessByBN(BN); if (bus == null) { return(null); } bus.DFLT_BUS_DSPL_IND = "1"; db.Entry(bus).State = EntityState.Modified; db.SaveChanges(); return("true"); }
public bool verifyUserPhoneLoginByUserId(string phnNbr, string userId) { var usrList = db.TUSR.Where(x => x.Id == userId).ToList(); if (usrList.Count() == 0) { return(false); } else { var usr = usrList[0]; if (usr == null) { return(false); } var usrPhnLoginList = db.TUSR_PHN_LGN.Where(x => x.USR_PHN_LGN_NBR == phnNbr && x.USR_NBR == usr.USR_NBR && x.LGC_DEL_IND == "0").ToList(); if (usrPhnLoginList.Count() == 0) { return(false); } else { var usrPhnLogin = usrPhnLoginList[0]; if (usrPhnLogin == null) { return(false); } usrPhnLogin.USR_PHN_LGN_VRFT_IND = "1";// 1 = verify usrPhnLogin.USR_PHN_LGN_VRFT_DT = DateTime.Now; db.Entry(usrPhnLogin).State = EntityState.Modified; db.SaveChanges(); return(true); } } }
public bool updateDefaultCardPinIndicator(int cardID) { try { var card = db.TCARD.Find(cardID); if (card == null) { return(false); } if (card.DFLT_PIN_IND == "1") { card.DFLT_PIN_IND = "0"; db.Entry(card).State = EntityState.Modified; db.SaveChanges(); } return(true); } catch { return(false); } }