Beispiel #1
0
        private void admin_Click(object sender, EventArgs e)
        {
            Hide();
            adminLoginForm fm = new adminLoginForm();

            fm.Show();
        }
        private void logoutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            const string message = "Are you sure you want to logout?";
            const string caption = "Logging out";
            var          result  = MessageBox.Show(message, caption,
                                                   MessageBoxButtons.YesNo,
                                                   MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                adminLoginForm login = new adminLoginForm();
                login.Show();
                Hide();
            }
            else
            {
                DialogResult = DialogResult.No;
            }
        }
Beispiel #3
0
        public static bool CloseCancel()
        {
            const string message = "Are you sure that you would like to close?";
            const string caption = "Closing ASELCO 201 File System";
            var          result  = MessageBox.Show(message, caption,
                                                   MessageBoxButtons.YesNo,
                                                   MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                LoginForm      login      = new LoginForm();
                adminLoginForm adminlogin = new adminLoginForm();
                login.Close();
                adminlogin.Close();

                Environment.Exit(0);

                return(true);
            }
            else
            {
                return(false);
            }
        }