public ActionResult Edit(FinanceDonation financedonation) { if (ModelState.IsValid) { db.Entry(financedonation).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.EventID = new SelectList(db.Events, "EventID", "Title", financedonation.EventID); ViewBag.UserID = new SelectList(db.Users, "UserID", "LastName", financedonation.UserID); return View(financedonation); }
public ActionResult Create(FinanceDonation financedonation) { if (ModelState.IsValid) { db.FinanceDonations.Add(financedonation); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.EventID = new SelectList(db.Events, "EventID", "Title", financedonation.EventID); ViewBag.UserID = new SelectList(db.Users, "UserID", "LastName", financedonation.UserID); return View(financedonation); }