public async Task <ActionResult> SaveAcctDepositInfoOps(CreditAssesOperation _AcctDepositInfo, string applId, string CorpCd)//, string acctNo
        {
            _AcctDepositInfo.UserId = GetUserId;
            var _SaveTxn = await AccountOpService.SaveAcctDepositInfoMaint(_AcctDepositInfo, applId, CorpCd);

            return(Json(new { result = _SaveTxn }, JsonRequestBehavior.AllowGet));
        }
        public async Task <ActionResult> GetAcctDepositInfoList(jQueryDataTableParamModel Params, string CorpCd)
        {
            var list     = (await AccountOpService.GetAcctDepositInfos(null, null, CorpCd)).creditAssesOperationLst;
            var filtered = list.Skip(Params.iDisplayStart).Take(Params.iDisplayLength);

            return(Json(new
            {
                sEcho = Params.sEcho,
                iTotalRecords = list.Count(),
                iTotalDisplayRecords = list.Count(),
                aaData = list.Select(x => new object[] {
                    x.SelectedDepositType,
                    x.SelectedBankAcctType,
                    x.SelectedBankName,
                    x.BankAcctNo,
                    x.DepositAmt,
                    x.Txnid,
                    x.UserId,
                    x.Creationdt
                })
            }, JsonRequestBehavior.AllowGet));
        }
        public async Task <ActionResult> MerchftEventLoggerList(jQueryDataTableParamModel Params, string AccNo)
        {
            // check value when passing @BusnLocation
            var _filtered = new List <EventLogger>();
            var list      = (await AccountOpService.GetEventlist("A", AccNo, null)).eventLoggers;

            if (!string.IsNullOrEmpty(Params.sSearch))
            {
                Params.sSearch = Params.sSearch.ToLower();
            }

            if (!string.IsNullOrEmpty(Params.sSearch))
            {
                _filtered = list.Where(p => (!string.IsNullOrEmpty(p.EventId) ? p.EventId : string.Empty).ToLower().Contains(Params.sSearch) ||
                                       (!string.IsNullOrEmpty(p.SelectedEventType) ? p.SelectedEventType : string.Empty).ToLower().Contains(Params.sSearch) ||
                                       (!string.IsNullOrEmpty(p.RefKey) ? p.RefKey : string.Empty).ToLower().Contains(Params.sSearch) ||
                                       (!string.IsNullOrEmpty(p.Description) ? p.Description : string.Empty).ToLower().Contains(Params.sSearch) ||
                                       (!string.IsNullOrEmpty(p.ReminderDatetime) ? p.ReminderDatetime : string.Empty).ToLower().Contains(Params.sSearch) ||
                                       (!string.IsNullOrEmpty(p.ClosedDate) ? p.ClosedDate : string.Empty).ToLower().Contains(Params.sSearch) ||
                                       (!string.IsNullOrEmpty(p.UserId) ? p.UserId : string.Empty).ToLower().Contains(Params.sSearch) ||
                                       (!string.IsNullOrEmpty(p.CreationDate) ? p.CreationDate : string.Empty).ToLower().Contains(Params.sSearch)).ToList();


                _filtered = _filtered.Skip(Params.iDisplayStart).Take(Params.iDisplayLength).ToList();
            }
            else
            {
                _filtered = list.Skip(Params.iDisplayStart).Take(Params.iDisplayLength).ToList();
            }

            return(Json(new
            {
                sEcho = Params.sEcho,
                iTotalRecords = list.Count(),
                iTotalDisplayRecords = list.Count(),
                aaData = _filtered.Select(x => new object[] { x.EventId, x.SelectedEventType, x.RefKey, x.Description, x.ReminderDatetime, x.ClosedDate, x.UserId, x.CreationDate })
            }, JsonRequestBehavior.AllowGet));
        }
        public async Task <JsonResult> FillData(string Prefix, string ApplId)
        {
            switch (Prefix)
            {
            case "gen":
                var _Info   = (await CardAcctSignUpService.GetApplicationGeneralInfo(ApplId)).acctSignUp;
                var Selects = new AcctSignUp
                {
                    CycleNo       = await BaseService.GetCycle("I"),
                    PlasticType   = await BaseService.GetPlasticType(),
                    CorporateAcct = await BaseService.WebGetCorpCd(true),
                    //Position = await BaseClass.WebGetRefLib("Occupation"),
                    CompanyType      = await BaseService.GetRefLib("CmpyType"),
                    BillingType      = await BaseService.GetRefLib("BillingType"),
                    InvoicePref      = await BaseService.GetRefLib("InvPrefer"),
                    BusinessCategory = await BaseService.GetRefLib("BusnCategory"),
                    LangId           = await BaseService.GetRefLib("Language"),
                    TaxCategory      = await BaseService.GetRefLib("TaxCategory"),
                    NatureOfBusiness = await BaseService.GetRefLib("IndustryCd"),
                    ClientClass      = await BaseService.GetRefLib("ClientClass"),
                    ClientType       = await BaseService.GetRefLib("ClientType"),
                    PaymentMode      = await BaseService.GetRefLib("PaymtMethod"),
                    ReasonCd         = await BaseService.GetCAOReasonCd(),
                };
                return(Json(new { Model = _Info, Selects = Selects }, JsonRequestBehavior.AllowGet));


            case "fin":
                var _finInfo = (await AccountOpService.GetFinancialInfoForm(Convert.ToInt32(ApplId))).financialInfo;
                return(Json(_finInfo, JsonRequestBehavior.AllowGet));

            case "cao":
                var _credAssesInfo = (await CardAcctSignUpService.GetCAOGeneralInfo(null, ApplId)).creditAssesOperation;
                var PaymentTerm    = await BaseService.GetRefLib("PaymtTerm");

                var temp = PaymentTerm.SkipWhile(p => p.Value == "").ToList();
                PaymentTerm = (temp.OrderBy(p => Convert.ToInt32(p.Value))).ToList();

                var _CaoSelects = new CreditAssesOperation
                {
                    PaymentMode    = await BaseService.GetRefLib("PaymtMethod"),
                    PaymentTerm    = PaymentTerm,
                    TerritoryCd    = await BaseService.GetRefLib("SaleTerritory"),
                    RiskCategory   = await BaseService.GetRefLib("RiskCategory"),
                    AssesmtType    = await BaseService.GetRefLib("AssessmentType"),
                    DepositType    = await BaseService.GetRefLib("DepositType"),
                    BankAcctType   = await BaseService.GetRefLib("BankAcctType"),
                    BankName       = await BaseService.GetRefLib("Bank"),
                    ReasonCd       = await BaseService.GetCAOReasonCd(),
                    AppvStsBackOff = await BaseService.GetRefLib("ApplSts"),
                    AppvStsEDP     = await BaseService.GetRefLib("ApplSts"),
                    AppvStsQAOff   = await BaseService.GetRefLib("ApplSts"),
                    Qualitative    = await BaseService.GetRefLib("QualitativeRating"),
                    Quantitative   = await BaseService.GetRefLib("QuantitativeRating")
                    , TradingArea  = await BaseService.GetRefLib("TradingArea")
                };
                _credAssesInfo.GracePeriod = 20;
                return(Json(new { Model = _credAssesInfo, Selects = _CaoSelects }, JsonRequestBehavior.AllowGet));

            case "vel":
                var velocityLimitsList = new VeloctyLimitListMaintModel
                {
                    VelocityInd = await BaseService.GetRefLib("VelocityInd"),
                    ProdCd      = await BaseService.WebGetProduct(null),
                    CtrlType    = await BaseService.GetRefLib("CollateralType"),
                };
                var _Model = new VeloctyLimitListMaintModel
                {
                    UserId       = HttpContext.User.Identity.Name,
                    CreationDate = System.DateTime.Now.ToString("dd/MM/yyyy")
                };
                return(Json(new { Selects = velocityLimitsList, Model = _Model }, JsonRequestBehavior.AllowGet));

            case "dep":
                var _adi = new CreditAssesOperation
                {
                    DepositType  = await BaseService.GetRefLib("DepositType", null, "1"),
                    BankAcctType = await BaseService.GetRefLib("BankAcctType"),
                    BankName     = await BaseService.GetRefLib("SecurityDepositBank"),
                };
                return(Json(new { Selects = _adi, Model = new CreditAssesOperation() }, JsonRequestBehavior.AllowGet));

            case "skd":
                var Model = new SKDS
                {
                    UserId       = this.GetUserId,
                    CreationDate = NumberExtensions.DateConverter(DateTime.Now.ToShortDateString()),
                };
                var selects = new SKDS
                {
                    Sts          = await BaseService.GetRefLib("prodsts"),
                    SubsidyType  = await BaseService.GetRefLib("SubsidyLevel"),
                    Category     = BaseService.GetDataVersion().dataVersionLst,
                    SubsidyLevel = await BaseService.GetRefLib("SubsidyLevel")
                };
                return(Json(new { Selects = selects, Model = Model }, JsonRequestBehavior.AllowGet));

            case "add":
                var AddrSelects = new AddrListMaintModel
                {
                    addrtype = await BaseService.GetRefLib("Address"),
                    Country  = await BaseService.GetRefLib("Country"),
                    region   = await BaseService.GetRefLib("RegionCd"),
                };
                var AddrModel = new AddrListMaintModel
                {
                    UserId       = this.GetUserId,
                    CreationDate = System.DateTime.Now.ToString(),
                    RefTo        = "APPL"
                };
                return(Json(new { Selects = AddrSelects, Model = AddrModel }, JsonRequestBehavior.AllowGet));

            case "con":
                var otherContactList = new ContactLstModel
                {
                    ContactType = await BaseService.GetRefLib("Contact"),
                    Occupation  = await BaseService.GetRefLib("Occupation"),
                    Sts         = await BaseService.GetRefLib("ContactSts"),
                };
                var model = new ContactLstModel
                {
                    UserId       = HttpContext.User.Identity.Name,
                    CreationDate = System.DateTime.Now.ToString()
                };
                return(Json(new { Selects = otherContactList, Model = model }, JsonRequestBehavior.AllowGet));

            case "veh":
                var _VehiclesListModel = new VehiclesListModel
                {
                    VehColor = await BaseService.GetRefLib("Color"),
                    VehMaker = await BaseService.GetRefLib("VehMaker"),
                    VehModel = await BaseService.GetRefLib("VehSubModel"),
                    //check again
                    CardType = await BaseService.GetCardType(),
                    Sts      = await BaseService.GetRefLib("AcctSts"),
                    VehYr    = BaseService.WebGetYear(),
                    VehType  = await BaseService.GetRefLib("VehType")
                };
                return(Json(new { Selects = _VehiclesListModel, Model = new VehiclesListModel() }, JsonRequestBehavior.AllowGet));

            case "mis":
                var _Mis = new MiscellaneousInfoModel
                {
                    Designation = await BaseService.GetRefLib("Occupation")
                };
                return(Json(new { Model = new MiscellaneousInfoModel(), Selects = _Mis }, JsonRequestBehavior.AllowGet));

            case "csc":
                return(Json(new { Model = new CostCentre(), Selects = "" }, JsonRequestBehavior.AllowGet));

            case "apr":
                var _milestone = new Milestone
                {
                    Priority = await BaseService.GetRefLib("MilestonePriority"),
                    ReasonCd = await BaseService.GetRefLib("ReasonCd"),
                    Status   = await BaseService.GetRefLib("MilestoneSts"),
                    Owner    = (await UserAccessService.GetUserAccessListSelect()).RefLibLst
                };

                var _Status     = _milestone.Status.ToList();
                var PendingItem = _Status.FirstOrDefault(p => p.Value == "P");
                _Status.Remove(PendingItem);
                _milestone.Status = _Status;
                return(Json(new { Selects = _milestone, Model = new Milestone() }, JsonRequestBehavior.AllowGet));

            default:
                HttpContext.Response.StatusCode = 404;
                return(Json(null, JsonRequestBehavior.AllowGet));
            }
        }
        public async Task <ActionResult> MerchGetEventDetail(EventLogger _Logger, string module, string eventID)
        {
            var data = (await AccountOpService.GetEventLoggerDetail("A", eventID)).eventLogger;

            return(Json(new { eventDetail = data }, JsonRequestBehavior.AllowGet));
        }