// GET: DepreciationTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DepreciationType depreciationType = db.T_DepreciationTypes.Find(id); if (depreciationType == null) { return(HttpNotFound()); } if (!DataManipulation.CannDeleteDepreciationType(db, id)) { return(RedirectToAction("CanNotDelete")); } return(View(depreciationType)); }