Пример #1
0
        public ActionResult Vehicle(VehicleSearchCM form)
        {
            if (ModelState.IsValid)
            {
                AdminVehiclesVM VM   = new AdminVehiclesVM();
                var             repo = new VehicleRepositoryADO();
                VM.Vehicles = repo.Search(form, null);
                VM.SetYear();
                VM.SetPrice();

                VM.Form = form;
                return(View(VM));
            }
            else
            {
                AdminVehiclesVM VM   = new AdminVehiclesVM();
                var             repo = new VehicleRepositoryADO();
                VM.Vehicles = repo.Search(form, null);
                VM.SetYear();
                VM.SetPrice();

                VM.Form = form;
                return(View(VM));
            }
        }
Пример #2
0
        public ActionResult Vehicle()
        {
            AdminVehiclesVM VM   = new AdminVehiclesVM();
            var             repo = new VehicleRepositoryADO();
            VehicleSearchCM form = new VehicleSearchCM();

            VM.Vehicles = repo.Search(form, null);
            VM.SetYear();
            VM.SetPrice();

            return(View(VM));
        }