Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            VehicleType vehicleType = _vehicleTypeManager.FindById((int)id);

            _vehicleTypeManager.Remove(vehicleType);
            TempData["msg"] = "Information has been deleted successfully";
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            VehicleType vehicleType = _vehicleTypeManager.GetById(id);

            _vehicleTypeManager.Remove(vehicleType);

            TempData["Message"] = "Vehicle Type info remove successfully!";
            return(RedirectToAction("Index"));
        }
Beispiel #3
0
 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")));
     }
 }
Beispiel #4
0
        // 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());
        }