Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            frmAdminDashboard settings = new frmAdminDashboard();

            this.Close();
            settings.Close();
        }
Ejemplo n.º 2
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            l.username  = txtUsername.Text.Trim();
            l.password  = txtPassword.Text.Trim();
            l.user_type = cmbUserType.Text;

            bool success = dal.loginCheck(l);

            if (success)
            {
                loggedIn = l.username;
                switch (l.user_type)
                {
                case "Admin":
                {
                    frmAdminDashboard admin = new frmAdminDashboard();
                    admin.Show();
                    this.Hide();
                }
                break;

                case "User":
                {
                    frmUserDashboard user = new frmUserDashboard();
                    user.Show();
                    this.Hide();
                }
                break;

                default:
                {
                    MessageBox.Show("Invalid user type.");
                }
                break;
                }
            }
            else
            {
                MessageBox.Show("Login Failed.");
            }
        }