public HttpResponseMessage Post(ApiClientModel client) { APIModelMapper apiModelMapper = new APIModelMapper(); ClientModel model = apiModelMapper.MapClientModel(client); if (_clientManager.Record(model)) { return(new HttpResponseMessage(HttpStatusCode.OK)); } return(new HttpResponseMessage(HttpStatusCode.BadRequest)); }
public HttpResponseMessage AddInsurance([FromBody] ApiInsuranceModel insurance) { //Mapping Api Models to Common Models APIModelMapper mapper = new APIModelMapper(); InsuranceModel selectedInsurance = mapper.MapInsuranceTypeModel(insurance.InsuranceType, insurance, insurance.SelectedInsurance); ClientModel client = mapper.MapClientModel(insurance.Client); PolicyCoverageDetailModel policyCoverage = mapper.MapPolicyCoverageDetailModel(insurance.PolicyDetails); DocumentModel document = mapper.MapDocumentModel(insurance.Documents); CoverageModel coverage = mapper.MapCoverage(insurance.Coverage); if (_insuranceManager.Record(selectedInsurance, client, policyCoverage, document, coverage)) { return(new HttpResponseMessage(HttpStatusCode.OK)); } return(new HttpResponseMessage(HttpStatusCode.BadRequest)); }