public ActionResult Create(FundraisingTask fundraisingtask) { if (ModelState.IsValid) { db.FundraisingTasks.Add(fundraisingtask); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.Campaign = new SelectList(db.Campaigns, "ID", "Name", fundraisingtask.Campaign); return View(fundraisingtask); }
public ActionResult Edit(FundraisingTask fundraisingtask) { if (ModelState.IsValid) { db.Entry(fundraisingtask).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.Campaign = new SelectList(db.Campaigns, "ID", "Name", fundraisingtask.Campaign); return View(fundraisingtask); }