Example #1
0
        public Contact getBusinessAgencyContactByBusUsrNbr(int BUS_USR_NBR)
        {
            try
            {
                var busUsrObj = new BusinessUser();
                var busUsr    = busUsrObj.getBusinessUserByID(BUS_USR_NBR);
                if (busUsr == null)
                {
                    return(null);
                }
                int    BN         = busUsr.BN;
                string busAgcyNbr = busUsr.BUS_AGCY_NBR;

                var busAgcy = db.TBUS_AGCY.Find(BN, busAgcyNbr);
                if (busAgcy == null)
                {
                    return(null);
                }

                var busAgcyKtctObj = new Contact();
                return(busAgcyKtctObj.getContactByKtctID(busAgcy.BUS_AGCY_KTCT_ID));
            }
            catch
            {
                return(null);
            }
        }
Example #2
0
        public string addCashierToWithdrawalWithoutPinRole(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 newObj = new BusinessUserExceptionalRole();

                newObj.BUS_USR_NBR             = busUsr.BUS_USR_NBR;
                newObj.BN                      = busUsr.BN;
                newObj.BUS_AGCY_NBR            = BUS_AGCY_NBR;
                newObj.TRANS_TRSF_CRDT_DBT_TCD = SRVC_TCD;
                db.TBUS_USR_EXCP_ROL.Add(newObj);
                db.SaveChanges();
                return("true");
            }
            catch
            {
                return(null);
            }
        }
Example #3
0
        public bool checkBusinessCashierInWithdrawalWithoutPinRoleByBusUsr(BusinessUser busUsr, string SRVC_TCD)
        {
            try
            {
                var busUsrExcpRoleList = 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 (busUsrExcpRoleList.Count() == 0)
                {
                    return(false);
                }

                var busUsrExcpRole = busUsrExcpRoleList[0];
                if (busUsrExcpRole == null)
                {
                    return(false);
                }

                if (DateTime.Compare(busUsrExcpRole.BUS_USR_EXCP_ROL_XDT, DateTime.Now.Date) > 0)
                {
                    return(true);
                }
                return(false);
            }
            catch
            {
                return(false);
            }
        }
Example #4
0
        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);
            }
        }
Example #5
0
        public BusinessUser createBusinessUser(int BN, string BUS_AGCY_NBR, int BUS_ACCT_ID, string BUS_USR_TCD,
                                               decimal BUS_AV_CAMT, string USR_NBR,
                                               string BUS_EMPE_IS_PKP_CLT_IND)
        {
            var newObj = new BusinessUser();

            newObj.BN                      = BN;
            newObj.BUS_AGCY_NBR            = BUS_AGCY_NBR;
            newObj.BUS_ACCT_ID             = BUS_ACCT_ID;
            newObj.BUS_USR_TCD             = BUS_USR_TCD;
            newObj.BUS_AV_CAMT             = BUS_AV_CAMT;
            newObj.BUS_EMPE_USR_NBR        = USR_NBR;
            newObj.BUS_EMPE_IS_PKP_CLT_IND = BUS_EMPE_IS_PKP_CLT_IND;
            return(newObj);
        }
Example #6
0
        public List <BusinessInternalTransferTransaction> getAllInternalTransferTransactionByBusUsrNbr(string usrNbr)
        {
            var list = new List <BusinessInternalTransferTransaction>();

            try
            {
                var newBusUsr = new BusinessUser();
                var busUsr    = newBusUsr.getBusinessUserByUsrNbr(usrNbr);
                if (busUsr == null)
                {
                    return(list);
                }

                //if (BUS_USR_TCD == "02")
                //{
                //    return db.TBUS_INTRN_TRSF_TRANS.Where(x => x.FROM_BUS_USR_NBR == busUsr.BUS_USR_NBR).OrderByDescending(y => y.TRANS_ID).ToList();
                //}

                //if (BUS_USR_TCD == "03")
                //{
                //    return db.TBUS_INTRN_TRSF_TRANS.Where(x => x.FROM_BUS_USR_NBR == busUsr.BUS_USR_NBR ||
                //                                               x.TO_BUS_USR_NBR == busUsr.BUS_USR_NBR)
                //                                               .OrderByDescending(y => y.TRANS_ID).ToList();
                //}

                //if (BUS_USR_TCD == "04")
                //{
                //    return db.TBUS_INTRN_TRSF_TRANS.Where(x => x.TO_BUS_USR_NBR == busUsr.BUS_USR_NBR).OrderByDescending(y => y.TRANS_ID).ToList();
                //}
                return(list);
            }
            catch
            {
                return(list);
            }
        }