public ActionResult Delete(int id, IFormCollection collection) { var item = VehicleRentalPriceService.GetById(id); try { var response = VehicleRentalPriceService.Delete(id); if (response.IsSuccess) { return(RedirectToAction(nameof(Index), new { vehilceId = item.VehicleId })); } else { ViewBag.Response = response; } } catch { ViewBag.Response = Domain.DTOs.Response.Fail("Bir hata oluştu"); } finally { SetVehicleToViewBag(item.VehicleId); } return(View(item)); }
// GET: VehicleRentalPriceController/Edit/5 public ActionResult Edit(int id) { var item = VehicleRentalPriceService.GetById(id); SetVehicleToViewBag(item.VehicleId); ViewBag.RentalPeriods = GetRentalPeriods(); return(View(item)); }