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