public ActionResult Edit([Bind(Include = "IdDrink,DrinkName,Description,Price,Amount")] drink drink)
 {
     if (ModelState.IsValid)
     {
         db.Entry(drink).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(drink));
 }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "IdOrder,Name,Amount,IdDrink")] order order)
 {
     if (ModelState.IsValid)
     {
         db.Entry(order).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IdDrink = new SelectList(db.drinks, "IdDrink", "DrinkName", order.IdDrink);
     return(View(order));
 }