Beispiel #1
0
        public ActionResult CarDetail(int id)
        {
            Car car = myService.GetById(id);

            ViewBag.note  = serviceRating.avgRate(car);
            ViewBag.note1 = serviceRating.avgRateUser(car.User);
            return(View(car));
        }
Beispiel #2
0
        public ActionResult EditCar(int id)
        {
            var res  = serviceCarModel.GetMany().ToList();
            var sub  = serviceSubCategory.GetMany().ToList();
            var year = serviceCreation.GetMany().ToList();
            var type = serviceType.GetMany().ToList();

            ViewBag.TypeId         = new SelectList(type, "TypeId", "Name");
            ViewBag.CreationYearId = new SelectList(year, "CreationYearId", "Name");
            ViewBag.SubCategoryId  = new SelectList(sub, "SubCategoryId", "Name");
            ViewBag.CarModelId     = new SelectList(res, "CarModelId", "Name");
            Car car = myService.GetById(id);

            ViewBag.note  = serviceRating.avgRate(car);
            ViewBag.note1 = serviceRating.avgRateUser(car.User);
            if (car == null)
            {
                return(HttpNotFound());
            }
            return(View(car));
        }