示例#1
0
        public void OnDeleteVehicle(Vehicle item, Vehicle[] numerable)
        {
            Action a = () =>
            {
                if (Client.IsLogin())
                {
                    SearchVehicle.ComplectSearchObject(numerable.ToList());
                    Items.UpdateAVehicle(SearchVehicle.GetItemSearched());
                    Items.UpdateAVehicleHeader(SearchVehicle.GetItemSearched());
                    Items.UpdateVehicle(SearchVehicle.GetItemSearched());
                }

                if (VehicleEdit.Dialog.Item.VIN == item.VIN && VehicleEdit.Dialog.Visibility == System.Windows.Visibility.Visible)
                {
                    VehicleEdit.Dialog.Hide();
                }

                if (Client.Vehicle.VIN == item.VIN)
                {
                    Items.UpdateMainPage();
                }

                if (Items.ucVehicle.VehicleGrid.Visibility == System.Windows.Visibility.Visible && Items.ucVehicle.Vehicle.VIN == item.VIN)
                {
                    Items.ucVehicle.VehicleGrid.Visibility = System.Windows.Visibility.Hidden;
                    Items.ucVehicle.Vehicle.VIN            = "null";
                }
            };

            System.Windows.Application.Current.Dispatcher.BeginInvoke(a);
        }
示例#2
0
        public static void SetActiveUser(User item)
        {
            User = item;

            //Items.mainWindow.
            Items.mainWindow.Title = $"{item.Login} - Головне вікно";
            Items.UpdateMainPage();
            Items.UpdateMenuButtons();

            Vehicle[] numerableVehicle = Server.ConnectProvider.SendAllVehicle();

            SearchVehicle.ClearSearchFields();
            SearchVehicle.ComplectSearchObject(numerableVehicle.ToList());
            Items.UpdateAVehicle(SearchVehicle.GetItemSearched());
            Items.UpdateVehicle(SearchVehicle.GetItemSearched());
            Items.UpdateAVehicleHeader(numerableVehicle.ToList());

            User[]      numerableUser     = Server.ConnectProvider.SelectAllUser();
            List <User> sortedApplication = (from i in numerableUser where i.Status != 0 && i.Status != 1 select i).ToList();

            Items.UpdateAUser(Items.ucAUser.SearchAsLogin(sortedApplication));
            Items.UpdateAUserHeader(numerableUser.ToList());

            Items.ucStatistic.SetStatisticPage(UCPage.StatisticPage.Year);
        }
示例#3
0
        private void onSearchClick(object sender, RoutedEventArgs e)
        {
            Items.mainWindow.GridBackgroundDialog.Visibility = Visibility.Visible;
            SearchVehicle.Show();
            Items.mainWindow.GridBackgroundDialog.Visibility = Visibility.Hidden;

            Items.UpdateAVehicle(SearchVehicle.GetItemSearched());
        }
示例#4
0
        public IQueryable <Vehicles> SearchVehicles(SearchVehicle search)
        {
            IQueryable <Vehicles> allVehicles = _context.Vehicles;

            if (search.Make != null)
            {
                allVehicles = allVehicles.Where(r => r.Make == search.Make);
            }

            if (search.Year != null)
            {
                allVehicles = allVehicles.Where(r => r.Year == search.Year);
            }

            if (search.Color != null)
            {
                allVehicles = allVehicles.Where(r => r.Color == search.Color);
            }

            //if (search.FilterPrice > 0)
            //{
            //    allVehicles = allVehicles.Where(r => r.Price <= search.FilterPrice);
            //}

            if (search.HasSunRoof != null)
            {
                allVehicles = allVehicles.Where(r => r.HasSunRoof == search.HasSunRoof);
            }

            if (search.IsFourWheelDrive != null)
            {
                allVehicles = allVehicles.Where(r => r.IsFourWheelDrive == search.IsFourWheelDrive);
            }

            if (search.HaslowMiles != null)
            {
                allVehicles = allVehicles.Where(r => r.HaslowMiles == search.HaslowMiles);
            }

            if (search.HasPowerWindows != null)
            {
                allVehicles = allVehicles.Where(r => r.HasPowerWindows == search.HasPowerWindows);
            }

            if (search.HasNavigation != null)
            {
                allVehicles = allVehicles.Where(r => r.HasNavigation == search.HasNavigation);
            }

            if (search.HasHeatedSeats != null)
            {
                allVehicles = allVehicles.Where(r => r.HasHeatedSeats == search.HasHeatedSeats);
            }



            return(allVehicles);
        }
示例#5
0
        public void OnAddVehicle(Vehicle item, Vehicle[] numerable)
        {
            Action a = () =>
            {
                if (Client.IsLogin())
                {
                    SearchVehicle.ComplectSearchObject(numerable.ToList());
                    Items.UpdateAVehicle(SearchVehicle.GetItemSearched());
                    Items.UpdateAVehicleHeader(SearchVehicle.GetItemSearched());
                    Items.UpdateVehicle(SearchVehicle.GetItemSearched());
                }
            };

            System.Windows.Application.Current.Dispatcher.BeginInvoke(a);
        }
示例#6
0
        private void onClickSearch(object sender, RoutedEventArgs e)
        {
            Items.mainWindow.GridBackgroundDialog.Visibility = Visibility.Visible;
            SearchVehicle.Show();
            Items.mainWindow.GridBackgroundDialog.Visibility = Visibility.Hidden;

            Items.UpdateVehicle(SearchVehicle.GetItemSearched());

            if (Items.ucVehicle.vehicleRow.Count != 0)
            {
                Items.ucVehicle.Vehicle = Items.ucVehicle.vehicleRow[0].Item;
                //Items.UpdateVehicleActive(Items.ucVehicle.vehicleRow[0].Item);
                Items.ucVehicle.VehicleGrid.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                Items.ucVehicle.VehicleGrid.Visibility = System.Windows.Visibility.Hidden;
            }
        }