public HttpResponseMessage SavePlaceOfServiceInformation(string companyId, [FromBody] PlaceOfServiceVm placeOfService) { placeOfService.CompanyID = companyId; AccessControl.VerifyUserAccessToMultiLocationOffice(companyId); var placeOfServiceId = ClaimsInformationIt2Manager.PlaceOfServiceSaveOrUpdate(companyId, placeOfService); return((placeOfServiceId > 0) ? this.Request.CreateResponse(HttpStatusCode.OK, new { validationmessage = "Place Of Service Added Successfully.", id = string.Empty + placeOfServiceId }) : this.Request.CreateResponse(HttpStatusCode.BadRequest, new { validationmessage = "Unable to add this Place Of Service." })); }
public PlaceOfServiceVm GetPlaceOfServiceDialogModel(string companyId, int placeOfServiceId) { AccessControl.VerifyUserAccessToCompany(companyId); var placeOfService = new PlaceOfServiceVm(); var result = ClaimsInformationIt2Manager.GetPlaceOfServiceFacilityTypes(); var facilityTypes = new List <SelectListItem>(); result.ForEach(l => facilityTypes.Add(new SelectListItem { Selected = false, Text = l.Description, Value = l.KeyStr })); result = ClaimsInformationIt2Manager.GetPlaceOfServiceQualifiers(); var qualifiers = new List <SelectListItem>(); result.ForEach(l => qualifiers.Add(new SelectListItem { Selected = false, Text = l.Description, Value = l.KeyStr })); if (placeOfServiceId != 0) { var list = ClaimsInformationIt2Manager.GetPlaceOfServiceById(companyId, placeOfServiceId); placeOfService = list.FirstOrDefault(); if (placeOfService == null) { return(null); } placeOfService.FacilityTypes = facilityTypes.ToKeyValuePairs(); placeOfService.Qualifiers = qualifiers.ToKeyValuePairs(); } else { placeOfService.FacilityTypes = facilityTypes.ToKeyValuePairs(); placeOfService.Qualifiers = qualifiers.ToKeyValuePairs(); placeOfService.Active = true; } return(placeOfService); }