public ActionResult AddCustomerData(Models.Customer.CustomerModel custModel, List <Models.Customer.CustomerAddress> custAddress, List <Models.Customer.CustomerDependents> custDependents, List <Models.Customer.CustomerEmployment> custEmployment, List <Models.Customer.CustomerEducation> custEducation, List <Models.Customer.CustomerCharacter> custCharacter, string PISID) { if (custEmployment == null) { custEmployment = new List <Models.Customer.CustomerEmployment>(); } if (custCharacter == null) { custCharacter = new List <Models.Customer.CustomerCharacter>(); } if (custDependents == null) { custDependents = new List <Models.Customer.CustomerDependents>(); } if (custEducation == null) { custEducation = new List <Models.Customer.CustomerEducation>(); } if (custAddress == null) { custAddress = new List <Models.Customer.CustomerAddress>(); } custModel.custEmployment = custEmployment; custModel.custCharacter = custCharacter; custModel.custDependents = custDependents; custModel.custEducation = custEducation; foreach (Models.Customer.CustomerAddress address in custAddress) { custModel.custAddress.Add(address); } Mapper.CreateMap <Models.Customer.CustomerAddress, BusinessObjects.CustomerAddress>(); Mapper.CreateMap <Models.Customer.CustomerCharacter, BusinessObjects.CustomerCharacter>(); Mapper.CreateMap <Models.Customer.CustomerDependents, BusinessObjects.CustomerDependents>(); Mapper.CreateMap <Models.Customer.CustomerEducation, BusinessObjects.CustomerEducation>(); Mapper.CreateMap <Models.Customer.CustomerEmployment, BusinessObjects.CustomerEmployment>(); Mapper.CreateMap <Models.Customer.CustomerRecord, BusinessObjects.CustomerRecord>(); Mapper.CreateMap <Models.Customer.CustomerModel, BusinessObjects.CustomerModel>(); BusinessObjects.CustomerModel cModel = Mapper.Map <Models.Customer.CustomerModel, BusinessObjects.CustomerModel>(custModel); List <Dictionary <string, object> > session = (List <Dictionary <string, object> >)Session["loginDetails"]; string UserID = session[0]["ID"].ToString(); cModel.custRecord.PreparedByID = UserID; cModel.custRecord.DocumentStatusCode = "7"; cModel.custRecord.Permission = "5"; return(Content(service.UpdateCustomerData("Add", cModel, PISID).ToString())); }
public ActionResult UpdateCustomerData(Models.Customer.CustomerModel custModel, List <Models.Customer.CustomerAddress> custAddress, List <Models.Customer.CustomerDependents> custDependents, List <Models.Customer.CustomerEmployment> custEmployment, List <Models.Customer.CustomerEducation> custEducation, List <Models.Customer.CustomerCharacter> custCharacter, string PISID) { if (custEmployment == null) { custEmployment = new List <Models.Customer.CustomerEmployment>(); } if (custCharacter == null) { custCharacter = new List <Models.Customer.CustomerCharacter>(); } if (custDependents == null) { custDependents = new List <Models.Customer.CustomerDependents>(); } if (custEducation == null) { custEducation = new List <Models.Customer.CustomerEducation>(); } if (custAddress == null) { custAddress = new List <Models.Customer.CustomerAddress>(); } custModel.custEmployment = custEmployment; custModel.custCharacter = custCharacter; custModel.custDependents = custDependents; custModel.custEducation = custEducation; foreach (Models.Customer.CustomerAddress address in custAddress) { custModel.custAddress.Add(address); } Mapper.CreateMap <Models.Customer.CustomerAddress, BusinessObjects.CustomerAddress>(); Mapper.CreateMap <Models.Customer.CustomerCharacter, BusinessObjects.CustomerCharacter>(); Mapper.CreateMap <Models.Customer.CustomerDependents, BusinessObjects.CustomerDependents>(); Mapper.CreateMap <Models.Customer.CustomerEducation, BusinessObjects.CustomerEducation>(); Mapper.CreateMap <Models.Customer.CustomerEmployment, BusinessObjects.CustomerEmployment>(); Mapper.CreateMap <Models.Customer.CustomerRecord, BusinessObjects.CustomerRecord>(); Mapper.CreateMap <Models.Customer.CustomerModel, BusinessObjects.CustomerModel>(); BusinessObjects.CustomerModel cModel = Mapper.Map <Models.Customer.CustomerModel, BusinessObjects.CustomerModel>(custModel); return(Content(service.UpdateCustomerData("Update", cModel, PISID).ToString())); }