Esempio n. 1
0
        public WChoixJouet()
        {
            InitializeComponent();
            EmployeDAO employDAO  = new EmployeDAO();
            Employe    unEmployer = employDAO.find(1);

            LSubTitle.Content += " M. " + unEmployer.getNom();
            ArrayList listeJouets = classJouet.findAll();

            foreach (CatalogueJouetPoulmane.Jouet unjouet in listeJouets)
            {
                CBChoixJouet.Items.Add(unjouet.getLibelle());
            }
            //lesEnfants;
        }
Esempio n. 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string username = TBUser.Text;
            string password = TBPassword.Text;
            //bool valide = Passerelle.identification(username, password);
            EmployeDAO DaoEmploye = new EmployeDAO();
            Employe    unEmploye  = DaoEmploye.findlogin(username, password);
            bool       admin      = unEmploye.getAdmin();

            try
            {
                if (unEmploye != null)
                {
                    if (admin == true)
                    {
                        WAdmin windows = new WAdmin();
                        windows.Show();
                    }
                    else
                    {
                        WChoixJouet windows = new WChoixJouet();
                        windows.Show();
                    }
                    this.Close();
                }
                else
                {
                    lEtat.Content   = "Nom d'utilisateur ou mot de passe incorrecte";
                    TBPassword.Text = "";
                }
            }
            catch
            {
                MessageBox.Show("Connexion impossible");
                lEtat.Content = "Connexion impossible";
            }
        }