public ActionResult Index(VehicleSearchCM form) { if (ModelState.IsValid) { SalesIndexVM VM = new SalesIndexVM(); var repo = new VehicleRepositoryADO(); VM.Vehicles = repo.Search(form, null); VM.SetYear(); VM.SetPrice(); VM.Form = form; return(View(VM)); } else { SalesIndexVM VM = new SalesIndexVM(); var repo = new VehicleRepositoryADO(); VM.Vehicles = repo.Search(form, null); VM.SetYear(); VM.SetPrice(); VM.Form = form; return(View(VM)); } }
public ActionResult Index() { SalesIndexVM VM = new SalesIndexVM(); var repo = new VehicleRepositoryADO(); VehicleSearchCM form = new VehicleSearchCM(); VM.Vehicles = repo.Search(form, null); VM.SetYear(); VM.SetPrice(); return(View(VM)); }