public ActionResult Create(Organization organization) { if (ModelState.IsValid) { db.Organizations.Add(organization); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.CommunityID = new SelectList(db.Communities, "CommunityID", "Name", organization.CommunityID); return View(organization); }
public ActionResult Edit(Organization organization) { if (ModelState.IsValid) { db.Entry(organization).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.CommunityID = new SelectList(db.Communities, "CommunityID", "Name", organization.CommunityID); return View(organization); }