public ActionResult Create(Payment payment) { if (ModelState.IsValid) { db.Payments.Add(payment); db.SaveChanges(); return RedirectToAction("Index"); } return View(payment); }
public ActionResult Edit(Payment payment) { if (ModelState.IsValid) { db.Entry(payment).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(payment); }