public ActionResult Edit(Bill bill) { if (ModelState.IsValid) { db.Entry(bill).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(bill); }
public ActionResult Create(Bill newBill) { if (ModelState.IsValid) { db.Bills.Add(newBill); db.SaveChanges(); return RedirectToAction("Index"); } else { return View(newBill); } }