Пример #1
0
        private void fermer_Click(object sender, EventArgs e)
        {
            this.Close();
            Authentification monAuthentification = new Authentification();

            monAuthentification.ShowDialog();
        }
Пример #2
0
        private void verouiller_Click(object sender, EventArgs e)
        {
            this.Close();
            selection.Width = verouiller.Width;
            selection.Left  = verouiller.Left;
            Authentification monAuthentification = new Authentification();

            monAuthentification.ShowDialog();
        }
Пример #3
0
 private void confValider_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(ancienLogin1.Text))
     {
         MessageBox.Show("Please enter your username and password", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         ancienLogin1.Focus();
         ancienLogin1.Text = "";
         ancienPass1.Text  = "";
         return;
     }
     try
     {
         AppDataTableAdapters.AdministrateurTableAdapter admin = new AppDataTableAdapters.AdministrateurTableAdapter();
         AppData.AdministrateurDataTable dt = admin.GetData();
         if (dt.Rows.Count > 0)
         {
             if (nouveauLogin1.Text != "" && nouveauPass1.Text != "")
             {
                 if (nouveauPass1.Text == confirmation1.Text)
                 {
                     admin.UpdateQueryUserPass(nouveauLogin1.Text, nouveauPass1.Text);
                     this.Close();
                     Authentification monAuthentification = new Authentification();
                     monAuthentification.ShowDialog();
                 }
                 else
                 {
                     MessageBox.Show("Password incorrect", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     nouveauLogin1.Text = "";
                     nouveauPass1.Text  = "";
                     confirmation1.Text = "";
                     ancienLogin1.Text  = "";
                     ancienPass1.Text   = "";
                     return;
                 }
             }
             else
             {
                 MessageBox.Show("Please enter your new username and password", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 nouveauLogin1.Text = "";
                 nouveauPass1.Text  = "";
                 confirmation1.Text = "";
                 ancienLogin1.Text  = "";
                 ancienPass1.Text   = "";
                 return;
             }
         }
         else
         {
             MessageBox.Show("Your username or password is incorrect", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
             ancienLogin1.Text = "";
             ancienPass1.Text  = "";
             return;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
         ancienLogin1.Text = "";
         ancienPass1.Text  = "";
         return;
     }
 }