public ActionResult Edit(Level_type level_type) { if (ModelState.IsValid) { dm.Level_Type_Edit(level_type); dm.Save(); return RedirectToAction("Index"); } return View(level_type); }
public ActionResult Create(Level_type level_type) { if (ModelState.IsValid) { level_type.ID = Guid.NewGuid(); dm.Level_Type_Create(level_type); dm.Save(); return RedirectToAction("Index"); } return View(level_type); }
public Level_type Level_Type_Edit(Level_type obj) { db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); obj = db.Level_type.SingleOrDefault(o => o.ID == obj.ID); return obj; }
public Level_type Level_Type_Delete(Level_type obj) { Level_type level_type = db.Level_type.SingleOrDefault(o => o.ID == obj.ID); db.Level_type.Remove(level_type); db.SaveChanges(); return level_type; }
public Level_type Level_Type_Create(Level_type obj) { obj.ID = Guid.NewGuid(); db.Level_type.Add(obj); db.SaveChanges(); obj = db.Level_type.FirstOrDefault(o => o.ID == obj.ID); return obj; }
public ActionResult DeleteConfirmed(Level_type level_type) { dm.Level_Type_Delete(level_type); return RedirectToAction("Index"); }