Example #1
0
        private void loginButton_Click_1(object sender, EventArgs e)
        {
            this.Enabled = false;
            logwin       = new loginWindow(this, userName);
            //MessageBox.Show("Check 1 "+userName);

            if (loginButton.Text == "Log In")
            {
                logwin.Show();
            }
            else if (loginButton.Text == "Log Out")
            {
                this.loginLabel.Text           = "Please login to continue";
                this.loginButton.Text          = "Log In";
                this.lendReturnButton.Visible  = false;
                this.reportsButton.Visible     = false;
                this.adminButton.Visible       = false;
                this.userAccountButton.Visible = false;
                closeWindows();
                currentUser = null;
                logwin.Close();
            }
            this.Enabled = true;
            //MessageBox.Show(userName);
        }
Example #2
0
 public void closeWindows()
 {
     if (userWin != null)
     {
         userWin.Close();
     }
     if (logwin != null)
     {
         logwin.Close();
     }
     if (adminWin != null)
     {
         adminWin.Close();
     }
     if (lrwin != null)
     {
         lrwin.Close();
     }
 }
        private void loginButton_Click_1(object sender, EventArgs e)
        {
            this.Enabled = false;
            logwin = new loginWindow(this, userName);
            //MessageBox.Show("Check 1 "+userName);

            if (loginButton.Text == "Log In")
            {
                logwin.Show();
            }
            else if (loginButton.Text == "Log Out")
            {
                this.loginLabel.Text = "Please login to continue";
                this.loginButton.Text = "Log In";
                this.lendReturnButton.Visible = false;
                this.reportsButton.Visible = false;
                this.adminButton.Visible = false;
                this.userAccountButton.Visible = false;
                closeWindows();
                currentUser = null;
                logwin.Close();
            }
            this.Enabled = true;
            //MessageBox.Show(userName);
        }