Пример #1
0
 // PUT api/facility/5
 public void Put(int id, Ombudsman.Models.Facility facility)
 {
     var repo = new OmbudsmanDb.OmbudsmanRepository();
     facility.OmbudsmanId = repo.GetOmbudsmanIdFromName(facility.OmbudsmanName);
     var result = repo.UpdateFacility(facility, System.Web.Security.Roles.IsUserInRole("Manager"));
     if (!result)
     {
         throw new HttpResponseException(HttpStatusCode.Unauthorized);
     }
 }
Пример #2
0
 public void Post(Ombudsman.Models.Facility facility)
 {
     var repo = new OmbudsmanDb.OmbudsmanRepository();
     facility.OmbudsmanId = repo.GetOmbudsmanIdFromName(facility.OmbudsmanName);
     repo.CreateFacility(facility);
 }