Exemplo n.º 1
0
 private void VIN_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (VIN.Text.Length == 17)
         {
             if (LogicTransport.GetIdByVIN(VIN.Text) == 0)
             {
                 Change.IsEnabled = false;
                 MessageBoxResult message = MessageBox.Show("Транспорта с таким VIN кодом не существует, желаете добавить новый транспорт?", "Транспорт не найден", MessageBoxButton.YesNo);
                 if (message == MessageBoxResult.Yes)
                 {
                     Transport.AddTransport addTransport = new Transport.AddTransport();
                     LogicWindow.FromChangeDriver();
                     addTransport.Show();
                 }
             }
             else
             {
                 Change.IsEnabled = true;
                 Logic.SecurityContext.CurrentTransport = LogicTransport.GetIdByVIN(VIN.Text);
                 CurrentDriverList.ItemsSource          = DriverLogic.GetListDrivers().DefaultView;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void DataGrid_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         TableDriver            = DriverLogic.GetListDrivers();
         ListDriver.ItemsSource = TableDriver.DefaultView;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            dtDriver = DriverLogic.GetListDrivers();
            NextDriverList.ItemsSource = dtDriver.DefaultView;

            NextDriverList.Columns[0].Width = 200;
            NextDriverList.Columns[1].Width = 100;
            NextDriverList.Columns[2].Width = 100;
            NextDriverList.Columns[3].Width = 100;
            NextDriverList.Columns[4].Width = 100;
            NextDriverList.Columns[5].Width = 70;
            NextDriverList.Columns[6].Width = 100;
        }