/*
         * Pre:  audition must exist as the id of an audition in the system
         * Post: The existing data for the audition associated with the auditionId
         *       is loaded to the page.
         * @param auditionId is the id of the audition being scheduled
         * @returns the audition data
         */
        private Audition loadAuditionData(int auditionId, int year)
        {
            try
            {
                audition = DbInterfaceAudition.LoadAuditionData(auditionId);

                //load data to page
                if (audition != null)
                {
                    txtIdHidden.Text     = audition.auditionId.ToString();
                    lblAuditionSite.Text = audition.venue;
                    lblAuditionDate.Text = audition.auditionDate.ToShortDateString();

                    DataTable timePreferences = DbInterfaceAudition.LoadJudgeTimePreferenceOptions(auditionId);
                    chkLstTime.DataSource = timePreferences;
                    chkLstTime.DataBind();

                    LoadRooms(audition);
                    LoadAvailableJudgesToDropdown(audition);
                    LoadAuditionJudges(audition);
                    LoadAuditionJudgeRooms(audition);

                    Session[auditionSession] = audition;
                    pnlMain.Visible          = true;
                    upAuditionSearch.Visible = false;
                }
                else
                {
                    showErrorMessage("Error: The audition information could not be loaded. Please ensure one has been created for " + year + ".");
                }
            }
            catch (Exception e)
            {
                showErrorMessage("Error: An error occurred while loading the audition data.");

                Utility.LogError("AssignBadgerRoomsAndJudges", "loadAuditionData", "auditionId: " + auditionId, "Message: " + e.Message + "   Stack Trace: " + e.StackTrace, -1);
            }

            return(audition);
        }
        /*
         * Pre:  audition must exist as the id of an audition in the system
         * Post: The existing data for the audition associated with the auditionId
         *       is loaded to the page.
         * @param auditionId is the id of the audition being edited
         */
        private void loadAuditionData(int auditionId)
        {
            Audition audition = null;

            try
            {
                audition = DbInterfaceAudition.LoadAuditionData(auditionId);

                //load data to page
                if (audition != null)
                {
                    txtIdHidden.Text          = audition.auditionId.ToString();
                    ddlDistrict.SelectedIndex =
                        ddlDistrict.Items.IndexOf(ddlDistrict.Items.FindByValue(
                                                      audition.districtId.ToString()));
                    txtVenue.Text = audition.venue;
                    //txtNumJudges.Text = audition.numJudges.ToString();
                    ddlChairPerson.DataBind();
                    ListItem item = ddlChairPerson.Items.FindByValue(audition.chairpersonId);
                    ddlChairPerson.SelectedIndex = ddlChairPerson.Items.IndexOf(
                        ddlChairPerson.Items.FindByValue(audition.chairpersonId));
                    ddlTheorySeries.SelectedIndex = ddlTheorySeries.Items.IndexOf(
                        ddlTheorySeries.Items.FindByValue(audition.theoryTestSeries));

                    // Set session times
                    SetTime(audition.startTimeSession1, ddlAmPmStart1, ddlHourStart1, ddlMinutesStart1);
                    SetTime(audition.endTimeSession1, ddlAmPmEnd1, ddlHourEnd1, ddlMinutesEnd1);
                    SetTime(audition.startTimeSession2, ddlAmPmStart2, ddlHourStart2, ddlMinutesStart2);
                    SetTime(audition.endTimeSession2, ddlAmPmEnd2, ddlHourEnd2, ddlMinutesEnd2);
                    SetTime(audition.startTimeSession3, ddlAmPmStart3, ddlHourStart3, ddlMinutesStart3);
                    SetTime(audition.endTimeSession3, ddlAmPmEnd3, ddlHourEnd3, ddlMinutesEnd3);
                    SetTime(audition.startTimeSession4, ddlAmPmStart4, ddlHourStart4, ddlMinutesStart4);
                    SetTime(audition.endTimeSession4, ddlAmPmEnd4, ddlHourEnd4, ddlMinutesEnd4);

                    //dates must be in form of YYYY-MM-DD
                    string month = audition.auditionDate.Month.ToString();
                    string day   = audition.auditionDate.Day.ToString();

                    if (month.Length == 1)
                    {
                        month = "0" + month;
                    }
                    if (day.Length == 1)
                    {
                        day = "0" + day;
                    }

                    txtDate.Value = audition.auditionDate.ToShortDateString();

                    month = audition.freezeDate.Month.ToString();
                    day   = audition.freezeDate.Day.ToString();

                    if (month.Length == 1)
                    {
                        month = "0" + month;
                    }
                    if (day.Length == 1)
                    {
                        day = "0" + day;
                    }

                    txtFreezeDate.Value = audition.freezeDate.ToShortDateString();
                }
                else
                {
                    showErrorMessage("Error: The audition information could not be loaded.");
                }
            }
            catch (Exception e)
            {
                showErrorMessage("Error: An error occurred while loading the audition data.");

                Utility.LogError("Create District Audition", "loadAuditionData", "auditionId: " + auditionId, "Message: " + e.Message + "   Stack Trace: " + e.StackTrace, -1);
            }

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "RefreshDatepickers", "refreshDatePickers()", true);
        }
Ejemplo n.º 3
0
        /*
         * Pre:  audition must exist as the id of an audition in the system
         * Post: The existing data for the audition associated with the auditionId
         *       is loaded to the page.
         * @param auditionId is the id of the audition being edited
         */
        private void loadAuditionData(int auditionId)
        {
            Audition audition = null;

            try
            {
                audition = DbInterfaceAudition.LoadAuditionData(auditionId);

                //load data to page
                if (audition != null)
                {
                    txtIdHidden.Text          = audition.auditionId.ToString();
                    ddlDistrict.SelectedIndex =
                        ddlDistrict.Items.IndexOf(ddlDistrict.Items.FindByValue(
                                                      audition.districtId.ToString()));
                    txtVenue.Text                = audition.venue;
                    txtNumJudges.Text            = audition.numJudges.ToString();
                    ddlChairPerson.SelectedIndex = ddlChairPerson.Items.IndexOf(
                        ddlChairPerson.Items.FindByValue(audition.chairpersonId));
                    ddlTheorySeries.SelectedIndex = ddlTheorySeries.Items.IndexOf(
                        ddlTheorySeries.Items.FindByValue(audition.theoryTestSeries));
                    txtStartTime.Value = audition.startTime.ToString();
                    txtEndTime.Value   = audition.endTime.ToString();

                    //dates must be in form of YYYY-MM-DD
                    string month = audition.auditionDate.Month.ToString();
                    string day   = audition.auditionDate.Day.ToString();

                    if (month.Length == 1)
                    {
                        month = "0" + month;
                    }
                    if (day.Length == 1)
                    {
                        day = "0" + day;
                    }

                    txtDate.Value = audition.auditionDate.ToShortDateString();

                    month = audition.freezeDate.Month.ToString();
                    day   = audition.freezeDate.Day.ToString();

                    if (month.Length == 1)
                    {
                        month = "0" + month;
                    }
                    if (day.Length == 1)
                    {
                        day = "0" + day;
                    }

                    txtFreezeDate.Value = audition.freezeDate.ToShortDateString();
                }
                else
                {
                    lblErrorMsg.Text    = "The audition information could not be loaded";
                    lblErrorMsg.Visible = true;
                }
            }
            catch (Exception e)
            {
                lblErrorMsg.Text    = "An error occurred while loading the audition data";
                lblErrorMsg.Visible = true;

                Utility.LogError("Create District Audition", "loadAuditionData", "auditionId: " + auditionId, "Message: " + e.Message + "   Stack Trace: " + e.StackTrace, -1);
            }
        }
Ejemplo n.º 4
0
        /*
         * Pre:  audition must exist as the id of an audition in the system
         * Post: The existing data for the audition associated with the auditionId
         *       is loaded to the page.
         * @param auditionId is the id of the audition being edited
         */
        private void loadAuditionData(int auditionId)
        {
            Audition audition = null;

            try
            {
                audition = DbInterfaceAudition.LoadAuditionData(auditionId);

                //load data to page
                if (audition != null)
                {
                    txtIdHidden.Text = audition.auditionId.ToString();
                    ddlDistrict.DataBind();
                    ddlDistrict.SelectedIndex =
                        ddlDistrict.Items.IndexOf(ddlDistrict.Items.FindByValue(
                                                      audition.districtId.ToString()));
                    txtVenue.Text = audition.venue;

                    if (audition.duetsAllowed)
                    {
                        ddlDuets.SelectedIndex = 1;
                    }

                    //txtNumJudges.Text = audition.numJudges.ToString();
                    ddlChairPerson.DataBind();
                    ddlChairPerson.SelectedIndex = ddlChairPerson.Items.IndexOf(
                        ddlChairPerson.Items.FindByValue(audition.chairpersonId));

                    // Set session times
                    SetTime(audition.startTimeSession1, ddlAmPmStart1, ddlHourStart1, ddlMinutesStart1);
                    SetTime(audition.endTimeSession1, ddlAmPmEnd1, ddlHourEnd1, ddlMinutesEnd1);
                    SetTime(audition.startTimeSession2, ddlAmPmStart2, ddlHourStart2, ddlMinutesStart2);
                    SetTime(audition.endTimeSession2, ddlAmPmEnd2, ddlHourEnd2, ddlMinutesEnd2);
                    SetTime(audition.startTimeSession3, ddlAmPmStart3, ddlHourStart3, ddlMinutesStart3);
                    SetTime(audition.endTimeSession3, ddlAmPmEnd3, ddlHourEnd3, ddlMinutesEnd3);
                    SetTime(audition.startTimeSession4, ddlAmPmStart4, ddlHourStart4, ddlMinutesStart4);
                    SetTime(audition.endTimeSession4, ddlAmPmEnd4, ddlHourEnd4, ddlMinutesEnd4);

                    //dates must be in form of YYYY-MM-DD
                    string month = audition.auditionDate.Month.ToString();
                    string day   = audition.auditionDate.Day.ToString();

                    if (month.Length == 1)
                    {
                        month = "0" + month;
                    }
                    if (day.Length == 1)
                    {
                        day = "0" + day;
                    }

                    txtDate.Value = audition.auditionDate.ToShortDateString();

                    month = audition.freezeDate.Month.ToString();
                    day   = audition.freezeDate.Day.ToString();

                    if (month.Length == 1)
                    {
                        month = "0" + month;
                    }
                    if (day.Length == 1)
                    {
                        day = "0" + day;
                    }

                    txtFreezeDate.Value = audition.freezeDate.ToShortDateString();
                }
                else
                {
                    showErrorMessage("Error: The competition information could not be loaded.");
                }
            }
            catch (Exception e)
            {
                showErrorMessage("Error: An error occurred while loading the competition data.");

                Utility.LogError("Create Badger Audition", "loadAuditionData", "auditionId: " + auditionId, "Message: " + e.Message + "   Stack Trace: " + e.StackTrace, -1);
            }
        }