private void lnklblAdminBack_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Hide();
            frmAdmin pFrmAdmin = new frmAdmin();

            pFrmAdmin.ShowDialog();
        }
Exemple #2
0
        private void cmdLogin_Click(object sender, EventArgs e)
        //======================================================
        {
            Program.gBE.UserName = txtUserName.Text;
            Program.gBE.Password = txtPassword.Text;
            int pUserId = mBA.UserLogin(Program.gBE);

            if (pUserId > 0)
            {
                Program.gBE.UserId = pUserId;
                if (Convert.ToBoolean(mBA.IsUserActive(Program.gBE)) == true)
                {
                    if (mBA.IsAdmin(Program.gBE) == "ADMIN")
                    {
                        MessageBox.Show("Login success.");
                        this.Hide();
                        frmAdmin pFrmAdmin = new frmAdmin();
                        pFrmAdmin.ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show("Login success.");
                        this.Hide();
                        frmEmployee pFrmEmployee = new frmEmployee();
                        pFrmEmployee.ShowDialog();
                    }
                }
                else
                {
                    MessageBox.Show("User has been Deactivated!!");
                }
            }
            else
            {
                MessageBox.Show("Invalid Login!! Please check username and password");
            }
        }