Exemple #1
0
        public ActionResult EditCar(Car car)
        {
            if (ModelState.IsValid)
            {
                Car c = myService.GetById(car.CarID);
                c.SerialNumber    = car.SerialNumber;
                c.PricePerMonth   = car.PricePerMonth;
                c.Note            = car.Note;
                c.MinPriceForRent = car.MinPriceForRent;
                c.PricePerDay     = car.PricePerDay;
                c.PricePerHour    = car.PricePerHour;
                c.seatNumber      = car.seatNumber;
                c.Fuel            = car.Fuel;
                c.Gear            = car.Gear;
                c.TypeId          = car.TypeId;
                c.CarModelId      = car.CarModelId;
                c.SubCategoryId   = car.SubCategoryId;
                c.CreationYearId  = car.CreationYearId;

                myService.Update(c);
                myService.Commit();
                //   serviceImage.AddPictureToCar(car.CarID, files);
                return(RedirectToAction("Index"));
            }
            return(View(car));
        }