Пример #1
0
        private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            string mail = txtMail.Text;
            string mdp  = txtMDP.Text;

            if (RessourceSQL.est_client(mail, mdp))
            {
                string[]     tab = RessourceSQL.nom_prenom_Client(mail);
                windowClient w   = new windowClient(tab[0], tab[1]);
                this.Visibility = Visibility.Hidden;
                w.Show();
            }

            if (RessourceSQL.est_CdR(mail, mdp))
            {
                string[]  tab = RessourceSQL.nom_prenom_CdR(mail);
                windowCdR w   = new windowCdR(tab[0], tab[1], tab[2], Convert.ToInt32(tab[3]));
                this.Visibility = Visibility.Hidden;
                w.Show();
            }

            if (RessourceSQL.est_gestionnaire(mail, mdp))
            {
                string[]           tab = RessourceSQL.nom_prenom_Gestionnaire(mail);
                windowGestionnaire w   = new windowGestionnaire(tab[0], tab[1]);
                this.Visibility = Visibility.Hidden;
                w.Show();
            }
        }
        private void buttonRetour_Click(object sender, RoutedEventArgs e)
        {
            //on possède le mail du cdr
            //on récupère le nom, prenom et le nombre de cook

            string [] infoCdR = RessourceSQL.nom_prenom_CdR(mailCdR);
            string    nom     = infoCdR[1];
            string    prenom  = infoCdR[2];
            int       nbCook  = Convert.ToInt32(infoCdR[3]);

            windowCdR w = new windowCdR(mailCdR, nom, prenom, nbCook);

            w.Show();
            this.Close();
        }