public ActionResult DeleteConfirmed(int id) { PersonnelDegrees personnelDegrees = personnelDegreeManager.Find(x => x.Id == id); personnelDegreeManager.Delete(personnelDegrees); CacheHelper.RemoveGetPersonnelDegreesFromCache(); return(RedirectToAction("Index")); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PersonnelDegrees personnelDegrees = personnelDegreeManager.Find(x => x.Id == id.Value); if (personnelDegrees == null) { return(HttpNotFound()); } return(View(personnelDegrees)); }
public ActionResult Create(PersonnelDegrees personnelDegrees) { ModelState.Remove("CreatedOnDatetime"); ModelState.Remove("ModifiedOnDatetime"); ModelState.Remove("ModifiedUsername"); if (ModelState.IsValid) { personnelDegreeManager.Insert(personnelDegrees); CacheHelper.RemoveGetPersonnelDegreesFromCache(); return(RedirectToAction("Index")); } return(View(personnelDegrees)); }
public ActionResult Edit(PersonnelDegrees personnelDegrees) { ModelState.Remove("CreatedOnDatetime"); ModelState.Remove("ModifiedOnDatetime"); ModelState.Remove("ModifiedUsername"); if (ModelState.IsValid) { PersonnelDegrees perDegrees = personnelDegreeManager.Find(x => x.Id == personnelDegrees.Id); perDegrees.Name = personnelDegrees.Name; personnelDegreeManager.Update(perDegrees); CacheHelper.RemoveGetPersonnelDegreesFromCache(); return(RedirectToAction("Index")); } return(View(personnelDegrees)); }