Esempio n. 1
0
        public ActionResult InitEdit(string campaignId, string campaignName, string contractNoRefer)
        {
            CustomerInfoViewModel custInfoVM = new CustomerInfoViewModel();

            if (TempData["CustomerInfo"] != null)
            {
                custInfoVM = (CustomerInfoViewModel)TempData["CustomerInfo"];
                TempData["CustomerInfo"] = custInfoVM; // Keep for change Tab
            }
            else
            {
                return(RedirectToAction("Search", "Customer"));
            }

            CampaignViewModel campaignVM = new CampaignViewModel();

            campaignVM.FirstName       = custInfoVM.FirstName;
            campaignVM.LastName        = custInfoVM.LastName;
            campaignVM.CustomerType    = custInfoVM.CustomerType;
            campaignVM.CardNo          = custInfoVM.CardNo;
            campaignVM.Email           = custInfoVM.Email;
            campaignVM.CampaignId      = campaignId;
            campaignVM.CampaignName    = campaignName;
            campaignVM.CustomerType    = custInfoVM.CustomerType;
            campaignVM.ChannelId       = this.UserInfo.ChannelId;
            campaignVM.ChannelName     = this.UserInfo.ChannelName;
            campaignVM.ContractNoRefer = contractNoRefer;

            if (custInfoVM.PhoneList != null && custInfoVM.PhoneList.Count > 0)
            {
                campaignVM.PhoneNo = custInfoVM.PhoneList[0].PhoneNo;
            }

            _commonFacade = new CommonFacade();
            var customerTypeList = _commonFacade.GetCustomerTypeSelectList();

            campaignVM.CustomerTypeList = new SelectList((IEnumerable)customerTypeList, "Key", "Value", string.Empty);

            return(PartialView("~/Views/Campaign/_CampaignEdit.cshtml", campaignVM));
        }
Esempio n. 2
0
        public ActionResult InitEdit(int?customerId, string campaignId, string campaignName, string contractNoRefer)
        {
            if (customerId == null)
            {
                return(Json(new
                {
                    Valid = false,
                    RedirectUrl = Url.Action("Search", "Customer")
                }));
            }

            CustomerInfoViewModel custInfoVM = this.MappingCustomerInfoView(customerId.Value);
            CampaignViewModel     campaignVM = new CampaignViewModel();

            campaignVM.FirstName       = custInfoVM.FirstName;
            campaignVM.LastName        = custInfoVM.LastName;
            campaignVM.CustomerType    = custInfoVM.CustomerType;
            campaignVM.CardNo          = custInfoVM.CardNo;
            campaignVM.Email           = custInfoVM.Email;
            campaignVM.CampaignId      = campaignId;
            campaignVM.CampaignName    = campaignName;
            campaignVM.CustomerType    = custInfoVM.CustomerType;
            campaignVM.ChannelId       = this.UserInfo.ChannelId;
            campaignVM.ChannelName     = this.UserInfo.ChannelName;
            campaignVM.ContractNoRefer = contractNoRefer;

            if (custInfoVM.PhoneList != null && custInfoVM.PhoneList.Count > 0)
            {
                campaignVM.PhoneNo = custInfoVM.PhoneList[0].PhoneNo;
            }

            _commonFacade = new CommonFacade();
            var customerTypeList = _commonFacade.GetCustomerTypeSelectList();

            campaignVM.CustomerTypeList = new SelectList((IEnumerable)customerTypeList, "Key", "Value", string.Empty);

            return(PartialView("~/Views/Campaign/_CampaignEdit.cshtml", campaignVM));
        }