Exemple #1
0
        public ActionResult UpdateAddress(string UpdateType, Models.Customer.CustomerAddress custAddress)
        {
            Models.Customer.CustomerAddressModel md = new CustomerAddressModel();
            Mapper.CreateMap <BusinessObjects.Province, Models.Customer.Province>();
            Mapper.CreateMap <BusinessObjects.City, Models.Customer.City>();
            Mapper.CreateMap <BusinessObjects.HomeOwnership, Models.Customer.HomeOwnership>();
            Mapper.CreateMap <BusinessObjects.AddressType, Models.Customer.AddressType>();
            IEnumerable <Models.Customer.Province>      Province      = Mapper.Map <IEnumerable <BusinessObjects.Province>, IEnumerable <Models.Customer.Province> >(service.getProvince());
            IEnumerable <Models.Customer.City>          City          = Mapper.Map <IEnumerable <BusinessObjects.City>, IEnumerable <Models.Customer.City> >(service.updateCity(custAddress.ProvinceID));
            IEnumerable <Models.Customer.HomeOwnership> HomeOwnership = Mapper.Map <IEnumerable <BusinessObjects.HomeOwnership>, IEnumerable <Models.Customer.HomeOwnership> >(service.getHomeOwnership());
            IEnumerable <Models.Customer.AddressType>   AddressType   = Mapper.Map <IEnumerable <BusinessObjects.AddressType>, IEnumerable <Models.Customer.AddressType> >(service.getAddressType(false));

            md.custAddress   = custAddress;
            md.Province      = Province;
            md.City          = City;
            md.HomeOwnership = HomeOwnership;
            md.AddressType   = AddressType;
            var pvr = new PartialViewResult();

            if (UpdateType == "update")
            {
                pvr = PartialView("_UpdateAddress", md);
            }
            else if (UpdateType == "add")
            {
                pvr = PartialView("_AddAddress", md);
            }
            return(pvr);
        }
Exemple #2
0
        public ActionResult Add_CustomerRecord()
        {
            Models.Customer.CustomerModel          custModel    = new Models.Customer.CustomerModel();
            BusinessObjects.CustomerRecord         custRecord   = new BusinessObjects.CustomerRecord();
            Models.Customer.CustomerRecord         CMcustRecord = new Models.Customer.CustomerRecord();
            List <Models.Customer.CustomerAddress> LCustAddress = new List <Models.Customer.CustomerAddress>();

            Models.Customer.CustomerAddress McustAddress = new Models.Customer.CustomerAddress();
            LCustAddress.Add(McustAddress);
            custModel.custRecord  = CMcustRecord;
            custModel.custAddress = LCustAddress;
            var PISID = System.Guid.NewGuid().ToString();

            custModel.custRecord.ID                = PISID;
            custModel.custAddress[0].ID            = System.Guid.NewGuid().ToString();
            custModel.custAddress[0].PISID         = PISID;
            custModel.custAddress[0].AddressTypeID = "0";
            custModel.allComponents                = setComponents(custRecord);
            return(View(custModel));
        }