Exemple #1
0
        public ActionResult Index(RegisterModel Input)
        {
            try
            {
                if (RegisterModel.ChkFormatAcct(Input.AcctNumber) == true)
                {
                    using (OracleContext db = new OracleContext())
                    {
                        var Getrs = db.ANYID_GET_DATA_CBS(Input.AcctNumber);
                        List <ANYID_DATA_CBS> rs    = Getrs.ToList();
                        ANYID_DATA_CBS        rsOne = rs.FirstOrDefault();
                        if (rsOne != null)
                        {
                            rsOne = RegisterModel.CovertNameCustomerTo32Char(rsOne);

                            var       GetMobile = db.ANYID_GET_MOBILE_CBS(Convert.ToString(rsOne.ACCOUNTID));
                            Hashtable htMobile  = RegisterModel.GetListMobile(GetMobile.ToList());
                            ViewBag.HomeMobile    = htMobile["HomeMobile"];
                            ViewBag.WorkMobile    = htMobile["WorkMobile"];
                            ViewBag.MailingMobile = htMobile["MailingMobile"];

                            ViewBag.HaveJoint         = (rsOne.COUNT_JOINT > 1) ? "มี" : "ไม่มี";
                            ViewBag.FrezDesc          = RegisterModel.GetFrezDesc(Convert.ToString(rsOne.FREZ_CODE));
                            ViewBag.AcctStatusDormant = RegisterModel.GetAcctStatusDesc(Convert.ToString(rsOne.ACCT_STATUS_DORMANT));
                            ViewBag.AcctClsFlg        = RegisterModel.GetAcctClsDesc(Convert.ToString(rsOne.ACCT_CLS_FLG));
                        }
                        else
                        {
                            TempData["Notify"]  = Constants.NotifyTrue.ToString();
                            TempData["Class"]   = Constants.ClassError.ToString();
                            TempData["Message"] = Constants.MsgNoData.ToString();

                            return(RedirectToAction("Index"));
                        }

                        /*** Log ***/
                        RegisterModel.LogsInsert(DateTime.Now, rsOne, null);

                        ViewBag.AccountNumber = Input.AcctNumber;
                        return(View("Index", rsOne));
                    }
                }
                else
                {
                    TempData["Notify"]  = Constants.NotifyTrue.ToString();
                    TempData["Class"]   = Constants.ClassError.ToString();
                    TempData["Message"] = Constants.MsgNotAcctDeposit.ToString();
                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception e)
            {
                TempData["Notify"]  = Constants.NotifyTrue.ToString();
                TempData["Class"]   = Constants.ClassError.ToString();
                TempData["Message"] = Constants.MsgError.ToString();
                log.Error(CommonHelper.ErrMsg(e));
                return(RedirectToAction("Index"));
            }
        }