Exemple #1
0
        public Client()
        {
            InitializeComponent();
            Model.DAL.DALClient bdd = new Model.DAL.DALClient();

            bdd.SelectClient(listeclients);
            dataGrid1.ItemsSource = listeclients;
        }
Exemple #2
0
        public void OnPropertyChanged(string info)
        {
            PropertyChangedEventHandler handler = PropertyChanged;

            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(info));
                Model.DAL.DALClient bdd = new Model.DAL.DALClient();
                bdd.UpdateClient(this);
            }
        }
Exemple #3
0
        private void Button_Click_Insert_Client(object sender, RoutedEventArgs e)
        {
            ObservableCollection <ViewModel.ClientBinder> UserExist = new ObservableCollection <ViewModel.ClientBinder>();

            Model.DAL.DALClient bdd = new Model.DAL.DALClient();
            bdd.AddClient(UserExist, nom.Text, prenom.Text, pseudo.Text, mail.Text, password.Text);

            if (UserExist.Count() != 0)
            {
                MessageBox.Show("Pseudo ou mail existe déjà");
            }
            else
            {
                nom.Clear();
                prenom.Clear();
                pseudo.Clear();
                mail.Clear();
                password.Clear();
                View.connexion_inscription co = new View.connexion_inscription();
                co.Show();
                this.Close();
            }
        }
Exemple #4
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();
            }
        }