示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PersonnelDegrees personnelDegrees = personnelDegreeManager.Find(x => x.Id == id);

            personnelDegreeManager.Delete(personnelDegrees);
            CacheHelper.RemoveGetPersonnelDegreesFromCache();
            return(RedirectToAction("Index"));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
 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));
 }