Esempio n. 1
0
        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());
            }
        }
Esempio n. 2
0
        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;
            }
        }
Esempio n. 3
0
        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;
            }
        }
Esempio n. 4
0
        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;
            }
        }