Ejemplo n.º 1
0
        private void btnXN_Click(object sender, EventArgs e)
        {
            ServiceLoginClient client = new ServiceLoginClient();
            IList <LoginDTO>   list   = client.Login(labUser.Text, frmMain.MaHoa(txtMKC.Text));

            if (list.Count == 0)
            {
                MessageBox.Show("Mật khẩu cũ không đúng!", "Lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtMKC.Text = "";
                txtMKC.Focus();
            }
            else
            {
                ServiceHeThongClient client1 = new ServiceHeThongClient();
                HeThongDTO           htDTO   = new HeThongDTO();
                htDTO.Username   = labUser.Text;
                htDTO.Password   = frmMain.MaHoa(txtMKMoiAgain.Text);
                htDTO.Manhanvien = frmMain.m_maNV;
                if (client1.updateHeThong(htDTO) == 0)
                {
                    MessageBox.Show("Đổi mật khẩu không thành công!");
                }
                else
                {
                    MessageBox.Show("Đổi mật khẩu thành công!");
                    this.Close();
                }
            }
        }
 private void btnXN_Click(object sender, EventArgs e)
 {
     ServiceLoginClient client = new ServiceLoginClient();
     IList<LoginDTO> list = client.Login(labUser.Text, frmMain.MaHoa(txtMKC.Text));
     if (list.Count == 0)
     {
         MessageBox.Show("Mật khẩu cũ không đúng!", "Lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtMKC.Text = "";
         txtMKC.Focus();
     }
     else
     {
         ServiceHeThongClient client1 = new ServiceHeThongClient();
         HeThongDTO htDTO = new HeThongDTO();
         htDTO.Username = labUser.Text;
         htDTO.Password = frmMain.MaHoa(txtMKMoiAgain.Text);
         htDTO.Manhanvien = frmMain.m_maNV;
         if (client1.updateHeThong(htDTO) == 0)
         {
             MessageBox.Show("Đổi mật khẩu không thành công!");
         }
         else
         {
             MessageBox.Show("Đổi mật khẩu thành công!");
             this.Close();
         }
     }
 }