// GET: AssetTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AssetType assetType = db.T_AssetTypes.Find(id); if (assetType == null) { return(HttpNotFound()); } if (!DataManipulation.CannDeleteAssetType(db, id)) { return(RedirectToAction("CanNotDelete")); } return(View(assetType)); }