Exemplo n.º 1
0
        public async Task <JsonResult> FillData(string Prefix, string CorpCd)
        {
            switch (Prefix)
            {
            case "corp":
                Corporate _Corporate;
                var       Selects = new Corporate
                {
                    Ctry      = await BaseService.GetRefLib("country"),
                    State     = await BaseService.WebGetState("CtryCd"), //GetIssNo, null
                    AddrCd    = await BaseService.GetRefLib("Address"),
                    ContactCd = await BaseService.GetRefLib("Contact"),
                };
                if (!string.IsNullOrEmpty(CorpCd))
                {
                    _Corporate = Mapper.Map <Corporate>((await CorporateOpService.GetCorpAcctDetail(CorpCd)).coporate);
                }
                else
                {
                    _Corporate = new Corporate();
                }
                return(Json(new { Model = _Corporate, Selects = Selects }, JsonRequestBehavior.AllowGet));


            case "pdc":
                var _prodDiscount = new ProductDiscount
                {
                    ProdCd     = await BaseService.WebProductGroupSelect(),
                    RebatePlan = await BaseService.WebGetPlan("2"),
                    //BaseClass.WebGetPlan("2"),
                    DiscPlan     = await BaseService.WebGetPlan("2"),
                    ProdDiscType = await BaseService.GetRefLib("ProdDiscType"),
                    PlanId       = new List <SelectListItem>()
                };
                return(Json(new { Selects = _prodDiscount, Model = new ProductDiscount() }, JsonRequestBehavior.AllowGet));

            default:
                HttpContext.Response.StatusCode = 404;
                return(Json(null, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 2
0
        public async Task <ActionResult> ftCorpAcctDetail(string Corpd)
        {
            var data = (await CorporateOpService.GetCorpAcctDetail(Corpd)).coporate;

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