Exemplo n.º 1
0
 public winRemove(MainWindow.Contact current_contact, DataBaseAdapter adapter)
 {
     try
     {
         InitializeComponent();
         this.current_contact = current_contact;
         this.adapter = adapter;
         switch (current_contact)
         {
             case MainWindow.Contact.Shops:
                 cmb.ItemsSource = adapter.getNamesAllShops();
                 break;
             case MainWindow.Contact.Suppliers:
                 cmb.ItemsSource = adapter.getNamesAllSuppliers();
                 break;
             case MainWindow.Contact.Workers:
                 cmb.ItemsSource = adapter.getNamesAllWorkers();
                 break;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("База данных недоступна", "Внимание", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }
Exemplo n.º 2
0
 public Login(DataBaseAdapter adapter)
 {
     InitializeComponent();
     this.adapter = adapter;
     cmbName.ItemsSource = adapter.getNamesAllWorkers();
 }