Exemplo n.º 1
0
 // PUT: api/SoldProducts/5
 public void Put([FromBody] SoldProductModel product)
 {
     if (ModelState.IsValid)
     {
         ISoldProductModel model = product;
         soldProductData.Update(model);
     }
 }
Exemplo n.º 2
0
        public ActionResult EditConfirmed([Bind(Include = "ID, Price, Detail")] SoldProductModel product)
        {
            if (ModelState.IsValid)
            {
                ISoldProductModel model = product;

                try
                {
                    soldProductData.Update(model);
                    return(RedirectToAction("TableCategories", new { id = soldProductData.FindById(model.ID).TableID }));
                }
                catch (Exception ex)
                {
                    log.Error("Could't load sold product from Database", ex);
                    return(View("ErrorRetriveData"));
                }
            }
            else
            {
                log.Error("The model state of the  sold product is invalid");
                return(View("ErrorEditProduct"));
            }
        }