protected void DegreePathListView_PreRender(object sender, EventArgs e) { DegreePathListView.DataSource = DipRelDB_ODS; DegreePathListView.DataBind(); }
protected void ShowUpdateFields_Click(object sender, EventArgs e) { MessageUserControl.TryRun(() => { //POPULATE FIELDS BASED ON SELECTION if (InitialCredential.SelectedValue == "Certificate") { // Use a string to capture Program Length for spliting into two fields. string programLength; string[] programSplit = new string[2]; char[] splitChar = { ' ' }; show_update_form.Visible = true; SubmitProgram.Visible = true; DiplomaCertificate certificate = new DiplomaCertificate(); PathwaysController controller = new PathwaysController(); certificate = controller.CertificateProgram_byID(int.Parse(CertificateList.SelectedValue)); //Split string before populating form programLength = certificate.ProgramLength; programSplit = programLength.Split(splitChar); ProgramID.Text = certificate.ProgramID.ToString(); ProgramName.Text = certificate.ProgramName; CategoryList.SelectedValue = certificate.CategoryID.ToString(); CredentialType.Text = "Certificate"; ProgramLength.Text = programSplit[0]; ProgramLengthDDL.SelectedValue = programSplit[1]; ProgramLink.Text = certificate.ProgramLink; Activated.Checked = certificate.Activated; WorkOutdoors.Checked = certificate.WorkOutdoors; ShiftWork.Checked = certificate.ShiftWork; Travel.Checked = certificate.WorkTravel; CompetitiveAdv.Text = certificate.CompetitveAdvantage.ToString(); EntReqDetail.Text = certificate.EntranceRequirementDetail; DegreePathListView.Visible = false; pathwaysheading_toggle.Visible = false; entrance_req.Visible = true; EntReqListView.Visible = true; DiplomaEntReqList.Visible = false; //ProgramLink Holder for comparison later on ProgramLinkCompare.Value = certificate.ProgramLink; //ProgramName Holder for comparison later on ProgramNameCompare.Value = certificate.ProgramName; } else if (InitialCredential.SelectedValue == "Diploma") { // Use a string to capture Program Length for spliting into two fields. string programLength; string[] programSplit = new string[2]; char[] splitChar = { ' ' }; show_update_form.Visible = true; SubmitProgram.Visible = true; DiplomaCertificate diploma = new DiplomaCertificate(); PathwaysController controller = new PathwaysController(); diploma = controller.DiplomaProgram_byID(int.Parse(DiplomaList.SelectedValue)); //Split string before populating form programLength = diploma.ProgramLength; programSplit = programLength.Split(splitChar); ProgramID.Text = diploma.ProgramID.ToString(); ProgramName.Text = diploma.ProgramName; CategoryList.SelectedValue = diploma.CategoryID.ToString(); CredentialType.Text = "Diploma"; ProgramLength.Text = programSplit[0]; ProgramLengthDDL.SelectedValue = programSplit[1]; ProgramLink.Text = diploma.ProgramLink; Activated.Checked = diploma.Activated; WorkOutdoors.Checked = diploma.WorkOutdoors; ShiftWork.Checked = diploma.ShiftWork; Travel.Checked = diploma.WorkTravel; CompetitiveAdv.Text = diploma.CompetitveAdvantage.ToString(); EntReqDetail.Text = diploma.EntranceRequirementDetail; entrance_req.Visible = true; EntReqListView.Visible = false; DiplomaEntReqList.Visible = true; DiplomaPathListView.Visible = true; pathwaysheading_toggle.Visible = true; DegreePathListView.Visible = false; //ProgramLink Holder for comparison later on ProgramLinkCompare.Value = diploma.ProgramLink; //ProgramName Holder for comparison later on ProgramNameCompare.Value = diploma.ProgramName; } else if (InitialCredential.SelectedValue == "Degree") { // Use a string to capture Program Length for spliting into two fields. string programLength; string[] programSplit = new string[2]; char[] splitChar = { ' ' }; show_update_form.Visible = true; SubmitProgram.Visible = true; Degree degree = new Degree(); PathwaysController controller = new PathwaysController(); degree = controller.DegreeProgram_byID(int.Parse(DegreeList.SelectedValue)); //Split string before populating form programLength = degree.DegreeLength; programSplit = programLength.Split(splitChar); ProgramID.Text = degree.DegreeID.ToString(); ProgramName.Text = degree.DegreeName; CategoryList.SelectedValue = degree.CategoryID.ToString(); CredentialType.Text = "Degree"; ProgramLength.Text = programSplit[0]; ProgramLengthDDL.SelectedValue = programSplit[1]; ProgramLink.Text = degree.DegreeLink; Activated.Checked = degree.Activated; WorkOutdoors.Checked = degree.WorkOutdoors; ShiftWork.Checked = degree.ShiftWork; Travel.Checked = degree.WorkTravel; pathwaysheading_toggle.Visible = true; EntReqListView.Visible = false; DegreePathListView.Visible = true; DiplomaEntReqList.Visible = false; DiplomaPathListView.Visible = false; entrance_req.Visible = false; //ProgramLink Holder for comparison later on ProgramLinkCompare.Value = degree.DegreeLink; //ProgramName Holder for comparison later on ProgramNameCompare.Value = degree.DegreeName; DegreePathListView.DataSource = DipRelDB_ODS; DegreePathListView.DataBind(); } else { DegreePathListView.Visible = false; DiplomaEntReqList.Visible = false; DiplomaPathListView.Visible = false; pathwaysheading_toggle.Visible = false; EntReqListView.Visible = false; entrance_req.Visible = false; } }); }