Exemplo n.º 1
0
        public void Refresh()
        {
            _cars = connection.GetCars();

            // before  FilteredCars.Clear() the SelectedCar needs to point to a valid location
            // (with  FilteredCars.Clear(), the referenced object will disappear, and will give error at Display Fields)
            SelectedCar = null;
            FilteredCars.Clear();

            _cars.ForEach(x => FilteredCars.Add(x));
            ClearFields();
        }
Exemplo n.º 2
0
 public ViewResult CarForm(FilteredCars userResponse)
 {
     if (ModelState.IsValid)
     {
         userResponse.GetCars();
         UserBase.Instance.CurrentUser.currentADS = userResponse.ads;
         return(View("CarList", userResponse));
     }
     else
     {
         FilteredCars filter = new FilteredCars(currentBase.CurrentUser.Email);
         return(View(filter));
     }
 }
Exemplo n.º 3
0
        public void Filter()
        {
            if (string.IsNullOrEmpty(FilterBrand) && string.IsNullOrEmpty(FilterModel) && string.IsNullOrEmpty(FilterLicensePlate) && string.IsNullOrEmpty(FilterOwnerFirstName))
            {
                Refresh();
                return;
            }

            _cars = connection.GetCars();
            // before  FilteredCars.Clear() the SelectedCar needs to point to a valid location
            // (with  FilteredCars.Clear(), the referenced object will disappear, and will give error at Display Fields)
            SelectedCar = null;
            FilteredCars.Clear();

            List <Car> temp = new List <Car>();

            temp = FilterByBrand(_cars);
            temp = FilterByModel(temp);
            temp = FilterByLicensePlate(temp);
            temp = FilterByOwner(temp);
            temp.ForEach(x => FilteredCars.Add(x));
        }
Exemplo n.º 4
0
        public ViewResult CarForm()
        {
            FilteredCars searcher = new FilteredCars(currentBase.CurrentUser.Email);

            return(View(searcher));
        }