public ActionResult DeleteConfirmed(int id)
        {
            F_Car f_cars = new F_Car();

            f_cars.Delete(id);
            return(RedirectToAction("Index"));
        }
        public ActionResult Index()
        {
            F_Car      f_cars = new F_Car();
            List <Car> list   = f_cars.List();

            return(View(list));
        }
        public List <Car> List()
        {
            F_Car      f_cars = new F_Car();
            List <Car> list   = f_cars.List();

            return(list);
        }
 public bool Edit(Car car)
 {
     try
     {
         F_Car f_cars = new F_Car();
         f_cars.Update(car);
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 public bool Create(Car car)
 {
     try
     {
         F_Car f_cars = new F_Car();
         f_cars.Insert(car);
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
 public ActionResult Edit(Car car)
 {
     try
     {
         F_Car f_cars = new F_Car();
         f_cars.Update(car);
         return(RedirectToAction("Index"));
     }
     catch (Exception e)
     {
         TempData["Error"] = e.Message.ToString();
         return(RedirectToAction("Edit"));
     }
 }
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(View("~/Views/Shared/Error.cshtml"));
            }
            F_Car f_cars = new F_Car();
            Car   car    = f_cars.Find(id);

            if (car == null)
            {
                return(View("~/Views/Shared/Error.cshtml"));
            }
            return(View(car));
        }
        public Car Find(int?id)
        {
            if (id == null)
            {
                return(null);
            }
            F_Car f_cars = new F_Car();
            Car   car    = f_cars.Find(id);

            if (car == null)
            {
                return(null);
            }
            return(car);
        }
        public void Delete(int id)
        {
            F_Car f_cars = new F_Car();

            f_cars.Delete(id);
        }