private void PopulateForm() { SystemData sys = GeneralFunction.GetSystemData(); GeneralFunction.AssignValueCheckBoxList(cblRound1, sys.ActivePanelsRound1, "|"); GeneralFunction.AssignValueCheckBoxList(cblRound2, sys.ActivePanelsRound2, "|"); if (sys.ActiveRound == "1") { rbRound1.Checked = true; rbRound1_CheckedChanged(null, null); } if (sys.ActiveRound == "2") { rbRound2.Checked = true; rbRound2_CheckedChanged(null, null); } if (Security.IsReadOnlyAdmin()) { GeneralFunctionEntryForm.DisableAllAction(this, false); btnSubmit.Visible = !Security.IsReadOnlyAdmin(); } }
private void PopulateForm() { // Pop the jpc data JuryPanelCategoryList jpcList = JuryPanelCategoryList.GetJuryPanelCategoryList("", ""); DropDownList firstDdl = null; DropDownList secDdl = null; int rptCount = 0; int rptJPC = 0; foreach (RepeaterItem item in rptPanel.Items) { string thispanelno = ((Label)item.FindControl("lbPanelNo")).Text; // loop all the ddls in the repeater for a match List <JuryPanelCategory> filteredJPCList = jpcList.Where(m => m.PanelId.Equals(thispanelno) && m.Round == round).OrderBy(m => m.OrderNo).ToList(); foreach (JuryPanelCategory jpc in filteredJPCList) { //if (jpc.Round == round) //{ for (int i = 1; i <= numberOfCats; i++) { DropDownList ddlCategory = (DropDownList)item.FindControl("ddlCategory" + i.ToString()); if (thispanelno == jpc.PanelId && i == jpc.OrderNo) { if (rptJPC == 0 && rptCount == 0) { firstDdl = ddlCategory; } if (rptJPC == 1 && rptCount == 0) { secDdl = ddlCategory; } ddlCategory.SelectedValue = jpc.CategoryPSDetail; //PopulateAllDDL(ddlCategory); PopulateNumberEntries(ddlCategory); } } //} rptJPC++; } rptCount++; } PopulateAllDDL(firstDdl); PopulateAllDDL(secDdl); // Hide the save as draft if all confirmed if (jpcList.Count > 0) { btnSave.Visible = !jpcList[0].IsActive; if (!jpcList[0].IsActive) { btnConfirm.Attributes.Add("onclick", "return confirm('Confirm to submit?');"); } } else { btnConfirm.Attributes.Add("onclick", "return confirm('Confirm to submit?');"); } if (Security.IsReadOnlyAdmin()) { GeneralFunctionEntryForm.DisableAllAction(this, false); btnConfirm.Visible = !Security.IsReadOnlyAdmin(); } }