Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            F_Car f_cars = new F_Car();

            f_cars.Delete(id);
            return(RedirectToAction("Index"));
        }
Пример #2
0
        public ActionResult Index()
        {
            F_Car      f_cars = new F_Car();
            List <Car> list   = f_cars.List();

            return(View(list));
        }
Пример #3
0
        public List <Car> List()
        {
            F_Car      f_cars = new F_Car();
            List <Car> list   = f_cars.List();

            return(list);
        }
Пример #4
0
 public bool Edit(Car car)
 {
     try
     {
         F_Car f_cars = new F_Car();
         f_cars.Update(car);
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Пример #5
0
 public bool Create(Car car)
 {
     try
     {
         F_Car f_cars = new F_Car();
         f_cars.Insert(car);
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Пример #6
0
 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"));
     }
 }
Пример #7
0
        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));
        }
Пример #8
0
        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);
        }
Пример #9
0
        public void Delete(int id)
        {
            F_Car f_cars = new F_Car();

            f_cars.Delete(id);
        }