public Achievement_type Achievement_Type_Edit(Achievement_type obj) { db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); obj = db.Achievement_type.SingleOrDefault(o => o.ID == obj.ID); return obj; }
public Achievement_type Achievement_Type_Delete(Achievement_type obj) { Achievement_type achievement_type = db.Achievement_type.SingleOrDefault(o => o.ID == obj.ID); db.Achievement_type.Remove(achievement_type); db.SaveChanges(); return achievement_type; }
public Achievement_type Achievement_Type_Create(Achievement_type obj) { obj.ID = Guid.NewGuid(); db.Achievement_type.Add(obj); db.SaveChanges(); obj = db.Achievement_type.FirstOrDefault(o => o.ID == obj.ID); return obj; }
public ActionResult Edit(Achievement_type achievement_type) { if (ModelState.IsValid) { dm.Achievement_Type_Edit(achievement_type); dm.Save(); return RedirectToAction("Index"); } return View(achievement_type); }
public ActionResult Create(Achievement_type achievement_type) { if (ModelState.IsValid) { achievement_type.ID = Guid.NewGuid(); dm.Achievement_Type_Create(achievement_type); dm.Save(); return RedirectToAction("Index"); } return View(achievement_type); }
public ActionResult DeleteConfirmed(Achievement_type Achievement_type) { dm.Achievement_Type_Delete(Achievement_type); return RedirectToAction("Index"); }