public ActionResult Edit([Bind(Include = "Food_ID,Name,Category_ID,Discount,Price,Remain,Description,Image,isToday,Status")] Food1 food1)
 {
     if (ModelState.IsValid)
     {
         db.Entry(food1).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Category_ID = new SelectList(db.Categories, "Category_ID", "Category_Name", food1.Category_ID);
     return(View(food1));
 }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "Bill_ID,Food_ID,User_ID,Time,Date,Price,Amount")] Bill bill)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bill).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.User_ID = new SelectList(db.Users, "User_ID", "Email", bill.User_ID);
     return(View(bill));
 }