コード例 #1
0
        }     // end Admin_sectionDelete_Button_Click

        /** This method goes back to the Admin Main Page. **/
        private void Admin_GoBack_Button_Click(object sender, EventArgs e)
        {
            AdminSignInSuccessful admSS = new AdminSignInSuccessful();

            admSS.Show();
            this.Close();
        }// end Admin_GoBack_Button_Click
コード例 #2
0
        }// end Admin_SignIn

        private void Admin_SignIn_Button_Click(object sender, EventArgs e)
        {
            int adminID = 0;

            if (admin_userID_TextBox.Text == "" || admin_userID_TextBox.Text == null)   // checks that text box is not empty.
            {
                SignInFailedMessage.Text    = "Must enter an Admin id.";
                SignInFailedMessage.Visible = true;
            }// end if
            else
            {
                bool isAnInteger = int.TryParse(admin_userID_TextBox.Text, out adminID);
                if (isAnInteger != true)   // checks if value entered is not an integer
                {
                    SignInFailedMessage.Text    = "Sign in Username Must be a number";
                    SignInFailedMessage.Visible = true;
                }// end if
                else
                {
                    if (adminID != 12345)   // check if the object has an actual first name and last name from the database stored inside its getter methods.
                    {
                        SignInFailedMessage.Text    = "Error: The Admin does not exist";
                        SignInFailedMessage.Visible = true;
                    }// end if
                    else
                    {
                        // Go to Objects Profile
                        AdminSignInSuccessful AdminSignedInForm = new AdminSignInSuccessful();
                        AdminSignedInForm.Show();
                        // Close this form
                        this.Close();
                    } // end inner most else
                }     // end else
            }         // end else
        }             // end Admin_SignIn_Button_Click