Exemple #1
0
 // POST: api/StoreProduct
 public HttpResponseMessage Post(FormDataCollection values)
 {
     try
     {
         bool wasAvailable = Convert.ToBoolean(values["Poseess"]);
         if (wasAvailable)
         {
             dc.StoreProduct_Delete(new Guid(values["StoreId"]), new Guid(values["ProductId"]));
         }
         else
         {
             dc.StoreProduct_Insert(new Guid(values["ProductId"]), new Guid(values["StoreId"]));
         }
         return(Request.CreateResponse(HttpStatusCode.OK));
     }
     catch
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest));
     }
 }