/* * Pre: studentId must exist as a StudentId in the system * Post: The existing data for the student associated to the studentId * is loaded to the page. * @param studentId is the StudentId of the student being registered */ private Student loadStudentData(int studentId, bool initialLoad) { Student student = DbInterfaceStudent.LoadStudentData(studentId); //get eligible auditions if (student != null) { DataTable table = DbInterfaceStudentAudition.GetDistrictAuditionsForPointEntryDropdown(student, Convert.ToInt32(ddlYear.SelectedValue)); cboAudition.DataSource = null; cboAudition.Items.Clear(); cboAudition.DataSourceID = ""; //load student name txtFirstName.Text = student.firstName; txtLastName.Text = student.lastName; lblStudent.Text = student.firstName + " " + student.lastName; if (table.Rows.Count > 0) { cboAudition.DataSource = table; cboAudition.DataTextField = "DropDownInfo"; cboAudition.DataValueField = "AuditionId"; cboAudition.Items.Add(new ListItem("")); cboAudition.DataBind(); } else if (!initialLoad) { showWarningMessage("This student has no district auditions to award points to for the selected year."); } pnlInfo.Visible = true; upStudentSearch.Visible = false; } else { showErrorMessage("An error occurred while loading the student's audition data."); } return(student); }