Ejemplo n.º 1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txtUsername.Text))
            {
                MessageBox.Show("Please enter username !!!");
                txtUsername.Focus();
                return;
            }
            else if (String.IsNullOrEmpty(txtPassword.Text))
            {
                MessageBox.Show("Please enter password !!!");
                txtPassword.Focus();
                return;
            }
            else
            {
                userBLL._username = txtUsername.Text;
                userBLL._password = txtPassword.Text;

                int userStatus = userBLL.validateUserLogin();
                if (userStatus == 1)
                {
                    // store username
                    FormLoaderClass._username = txtUsername.Text;

                    this.Hide();
                    FormLoaderClass.loadDashboard();
                    this.Close();
                }
                else if (userStatus == 0)
                {
                    MessageBox.Show("Invalid user !!!");
                    txtUsername.Clear();
                    txtPassword.Clear();
                    txtUsername.Focus();
                }
                else if (userStatus == 2)
                {
                    MessageBox.Show("User not activated by admin !!!");
                    txtUsername.Clear();
                    txtPassword.Clear();
                    txtUsername.Focus();
                }
            }
        }
Ejemplo n.º 2
0
 private void msiCheckNotesStatus_Click(object sender, EventArgs e)
 {
     this.Hide();
     FormLoaderClass.loadDashboard();
     this.Close();
 }