/// <summary>
        /// Starts the Math monkeys applicaion running
        /// </summary>
        /// <returns>Exit status</returns>
        public int RunProgram()
        {
            LoginForm = new frmLogin(this);
            LoginForm.ShowDialog();

            return 0;
        }
Exemple #2
0
 /// <summary>
 /// 22 March 2014
 ///Jonathan Sanborn & Harvey Mercado
 /// Default Constructor
 /// </summary>
 internal Ctrl()
 {
     init();
     loginForm = new frmLogin(this);
 }
        /// <summary>
        /// 22 March 2014 
        /// Jonathan Sanborn & Harvey Mercado
        /// Handels when user issues a logout commnad
        /// </summary>
        /// <param name="sender">the object that raised the event</param>
        /// <param name="e">the event arguments</param>
        public void UserLogout(object sender, EventArgs e)
        {
            Form myForm = null;

            if (sender is Button)
            {
                Button btn = sender as Button;
                myForm = btn.FindForm();
            }
            else if (sender is frmAdminControl)
            {
                myForm = sender as frmAdminControl;

            }

            if (myForm != null)
            {
                currentUser.Logout(this);

                myForm.Hide();
                myForm.Close();

                LoginForm = new frmLogin(this);
                LoginForm.ShowDialog();
            }
        }