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);
        }
Beispiel #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);
        }
Beispiel #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());
        }
        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);
        }
Beispiel #5
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;
            }
        }