public ActionResult DeleteConfirmed(int id) { VehicleType vehicleType = _vehicleTypeManager.FindById((int)id); _vehicleTypeManager.Remove(vehicleType); TempData["msg"] = "Information has been deleted successfully"; return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { VehicleType vehicleType = _vehicleTypeManager.GetById(id); _vehicleTypeManager.Remove(vehicleType); TempData["Message"] = "Vehicle Type info remove successfully!"; return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { try { VehicleType vehicleType = _vehicleTypeManager.FindById((int)id); _vehicleTypeManager.Remove(vehicleType); TempData["msg"] = "Information has been deleted successfully"; return(RedirectToAction("Index")); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "VehicleTypes", "Delete"))); } }
// GET: VehicleType/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(HttpNotFound()); } var data = _typeManager.GetById((int)id); bool isDeleted = _typeManager.Remove(data); if (isDeleted) { return(RedirectToAction("Index")); } return(View()); }