public ActionResult Update_AgentProfile(string Code)
        {
            Models.MaintenanceAgentProfile.AgentModel AgentModel = new Models.MaintenanceAgentProfile.AgentModel();
            AgentModel.AgentProfile = setAgentProfile(service.getAgentProfilebyCode(Code));
            var ID = AgentModel.AgentProfile.ID;

            AgentModel.AgentAddress  = setAgentAddress(service.getAgentAddressByID(ID));
            AgentModel.Gender        = setGender(customerSvc.getGender());
            AgentModel.CivilStatus   = setCivilStatus(customerSvc.getCivilStatus());
            AgentModel.District      = setDistrict(customerSvc.getDistrict());
            AgentModel.Organization  = setOrganization(customerSvc.getOrganization());
            AgentModel.Province      = setProvince(customerSvc.getProvince());
            AgentModel.City          = setCity(service.getCity(ID));
            AgentModel.AgentType     = setAgentType(service.getAgentType());
            AgentModel.HomeOwnership = setHomeOwnership(customerSvc.getHomeOwnership());
            AgentModel.WithCashCard  = setWithCashCard();
            return(View(AgentModel));
        }
예제 #2
0
        public ActionResult UpdateDependent(string UpdateType, Models.Customer.CustomerDependents custDependents)
        {
            Models.Customer.CustomerDependentsModel md = new CustomerDependentsModel();
            Mapper.CreateMap <BusinessObjects.Province, Models.Customer.Province>();
            Mapper.CreateMap <BusinessObjects.City, Models.Customer.City>();
            Mapper.CreateMap <BusinessObjects.Gender, Models.Customer.Gender>();
            Mapper.CreateMap <BusinessObjects.RelationshipType, Models.Customer.RelationshipType>();
            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(custDependents.ProvinceID));
            IEnumerable <Models.Customer.Gender>           Gender           = Mapper.Map <IEnumerable <BusinessObjects.Gender>, IEnumerable <Models.Customer.Gender> >(service.getGender());
            IEnumerable <Models.Customer.RelationshipType> RelationshipType = Mapper.Map <IEnumerable <BusinessObjects.RelationshipType>, IEnumerable <Models.Customer.RelationshipType> >(service.getRelationshipType());

            md.custDependents   = custDependents;
            md.Province         = Province;
            md.City             = City;
            md.Gender           = Gender;
            md.RelationshipType = RelationshipType;
            var pvr = new PartialViewResult();

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