Exemple #1
0
        /*
         * Pre:
         * Post: If the entered data is valid, the points are added
         *       or edited in the datbase
         */
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (dataIsValid())
            {
                if (audition == null)
                {
                    resetAuditionVar();
                }

                audition.points = Convert.ToInt32(lblPoints.Text);

                if (audition.submitPoints())
                {
                    displaySuccessMessageAndOptions();
                }
                else
                {
                    showErrorMessage("Error: An error occurred. Please reload the student's data to ensure the points were added.");
                }
            }
        }
        /*
         * Pre:
         * Post: If the entered data is valid, the points are added
         *       or edited in the datbase
         */
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            clearErrorMessages();

            if (dataIsValid())
            {
                if (audition == null)
                {
                    resetAuditionVar();
                }

                audition.points = Convert.ToInt32(lblPoints.InnerText);

                if (audition.submitPoints())
                {
                    displaySuccessMessageAndOptions();
                }
                else
                {
                    lblErrorMsg.Text    = "An error occurred. Please refresh the page to ensure the points were added.";
                    lblErrorMsg.Visible = true;
                }
            }
        }