예제 #1
0
        public ActionResult UpdateEmployment(string UpdateType, Models.Customer.CustomerEmployment custEmployment)
        {
            Models.Customer.CustomerEmploymentModel md = new CustomerEmploymentModel();
            Mapper.CreateMap <BusinessObjects.BusinessType, Models.Customer.BusinessType>();
            Mapper.CreateMap <BusinessObjects.NatureofBusiness, Models.Customer.NatureofBusiness>();
            IEnumerable <Models.Customer.BusinessType>     BusinessType     = Mapper.Map <IEnumerable <BusinessObjects.BusinessType>, IEnumerable <Models.Customer.BusinessType> >(service.getBusinessType());
            IEnumerable <Models.Customer.NatureofBusiness> NatureofBusiness = Mapper.Map <IEnumerable <BusinessObjects.NatureofBusiness>, IEnumerable <Models.Customer.NatureofBusiness> >(service.getNatureofBusiness());

            md.custEmployment   = custEmployment;
            md.BusinessType     = BusinessType;
            md.NatureofBusiness = NatureofBusiness;
            var pvr = new PartialViewResult();

            if (UpdateType == "update")
            {
                pvr = PartialView("_UpdateEmployment", md);
            }
            else if (UpdateType == "add")
            {
                pvr = PartialView("_AddEmployment", md);
            }
            return(pvr);
        }