Example #1
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            else
            {
                var model = _reservationManager.Find(i => i.Id == id);
                if (model == null)
                {
                    return(HttpNotFound());
                }

                return(View(model));
            }
        }
Example #2
0
        public ActionResult Delete(int id)
        {
            Car car = carManager.Find(x => x.Id == id);

            if (car.IsActive == false)
            {
                reservationManager.Delete(reservationManager.Find(x => x.CarID == id));
                reservationManager.Save();
            }
            carManager.Delete(car);

            carManager.Save();

            return(RedirectToAction("Index", "Car"));
        }
Example #3
0
 public ReservationDto GetReservation(int id)
 {
     WriteActualMethod();
     return(DtoConverter.ConvertToDto(reservationManager.Find(id)));
 }