public IActionResult Delete(int id, FuelViewModel fuelmodel) { var fuel = new Fuel { Id = fuelmodel.Id }; try { _apiGetCalls.DeleteApiCall(fuel, id); return(RedirectToAction("Index")); } catch { return(View()); } }
public IActionResult DeleteModel(int id) { try { var carModel = _modelApiCall.GetT(id); _modelApiCall.DeleteApiCall(carModel, id); TempData["SuccessResultF"] = true; TempData["SuccessResultM"] = "Model deleted successfully"; return(RedirectToAction("Models", new { brandId = carModel.BrandId })); } catch (Exception) { TempData["SuccessResultF"] = false; TempData["SuccessResultM"] = "Something went wrong."; throw; } }
public IActionResult DeleteBrand(int brandid) { try { var brand = _brandApiCall.GetT(brandid); _brandApiCall.DeleteApiCall(brand, brandid); TempData["SuccessResultF"] = true; TempData["SuccessResultM"] = "Brand deleted successfully"; return(RedirectToAction("Index")); } catch (Exception ex) { TempData["SuccessResultF"] = false; TempData["SuccessResultM"] = "Something went wrong."; throw ex; } }
public ActionResult DeleteLocation(int id) { try { var location = _locationApiCall.GetT(id); _locationApiCall.DeleteApiCall(location, id); TempData["SuccessResultF"] = true; TempData["SuccessResultM"] = "Location deleted successfully"; return(RedirectToAction("Index")); } catch (Exception ex) { TempData["SuccessResultF"] = false; TempData["SuccessResultM"] = "Something went wrong."; throw ex; } }