public ActionResult Create(Group group) { if (ModelState.IsValid) { db.Groups.Add(group); db.SaveChanges(); return RedirectToAction("Index", "Faculty", new { id = group.FacultyID, groupID = group.GroupID }); } ViewBag.FacultyID = new SelectList(db.Faculties, "FacultyID", "Name", group.FacultyID); return View(group); }
public ActionResult Edit(Group group) { if (ModelState.IsValid) { db.Entry(group).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index", "Faculty", new { id = group.FacultyID, groupID = group.GroupID }); } ViewBag.FacultyID = new SelectList(db.Faculties, "FacultyID", "Name", group.FacultyID); return View(group); }