コード例 #1
0
        /*
         * Pre:
         * Post: The information associated with the selected audition is loaded to the page
         */
        protected void cboAudition_SelectedIndexChanged(object sender, EventArgs e)
        {
            rblLength.SelectedIndex = -1;
            lblCurrentLength.Text   = "";

            //load associated audition information
            if (!cboAudition.SelectedValue.ToString().Equals(""))
            {
                if (!txtStudentId.Text.Equals(""))
                {
                    Student student = DbInterfaceStudent.LoadStudentData(Convert.ToInt32(txtStudentId.Text));

                    if (student != null)
                    {
                        DistrictAudition districtAudition = DbInterfaceStudentAudition.GetStudentDistrictAudition(
                            Convert.ToInt32(cboAudition.SelectedValue), student);

                        if (districtAudition != null)
                        {
                            lblCurrentLength.Text = districtAudition.auditionLength.ToString();
                        }
                        else
                        {
                            showErrorMessage("Error: An error occurred while loading the audition information.");
                        }
                    }
                    else
                    {
                        showWarningMessage("Please reselect the student");
                    }
                }
            }
        }
コード例 #2
0
        /*
         * Pre:
         * Post: Loads the information of the selected audition and saves it to a session variable
         */
        private void resetAuditionVar()
        {
            try
            {
                int     auditionId = Convert.ToInt32(cboAudition.SelectedValue);
                int     studentId  = Convert.ToInt32(Convert.ToInt32(txtStudentId.Text));
                Student student    = DbInterfaceStudent.LoadStudentData(studentId);

                //get all audition info associated with audition id and save as session variable
                if (student != null)
                {
                    audition = DbInterfaceStudentAudition.GetStudentDistrictAudition(auditionId, student);

                    if (audition != null)
                    {
                        Session[auditionVar] = audition;

                        //if the audition was a duet, show label to inform user that the points for the
                        //partner will also be updated
                        if (audition.auditionType.ToUpper().Equals("DUET"))
                        {
                            lblDuetPartnerInfo.Visible = true;
                        }
                        else
                        {
                            lblDuetPartnerInfo.Visible = false;
                        }

                        loadCompositions();
                        txtTheoryPoints.Text = audition.theoryPoints.ToString();
                        calculatePointTotal();
                    }
                }
            }
            catch (Exception e)
            {
                lblErrorMsg.Text    = "An error occurred";
                lblErrorMsg.Visible = true;

                Utility.LogError("District Point Entry", "resetAuditionVar", "", "Message: " + e.Message + "   Stack Trace: " + e.StackTrace, -1);
            }
        }
コード例 #3
0
 /*
  * Pre: The entered district audition id and student must exist in the system
  * Post: The district audition information is retrieved
  * @param districtAuditionId is the audition id of the associated
  *        district audition
  */
 private void loadDistrictAudition(int districtAuditionId, Student student)
 {
     districtAudition = DbInterfaceStudentAudition.GetStudentDistrictAudition(districtAuditionId, student);
 }