Exemplo n.º 1
0
        private void Button_Click_Connect(object sender, RoutedEventArgs e)
        {
            ObservableCollection <ViewModel.ClientBinder> Actifclients = new ObservableCollection <ViewModel.ClientBinder>();
            ObservableCollection <ViewModel.ClientBinder> Actifadmin   = new ObservableCollection <ViewModel.ClientBinder>();

            Model.DAL.DALClient bdd = new Model.DAL.DALClient();
            bdd.getClient(Actifclients, Actifadmin, pseudo.Text, password.Password);

            if (Actifclients.Count() == 0)
            {
                if (Actifadmin.Count == 0)
                {
                    MessageBox.Show("Erreur d'identification");
                }
                else
                {
                    MainWindow main = new MainWindow();
                    // Show window modelessly
                    // NOTE: Returns without waiting for window to close
                    main.Show();
                    this.Close();
                }
            }
            else if (Actifclients.Count() == 0)
            {
                MessageBox.Show("Erreur d'identification client");
            }
            else
            {
                MainWindowClient mainclient = new MainWindowClient();
                // Show window modelessly
                // NOTE: Returns without waiting for window to close
                mainclient.Show();
                this.Close();
            }
        }