Beispiel #1
0
        private void btnUsers_Click(object sender, EventArgs e)
        {
            // Go to users page
            Hide();
            frmUsers usersForm = new frmUsers();

            usersForm.ShowDialog();
        }
Beispiel #2
0
 private void btnBack_Click(object sender, EventArgs e)
 {
     // If it is a popout window then go back to users
     if (popout)
     {
         Hide();
         frmUsers usersForm = new frmUsers();
         usersForm.ShowDialog();
     }
     else
     {
         // Otherwise go to home
         Hide();
         frmHome home = new frmHome();
         home.ShowDialog();
     }
 }
Beispiel #3
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            bool logout = UserManager.user == user;

            // Remove user and save users to the file
            UserManager.users.Remove(user);
            UserManager.WriteUsers();
            // If a logged in account deletes their own account then go to the login page
            if (logout)
            {
                UserManager.user = null;
                Hide();
                frmLogin login = new frmLogin();
                login.ShowDialog();
            }
            else
            {
                // Else go back to the users page
                Hide();
                frmUsers users = new frmUsers();
                users.ShowDialog();
            }
        }