Exemple #1
0
        private void CheckLogin(string strUsername, string strPassword)
        {
            try
            {
                if (txtUsername.Text.Equals("") || txtPassword.Text.Equals(""))
                {
                    XtraMessageBox.Show("Tên đăng nhập hoặc password chưa được nhập. Vui lòng nhập lại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtPassword.Text = null;
                    txtUsername.Text = null;
                    txtUsername.Focus();
                }
                else
                {
                    if (staffBUS.CheckLoginToSystem(strUsername, strPassword))
                    {
                        frmHomePage frmHomePage = new frmHomePage();
                        frmHomePage.staffLogin = staffBUS.GetStaffByUserNameToObject(strUsername);
                        frmHomePage.Show();
                        this.Hide();

                    }
                    else
                    {
                        XtraMessageBox.Show("Tên đăng nhập hoặc password không đúng. Vui lòng kiểm tra lại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        txtUsername.Text = null;
                        txtPassword.Text = null;
                        txtUsername.Focus();
                    }
                }
            }
            catch (Exception)
            {

            }
        }
Exemple #2
0
 private void CheckLogin(string strUsername, string strPassword)
 {
     try
     {
         if (txtUsername.Text.Equals("") || txtPassword.Text.Equals(""))
         {
             XtraMessageBox.Show("Tên đăng nhập hoặc password chưa được nhập. Vui lòng nhập lại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             txtPassword.Text = null;
             txtUsername.Text = null;
             txtUsername.Focus();
         }
         else
         {
             if (staffBUS.CheckLoginToSystem(strUsername, strPassword))
             {
                 frmHomePage frmHomePage = new frmHomePage();
                 frmHomePage.staffLogin = staffBUS.GetStaffByUserNameToObject(strUsername);
                 frmHomePage.Show();
                 this.Hide();
             }
             else
             {
                 XtraMessageBox.Show("Tên đăng nhập hoặc password không đúng. Vui lòng kiểm tra lại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 txtUsername.Text = null;
                 txtPassword.Text = null;
                 txtUsername.Focus();
             }
         }
     }
     catch (Exception)
     {
     }
 }