Ejemplo n.º 1
0
        public async Task <ActionResult> FillData(string prefix, string id)
        {
            switch (prefix)
            {
            case "gen":
                var data           = (await MechSignUpService.GetBusinessLocationGeneralInfoDetail(id)).merchantDetail;
                var _dealerGenInfo = new MerchantDetails
                {
                    Ownership      = await BaseService.GetRefLib("MerchOwnership"),
                    SIC            = await BaseService.GetMerchType("S"),
                    DBARegion      = await BaseService.GetRefLib("RegionCd"),
                    DBACity        = await BaseService.GetRefLib("City"),
                    DBAState       = await BaseService.WebGetState(null),
                    BankAcctType   = await BaseService.GetRefLib("BankAcctType"),
                    BankBranchCode = await BaseService.GetRefLib("BranchCd"),
                    cycNo          = await BaseService.GetCycle("A"),
                    CurrentStatus  = await BaseService.GetRefLib("MerchAcctSts"),
                    ReasonCd       = await BaseService.GetRefLib("MerchReasonCd"),
                    MCC            = await BaseService.GetMerchType("MerchType"),
                    BankAcctName   = await BaseService.GetRefLib("Bank"),
                    AreaCodes      = await BaseService.GetRefLib("AreaCd")
                };
                return(Json(new { Selects = _dealerGenInfo, Model = data }, JsonRequestBehavior.AllowGet));

            case "ter":
                var term = new BusnLocTerminal
                {
                    Status       = await BaseService.GetRefLib("TermSts"),
                    ProdType     = await BaseService.GetDeviceModel(),
                    TermType     = await BaseService.GetRefLib("TermType"),
                    ReasonCd     = await BaseService.GetRefLib("TermReasonCd"),
                    UserId       = this.GetUserId,
                    CreationDate = NumberExtensions.DateConverter(System.DateTime.Now.ToString())
                };
                return(Json(new { Selects = term, Model = new BusnLocTerminal() }, 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 "add":
                var countries = await BaseService.GetRefLib("Country");

                var AddrSelects = new AddrListMaintModel
                {
                    addrtype = await BaseService.GetRefLib("Address"),
                    State    = countries.Count() > 1 ? await BaseService.WebGetState(countries[1].Value) : null, //changes
                    Country  = countries,
                    region   = await BaseService.GetRefLib("RegionCd"),
                };
                var AddrModel = new AddrListMaintModel
                {
                    UserId       = this.GetUserId,
                    CreationDate = System.DateTime.Now.ToString(),
                    RefTo        = "BUSN",
                    RefKey       = Convert.ToString(id)
                };
                return(Json(new { Selects = AddrSelects, Model = AddrModel }, JsonRequestBehavior.AllowGet));

            case "sts":
                var StsDetails = (await CardHolderService.GetChangedAcctStsDetail(id.ToString(), "BUSN")).changeStatus;
                var selecs     = new ChangeStatus
                {
                    CurrentStatus  = await BaseService.GetRefLib("MerchAcctSts"),
                    RefType        = await BaseService.GetRefLib("EventType"),
                    ReasonCode     = await BaseService.GetRefLib("MerchReasonCd", ""),
                    ChangeStatusTo = await BaseService.GetRefLib("MerchAcctSts")
                };
                return(Json(new { Model = StsDetails, Selects = selecs }, JsonRequestBehavior.AllowGet));

            case "prs":
                var _Prz = new MerchProductPrize
                {
                    ProdCd = await BaseService.WebGetProduct(null, false)
                };
                return(Json(new { Selects = _Prz, Model = new MerchProductPrize() }, JsonRequestBehavior.AllowGet));

            case "own":
                var _OwnerShip = new MerchChangeOwnership
                {
                    BankAcctType = await BaseService.GetRefLib("BankAcctType"),
                    BankName     = await BaseService.GetRefLib("Bank"),
                    DBAState     = await BaseService.WebGetState(null)
                };
                var ownershipInfo = (await MechSignUpService.GetMerchChgOwnership(id)).merchChangeOwnership;
                return(Json(new { Selects = _OwnerShip, Model = ownershipInfo }, JsonRequestBehavior.AllowGet));

            default:
                HttpContext.Response.StatusCode = 404;
                return(Json(null, JsonRequestBehavior.AllowGet));
            }
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> FillData(string prefix, string AcctNo)
        {
            switch (prefix)
            {
            case "gen":
                var MerchGenInfo   = (await MechSignUpService.GetMAGeneralInfoDetail(AcctNo)).merchGeneralInfo;
                var _MAGeneralInfo = new MA_GeneralInfo
                {
                    AffiliatedWithCorpCode = await BaseService.WebGetCorpCd(true),
                    BankAcctType           = await BaseService.GetRefLib("BankAcctType"),
                    BankBranchCd           = await BaseService.GetRefLib("BranchCd"),
                    CurrentStatus          = await BaseService.GetRefLib("MerchAcctSts"),
                    CycleNo   = await BaseService.GetCycle("A"),
                    ReasonCd  = await BaseService.GetRefLib("MerchReasonCd"),
                    BusnModel = await BaseService.GetRefLib("BusnModel"),
                    BusnSize  = await BaseService.GetRefLib("BusnSize"),
                    Ownership = await BaseService.GetRefLib("MerchOwnership"),
                    BankName  = await BaseService.GetRefLib("Bank"),
                };
                return(Json(new { Selects = _MAGeneralInfo, Model = MerchGenInfo }, JsonRequestBehavior.AllowGet));

            case "mai":

            case "bus":
                var _MerchantDetails = new MerchantDetails
                {
                    DBACity       = await BaseService.GetRefLib("city"),
                    DBARegion     = await BaseService.GetRefLib("RegionCd"),
                    DBAState      = await BaseService.WebGetState(null),
                    BankAcctType  = await BaseService.GetRefLib("BankAcctType"),
                    CurrentStatus = await BaseService.GetRefLib("MerchAcctSts"),
                    Ownership     = await BaseService.GetRefLib("MerchOwnership"),
                    SIC           = await BaseService.GetMerchType("S"),
                };
                return(Json(new { Selects = _MerchantDetails, Model = new MerchantDetails() }, JsonRequestBehavior.AllowGet));

            case "car":
                return(PartialView(this.getPartialPath("MerchGeneralInfo", "CAMaint_CardRange_Partial")));


            case "agr":
                var _MA_GeneralInfo = new MA_GeneralInfo
                {
                    AffiliatedWithCorpCode = await BaseService.WebGetCorpCd(true),
                    BankAcctType           = await BaseService.GetRefLib("BankAcctType"),
                    BankBranchCd           = await BaseService.GetRefLib("BranchCd"),
                    BusnEst       = await BaseService.GetRefLib("BusnEst"),
                    CurrentStatus = await BaseService.GetRefLib("MerchAcctSts"),
                    ReasonCd      = await BaseService.GetRefLib("MerchReasonCd"),
                    BusnModel     = await BaseService.GetRefLib("BusnModel")
                };
                return(Json(new { Selects = _MA_GeneralInfo, Model = new MA_GeneralInfo() }, JsonRequestBehavior.AllowGet));

            case "BusnTerm":
                var _BusnLocTerminal = new BusnLocTerminal
                {
                    Status       = await BaseService.GetRefLib("MerchAcctSts"),
                    ProdType     = await BaseService.GetRefLib("ProdType"),
                    ReasonCd     = await BaseService.GetRefLib("TermReasonCd"),
                    UserId       = this.GetUserId,
                    CreationDate = NumberExtensions.DateConverter(System.DateTime.Now.ToString())
                };
                return(Json(new { Selects = _BusnLocTerminal, Model = new BusnLocTerminal() }, JsonRequestBehavior.AllowGet));

            case "mps":
                var _merchPstTxnSearch = new MerchPostedTxnSearch
                {
                    Dealer = await BaseService.WebGetDealerByMerch(AcctNo),
                    TxnCd  = await BaseService.WebGetTxnCode("A"),
                };
                return(Json(new { Selects = _merchPstTxnSearch, Model = new MerchPostedTxnSearch() }, JsonRequestBehavior.AllowGet));

            case "evt":
                var logger = new EventLogger
                {
                    EventType = await BaseService.GetRefLib("EventType"),
                    ReasonCd  = await BaseService.GetRefLib("MerchReasonCd")
                };
                return(Json(new { Selects = logger, Model = new EventLogger() }, JsonRequestBehavior.AllowGet));

            case "sts":
                var stsDetails = await CardHolderService.GetChangedAcctStsDetail(AcctNo.ToString(), "MERCH");

                var sts = new ChangeStatus
                {
                    CurrentStatus  = await BaseService.GetRefLib("MerchAcctSts"),
                    RefType        = await BaseService.GetRefLib("EventType"),
                    ReasonCode     = await BaseService.GetRefLib("MerchReasonCd", ""),
                    ChangeStatusTo = await BaseService.GetRefLib("MerchAcctSts")
                };
                return(Json(new { Selects = sts, Model = stsDetails.changeStatus }, JsonRequestBehavior.AllowGet));

            case "mpp":
                var model = new MerchProductPrize
                {
                    ProdCd = await BaseService.WebGetProduct(null, false)
                };
                return(Json(new { Selects = model, Model = new MerchProductPrize() }, JsonRequestBehavior.AllowGet));

            default:
                return(PartialView());
            }
        }