コード例 #1
0
        private void BtnDangNhap_Click(object sender, EventArgs e)
        {
            TaiKhoanBAL bal = new TaiKhoanBAL();
            TaiKhoan    acc = new TaiKhoan();

            acc.Username = txtUsername.Text;
            acc.Password = txtPassword.Text;


            if (bal.KiemTraTaiKhoan(acc))
            {
                string filelogin = Application.StartupPath + "\\login.dat";
                IOUtil iou       = new IOUtil();
                Login  log       = new Login();
                log.UserName = txtUsername.Text;
                log.Password = txtPassword.Text;
                log.Save     = ckbLuuThongTin.Checked;
                iou.LuuFile(log, filelogin);
                frmTrangChu f = new frmTrangChu();
                this.Hide();
                f.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Sai thông tin đăng nhập");
            }
        }
コード例 #2
0
        private void BtnDoiMatKhau_Click(object sender, EventArgs e)
        {
            TaiKhoanBAL bal = new TaiKhoanBAL();

            if (bal.KiemTraMatKhau(txtMatKhau.Text))
            {
                groupBox1.Enabled = true;
            }
        }
コード例 #3
0
 private void BtnXacNhan_Click(object sender, EventArgs e)
 {
     if (String.Compare(txtMatKhauMoi.Text, txtXacNhan.Text, false) == 0)
     {
         TaiKhoanBAL bal = new TaiKhoanBAL();
         if (bal.SuaMatKhau(txtMatKhauMoi.Text))
         {
             MessageBox.Show("Đổi mật khẩu thành công ");
         }
     }
 }