Example #1
0
        public List <BusinessUserExceptionalRoleViewModel> getAllBusinessCashierWithExceptionalRoleByBN(int BN, string srvcTCD)
        {
            List <BusinessUserExceptionalRoleViewModel> items = new List <BusinessUserExceptionalRoleViewModel>();
            var busUsrCashierList = db.TBUS_USR_EXCP_ROL.Where(x => x.BN == BN && x.TRANS_TRSF_CRDT_DBT_TCD == srvcTCD).ToList();

            if (busUsrCashierList.Count() == 0)
            {
                return(items);
            }

            foreach (var itemCashier in busUsrCashierList)
            {
                var excpAuthModel = new BusinessUserExceptionalRoleViewModel();
                excpAuthModel.busUsrExcpRole = itemCashier;

                var busAgcy = new BusinessAgency();
                var agcy    = busAgcy.getOneBusinessAgencyByAgcyNbr(itemCashier.BN, itemCashier.BUS_AGCY_NBR);
                if (agcy != null)
                {
                    excpAuthModel.BUS_USR_AGCY_NM = agcy.BUS_AGCY_NM;
                }

                var busUsr = db.TBUS_USR.Find(itemCashier.BUS_USR_NBR);
                if (busUsr != null)
                {
                    var usr = db.TUSR.Find(busUsr.BUS_EMPE_USR_NBR);
                    if (usr != null)
                    {
                        excpAuthModel.BUS_USR_FUL_NM = usr.USR_FUL_NM;
                    }
                }
                items.Add(excpAuthModel);
            }
            return(items);
        }
Example #2
0
        public BusinessAgency createBusinessAgency(int BN, int KTCT_ID, int ACCT_ID, string busAgcyNM, string headQrtr,
                                                   string hasInternetIND, decimal maxToWD, decimal maxAV, string hourDESC,
                                                   string BUS_AGCY_NO_SRVC_AV_IND)
        {
            var newObj = new BusinessAgency();

            newObj.BN                         = BN;
            newObj.BUS_AGCY_NBR               = generateBusinessAgencyCode(BN);
            newObj.BUS_AGCY_NM                = busAgcyNM;
            newObj.BUS_AGCY_KTCT_ID           = KTCT_ID;
            newObj.BUS_AGCY_HDQRTR_IND        = headQrtr;
            newObj.BUS_AGCY_ACCT_ID           = ACCT_ID;
            newObj.BUS_AGCY_INTRNT_CHK_IND    = hasInternetIND;
            newObj.BUS_AGCY_MXAMT_TO_WDRW_AMT = maxToWD;
            newObj.BUS_AGCY_AV_AMT            = maxAV;
            newObj.BUS_AGCY_OPNNG_HR          = hourDESC;
            newObj.BUS_AGCY_NO_SRVC_AV_IND    = BUS_AGCY_NO_SRVC_AV_IND;
            return(newObj);
        }
Example #3
0
        public List <SelectListItem> getAllBusinessUserByBN(int BN, int selectedValue)
        {
            List <SelectListItem> items = new List <SelectListItem>();
            var busUsrList = db.TBUS_USR.Where(x => x.BN == BN && x.BUS_USR_SCD == "1").ToList();

            foreach (var item in busUsrList)
            {
                var usr = usrObj.getUserByUsrNbr(item.BUS_EMPE_USR_NBR);
                if (usr != null)
                {
                    string text;
                    if (item.BUS_USR_TCD == "04")
                    {
                        text = usr.USR_FUL_NM + " - Manager";
                    }
                    else if (item.BUS_USR_TCD == "03")
                    {
                        var busAgcy = new BusinessAgency();
                        var obj     = busAgcy.getOneBusinessAgencyByAgcyNbr(item.BN, item.BUS_AGCY_NBR);
                        if (obj == null)
                        {
                            text = usr.USR_FUL_NM + " - Director";
                        }
                        else
                        {
                            text = usr.USR_FUL_NM + " - Director - " + obj.BUS_AGCY_NM;
                        }
                    }
                    else if (item.BUS_USR_TCD == "02")
                    {
                        var busAgcy = new BusinessAgency();
                        var obj     = busAgcy.getOneBusinessAgencyByAgcyNbr(item.BN, item.BUS_AGCY_NBR);
                        if (obj == null)
                        {
                            text = usr.USR_FUL_NM + " - Cashier";
                        }
                        else
                        {
                            text = usr.USR_FUL_NM + " - Cashier" + obj.BUS_AGCY_NM;
                        }
                    }
                    else
                    {
                        text = usr.USR_FUL_NM;
                    }

                    if (item.BUS_USR_NBR == selectedValue)
                    {
                        items.Add(new SelectListItem {
                            Text = text, Value = Convert.ToString(item.BUS_USR_NBR), Selected = true
                        });
                    }
                    else
                    {
                        items.Add(new SelectListItem {
                            Text = text, Value = Convert.ToString(item.BUS_USR_NBR), Selected = false
                        });
                    }
                }
            }
            return(items);
        }