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"); } }
private void BtnDoiMatKhau_Click(object sender, EventArgs e) { TaiKhoanBAL bal = new TaiKhoanBAL(); if (bal.KiemTraMatKhau(txtMatKhau.Text)) { groupBox1.Enabled = true; } }
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 "); } } }