Ejemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text.Length > 0 && textBox2.Text.Length > 0 && textBox3.Text.Length > 0 && textBox4.Text.Length > 0)
     {
         AccountDao account = new AccountDao();
         if (account.CheckLogin(textBox1.Text, textBox2.Text))
         {
             bool Success = account.ChangePasswordAccount(textBox1.Text, textBox3.Text);
             if (Success)
             {
                 MessageBox.Show("Change Password Successful !");
                 textBox1.Text = "";
                 textBox2.Text = "";
                 textBox3.Text = "";
                 // Chuyển về form đăng nhập ???
             }
             else
             {
                 MessageBox.Show("Sai ở đâu đó. Cái này không nên hiện ra !");
                 textBox1.Text = "";
                 textBox2.Text = "";
                 textBox3.Text = "";
             }
         }
         else
         {
             MessageBox.Show("Change Password Failed !");
             textBox1.Text = "";
             textBox2.Text = "";
             textBox3.Text = "";
         }
     }
     else
     {
         textBox1.Text = "";
         textBox2.Text = "";
         textBox3.Text = "";
     }
 }