Example #1
0
 private void btnConfirm_Click(object sender, EventArgs e)
 {
     if (txtUser.Text == "user" && txtPassword.Text == "user")
     {
         this.Hide();
         frmMainMenu frmMainMenu = new frmMainMenu();
         frmMainMenu.set_user(txtUser.Text);
         frmMainMenu.set_userType("user");
         frmMainMenu.Show();
     }
     else if (txtUser.Text == "admin" && txtPassword.Text == "admin")
     {
         this.Hide();
         frmAdminMain frmAdminMain = new frmAdminMain();
         frmAdminMain.set_user(txtUser.Text);
         frmAdminMain.set_userType("admin");
         frmAdminMain.Show();
     }
     else
     {
         txtAlert.Text    = "Invalid User or Password";
         txtUser.Text     = "";
         txtPassword.Text = "";
         txtUser.Focus();
     }
 }
        private void btnMenu_Click(object sender, EventArgs e)
        {
            frmAdminMain frmAdminMain = new frmAdminMain();

            frmAdminMain.set_user(user);
            this.Hide();
            frmAdminMain.Show();
        }
Example #3
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     if (userType == "admin")
     {
         frmAdminMain frmAdminMain = new frmAdminMain();
         frmAdminMain.set_user(user);
         this.Hide();
         frmAdminMain.Show();
     }
     else
     {
         frmMainMenu frmMainMenu = new frmMainMenu();
         frmMainMenu.set_user(user);
         this.Hide();
         frmMainMenu.Show();
     }
 }
Example #4
0
 private void btnExit_Click(object sender, EventArgs e)
 {
     if (user_type == "admin")
     {
         this.Hide();
         frmAdminMain frmAdminMain = new frmAdminMain();
         frmAdminMain.set_userType("admin");
         frmAdminMain.Show();
     }
     else if (user_type == "user")
     {
         this.Hide();
         frmMainMenu frmMainMenu = new frmMainMenu();
         frmMainMenu.set_userType("user");
         frmMainMenu.Show();
     }
 }