Esempio n. 1
0
 private void btnConnexion_Click(object sender, RoutedEventArgs e)
 //lorsque on clique sur le bouton pour se connecter
 {
     Animations.AddSound(1);
     if (txtUserName.Text.ToUpper() == "ADMIN")
     //Dans le cas ou l'administrateur se connecte on affiche l'interface d'administartion
     {
         Eleve ctd = new Eleve();
         int   c   = ctd.Connecter(txtUserName.Text.ToUpper(), txtPassword.Password.ToUpper());
         if (c == 1)
         {
             InterfaceAdministrateur interfaceadmin = new InterfaceAdministrateur();
             interfaceadmin.Show();
         }
         else
         {
             if (c == -1)
             {
                 InterfaceMessageBox interfaceMessageBox = new InterfaceMessageBox(" كلمة السر خاطئ");
                 interfaceMessageBox.Show();
                 errorImage.Visibility = System.Windows.Visibility.Visible;
             }
             else if (c == 0)
             {
                 InterfaceMessageBox interfaceMessageBox = new InterfaceMessageBox("اسم المستخدم خاطئ" + "\n" + " قم بفتح حساب جديد");
                 interfaceMessageBox.Show();
             }
         }
     }
     else
     {
         if ((txtUserName.Text == "") || (txtPassword.Password == ""))
         {
             InterfaceMessageBox interfaceMessageBox = new InterfaceMessageBox("عليك ملء كل الخانات");
             interfaceMessageBox.Show();
         }
         else
         {
             Eleve ctd = new Eleve();
             int   c   = ctd.Connecter(txtUserName.Text, txtPassword.Password);
             if (c == 1)
             //  si le nom d'utilisateur et le mot de passe sont justes
             {
                 this.NavigationService.Navigate(new InterfaceHomePage());
             }
             else
             {
                 if (c == -1)
                 // si le mot de passe est erroné
                 {
                     InterfaceMessageBox interfaceMessageBox = new InterfaceMessageBox(" كلمة السر خاطئ");
                     interfaceMessageBox.Show();
                     errorImage.Visibility = System.Windows.Visibility.Visible;
                 }
                 else if (c == 0)
                 //si le compte est inexistant
                 {
                     InterfaceMessageBox interfaceMessageBox = new InterfaceMessageBox("اسم المستخدم خاطئ" + "\n" + " قم بفتح حساب جديد");
                     interfaceMessageBox.Show();
                 }
             }
         }
     }
 }
Esempio n. 2
0
 private void button_Click(object sender, RoutedEventArgs e)
 {
     Animations.AddSound(1);
     startProgram();
 }
Esempio n. 3
0
 public InterfaceConnexion()
 {
     InitializeComponent();
     Animations.AddSound(2);
     errorImage.Visibility = System.Windows.Visibility.Hidden;
 }
Esempio n. 4
0
 private void button2_Click(object sender, RoutedEventArgs e)
 {
     Animations.AddSound(1);
     this.NavigationService.Navigate(new InterfaceHomePage());
 }