public bool checkTransactionSessionExpiry(TransactionStartExternalSessionTemporary model) { try { if (model == null) { return(true); } DateTime currentDate = DateTime.Now; int result = DateTime.Compare(model.TRANS_XDTTM, currentDate); if (result < 0) { return(false); } else { return(true); } } catch { return(true); } }
public TransactionStartExternalSessionTemporary createTransactionSession(int FROM_SRVC_ID, int TO_SRVC_ID, string FROM_CTRY_CD, string TO_CTRY_CD, string FROM_CRCY_CD, string TO_CRCY_CD, string SEND_RCPT_CD, decimal FROM_TRANS_AMT, string FROM_TRANS_AMT_TXT, decimal TRANS_FEE_AMT, string TRANS_FEE_AMT_TXT, decimal TRANS_FEE_AMT_PROMO_CD, string TRANS_FEE_AMT_TXT_PROMO_CD, decimal TOT_TO_PAY_AMT, string TOT_TO_PAY_AMT_TXT, decimal TOT_TO_PAY_AMT_PROMO_CD, string TOT_TO_PAY_AMT_TXT_PROMO_CD, decimal TO_TRANS_AMT, string TO_TRANS_AMT_TXT, decimal CRCY_XCHG_RT, string CRCY_XCHG_RT_TXT, string DPLY_CRCY_XCHG_RT_IND, decimal ADJUST_XCHG_RT, string CLT_USR_NBR, string OTH1_TXT, string OTH2_TXT, string OTH3_TXT, string OTH4_TXT, string OTH5_TXT) { var obj = new TransactionStartExternalSessionTemporary(); string part1 = Guid.NewGuid().ToString("N"); string part2 = Guid.NewGuid().ToString("N"); string TRANS_SSN_SECR_ID = string.Concat(part1, part2); obj.TRANS_SSN_SECR_ID = TRANS_SSN_SECR_ID; obj.FROM_SRVC_ID = FROM_SRVC_ID; obj.TO_SRVC_ID = TO_SRVC_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.SEND_RCPT_CD = SEND_RCPT_CD; obj.FROM_TRANS_AMT = FROM_TRANS_AMT; obj.FROM_TRANS_AMT_TXT = FROM_TRANS_AMT_TXT; obj.TRANS_FEE_AMT = TRANS_FEE_AMT; obj.TRANS_FEE_AMT_TXT = TRANS_FEE_AMT_TXT; obj.TRANS_FEE_AMT_PROMO_CD = TRANS_FEE_AMT_PROMO_CD; obj.TRANS_FEE_AMT_TXT_PROMO_CD = TRANS_FEE_AMT_TXT_PROMO_CD; obj.TOT_TO_PAY_AMT = TOT_TO_PAY_AMT; obj.TOT_TO_PAY_AMT_TXT = TOT_TO_PAY_AMT_TXT; obj.TOT_TO_PAY_AMT_PROMO_CD = TOT_TO_PAY_AMT_PROMO_CD; obj.TOT_TO_PAY_AMT_TXT_PROMO_CD = TOT_TO_PAY_AMT_TXT_PROMO_CD; obj.TO_TRANS_AMT = TO_TRANS_AMT; obj.TO_TRANS_AMT_TXT = TO_TRANS_AMT_TXT; obj.CRCY_XCHG_RT = CRCY_XCHG_RT; obj.CRCY_XCHG_RT_TXT = CRCY_XCHG_RT_TXT; obj.DPLY_CRCY_XCHG_RT_IND = DPLY_CRCY_XCHG_RT_IND; //DISPLAY CRCY XCHG RATE INDICATOR obj.ADJUST_XCHG_RT = ADJUST_XCHG_RT; obj.CLT_USR_NBR = CLT_USR_NBR; obj.TRANS_OTH1_TXT = OTH1_TXT; obj.TRANS_OTH2_TXT = OTH2_TXT; obj.TRANS_OTH3_TXT = OTH3_TXT; obj.TRANS_OTH4_TXT = OTH4_TXT; obj.TRANS_OTH5_TXT = OTH5_TXT; db.TTRANS_START_XSSN_TEMPO.Add(obj); db.SaveChanges(); return(obj); }