public ActionResult Edit(Classgroup Classgroup) { if (ModelState.IsValid) { dm.Classgroup_Edit(Classgroup); dm.Save(); return RedirectToAction("Index"); } return View(Classgroup); }
public ActionResult Create(Classgroup Classgroup) { if (ModelState.IsValid) { Classgroup.ID = Guid.NewGuid(); dm.Classgroup_Create(Classgroup); dm.Save(); return RedirectToAction("Index"); } return View(Classgroup); }
public Classgroup Classgroup_Edit(Classgroup obj) { db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); obj = db.Classgroups.SingleOrDefault(o => o.ID == obj.ID); return obj; }
public Classgroup Classgroup_Delete(Classgroup obj) { Classgroup classgroup = db.Classgroups.SingleOrDefault(o => o.ID == obj.ID); db.Classgroups.Remove(classgroup); db.SaveChanges(); return classgroup; }
public Classgroup Classgroup_Create(Classgroup obj) { obj.ID = Guid.NewGuid(); db.Classgroups.Add(obj); db.SaveChanges(); obj = db.Classgroups.FirstOrDefault(o => o.ID == obj.ID); return obj; }
public ActionResult DeleteConfirmed(Classgroup Classgroup) { dm.Classgroup_Delete(Classgroup); return RedirectToAction("Index"); }