public ActionResult Create(SessionColor sessioncolor) { if (ModelState.IsValid) { db.SessionColors.Add(sessioncolor); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.SID = new SelectList(db.Sessions, "ID", "Name", sessioncolor.SID); return View(sessioncolor); }
public ActionResult Edit(SessionColor sessioncolor) { if (ModelState.IsValid) { db.Entry(sessioncolor).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.SID = new SelectList(db.Sessions, "ID", "Name", sessioncolor.SID); return View(sessioncolor); }