// REMOVE RECORD
        private void btnRemove_Click(object sender, EventArgs e)
        {
            // Set associated field.
            GlobalVariables.PreviousForm = "ScheduledLessonTable";

            // To remove a record, the user needs to login.
            if (GlobalVariables.UserLoggedIn == false)
            {
                // If no user is currently logged in, load login form.
                frmUserLogin Login = new frmUserLogin();
                Login.Show();
                this.Hide();
            }
            else
            {
                if (lbScheduledLessons.Text != null && !string.IsNullOrWhiteSpace(lbScheduledLessons.Text))
                {
                    // If a user is logged in, load confirmation page.
                    GlobalVariables.TableID    = Convert.ToInt32(lbScheduledLessons.Text);
                    GlobalVariables.FieldNames = lbFirstName.Text + " " + lbSurname.Text;

                    frmConfirmation Confirmation = new frmConfirmation();
                    Confirmation.Show();
                }
                else
                {
                    MessageBox.Show("Please select a scheduled Lesson Reocrd from the menu below. If none are present, then this student has no scheduled lessons.");
                }
            }
        }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            GlobalVariables.PreviousForm = "Menu";

            if (GlobalVariables.UserLoggedIn == true)
            {
                GlobalVariables.Username     = "";
                GlobalVariables.UserLoggedIn = false;
                btnLogin.Text           = "Login";
                lblUserLoginDetail.Text = "No Current Admin";
            }
            else
            {
                frmUserLogin Login = new frmUserLogin();
                Login.Show();
                this.Hide();
            }
        }
Пример #3
0
        // REMOVE RECORD
        private void btnRemove_Click(object sender, EventArgs e)
        {
            // Set associated field.
            GlobalVariables.PreviousForm = "RoomTable";

            // To remove a record, the user needs to login.
            if (GlobalVariables.UserLoggedIn == false)
            {
                // If no user is currently logged in, load login form.
                frmUserLogin Login = new frmUserLogin();
                Login.Show();
                this.Hide();
            }
            else
            {
                // If a user is logged in, load confirmation page.
                GlobalVariables.TableID    = Convert.ToInt32(lbRoomID.Text);
                GlobalVariables.FieldNames = lbRoomSpecialisation.Text;

                frmConfirmation Confirmation = new frmConfirmation();
                Confirmation.Show();
            }
        }