public IActionResult DeleteRenter(string id)
        {
            Renters r = rentersLogic.GetOneRenter(id);
            Cars    c = carsLogic.GetOneCar(r.CarId);

            if (c != null)
            {
                c.Available = true;
            }
            carsLogic.Save();
            r.CarId = null;

            rentersLogic.DeleteRenter(id);

            return(RedirectToAction(nameof(ListRenters)));
        }
예제 #2
0
 public Renters GetOneRenter(string renterid)
 {
     return(rLogic.GetOneRenter(renterid));
 }