Ejemplo n.º 1
0
 // GET api/values/5
 public IEnumerable<TreeInventoryModel> Get(int id)
 {
     try
     {
         InventoryService service = new InventoryService();
         return service.GetTreeInventoryByEstateName(id);
     }
     catch (Exception ex) {
          var response = ControllerContext.Request.CreateResponse(HttpStatusCode.NotFound);
          throw new HttpResponseException(response);
     }
 }
Ejemplo n.º 2
0
 // POST api/values
 public HttpStatusCode Post([FromBody]TreeInventoryModel inventory)
 {
     InventoryService service = new InventoryService();
     return service.SaveInventory(inventory);
 }