private void btnOK_Click(object sender, EventArgs e) { if (CountLogin > 0 && Check() == true) { if (BUS.cNhanVienBUS.CheckUser(txtUsername.Text, BUS.cNhanVienBUS.ToMD5(BUS.cNhanVienBUS.ToMD5(BUS.cNhanVienBUS.ToMD5(txtPassword.Text)))) == true) { DO.cCommonDO.CurrentUser = BUS.cNhanVienBUS.GetStaffInforByID(txtUsername.Text); frmGiaodienchinh Trangchinh = new frmGiaodienchinh(); Trangchinh.Show(); this.DialogResult = DialogResult.OK; this.Hide(); } else { CountLogin--; XtraMessageBox.Show("Sai tên đăng nhập hoặc mật khẩu! \nVui lòng kiểm tra lại .\nBạn còn " + CountLogin + " lần đăng nhập nữa.", "FGS Logistics - Đăng nhập", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } if (CountLogin == 0) Application.Exit(); }
private void btnOK_Click(object sender, EventArgs e) { if (CountLogin > 0 && Check() == true) { if (BUS.cNhanVienBUS.CheckUser(txtUsername.Text, BUS.cNhanVienBUS.ToMD5(BUS.cNhanVienBUS.ToMD5(BUS.cNhanVienBUS.ToMD5(txtPassword.Text)))) == true) { DO.cCommonDO.CurrentUser = BUS.cNhanVienBUS.GetStaffInforByID(txtUsername.Text); frmGiaodienchinh Trangchinh = new frmGiaodienchinh(); Trangchinh.Show(); this.DialogResult = DialogResult.OK; this.Hide(); } else { CountLogin--; XtraMessageBox.Show("Sai tên đăng nhập hoặc mật khẩu! \nVui lòng kiểm tra lại .\nBạn còn " + CountLogin + " lần đăng nhập nữa.", "FGS Logistics - Đăng nhập", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } if (CountLogin == 0) { Application.Exit(); } }