private void populateAvailableSchoolsGrid(String selectedAndCurrentCSV) { NoAppropriateLabel.Text = String.Format( "No appropriate {0} of this type in this location.", (GlobalValues.CompareTo.Key == CompareToKeys.SelSchools) ? "Schools" : "Districts" ); if (!String.IsNullOrEmpty(selectedAndCurrentCSV)) { GlobalValues.SQL = getAvailableQuery(selectedAndCurrentCSV); if (!String.IsNullOrEmpty(GlobalValues.SQL)) { //throw new Exception(GlobalValues.SQL); QueryMarshaller.AssignQuery(new DALAgencies(), GlobalValues.SQL); _ds = QueryMarshaller.Database.DataSet.Copy(); } } if (_ds != null && _ds.Tables[0].Rows.Count > 0) { gvAvailable.DataSource = DataTableSorter.SortTable(_ds.Tables[0], "DistrictName, SchoolName"); gvAvailable.DataBind(); gvAvailable.ShowHeader = false; } else { NoAppropriateMessage.Visible = true; gvAvailable.Visible = false; } }
private void populateCountyDropdown(QueryMarshaller qm) { GlobalValues.SQL = DALAgencies.GetCountyListSQL(); qm.AssignQuery(new DALAgencies(), GlobalValues.SQL); CountyDropdownlist.DataSource = qm.Database.DataSet; CountyDropdownlist.DataValueField = v_AgencyFull.County; CountyDropdownlist.DataTextField = v_AgencyFull.CountyName; CountyDropdownlist.DataBind(); }
private void populateCESADropdown(QueryMarshaller qm) { GlobalValues.SQL = DALAgencies.GetCESAListSQL(); qm.AssignQuery(new DALAgencies(), GlobalValues.SQL); CESADropdownlist.DataSource = qm.Database.DataSet; CESADropdownlist.DataValueField = v_AgencyFull.CESA; CESADropdownlist.DataTextField = v_AgencyFull.CESA; CESADropdownlist.DataTextFormatString = "Cooperative Ed Serv Agcy {0}"; CESADropdownlist.DataBind(); }
public List <String> getGradeCodeRange() { List <String> codes = new List <String>(); QueryMarshaller qm = new QueryMarshaller(GlobalValues); //if (GlobalValues.CompareTo.Key == CompareToKeys.Current // && GlobalValues.Group.Key == GroupKeys.All // && GlobalValues.SubjectID.Key != SubjectIDKeys.AllTested) codes.Add(GlobalValues.Grade.Range[GradeKeys.AllDisAgg]); GlobalValues.SQL = DALWSAS.WSASGrades(qm); qm.AssignQuery(new DALWSAS(), GlobalValues.SQL); DataSet result = qm.Database.DataSet.Copy(); if (result == null || result.Tables[0].Rows.Count == 0) { return(codes); } foreach (DataRow row in result.Tables[0].Rows) { codes.Add(row[0].ToString()); } //unsupported grade by Subject: string[] unsupported = { GlobalValues.Grade.Range[GradeKeys.Grade_3], GlobalValues.Grade.Range[GradeKeys.Grade_5], GlobalValues.Grade.Range[GradeKeys.Grade_6], GlobalValues.Grade.Range[GradeKeys.Grade_7] }; if (GlobalValues.SubjectID.Key == SubjectIDKeys.Language || GlobalValues.SubjectID.Key == SubjectIDKeys.Science || GlobalValues.SubjectID.Key == SubjectIDKeys.SocialStudies) { foreach (String gr in unsupported) { if (codes.Contains(gr)) { codes.Remove(gr); } } } //throw new Exception(String.Join(",", codes.ToArray())); return(codes); }
public static List <String> getGradeCodeRange(PageBaseWI Page) { List <String> codes = new List <String>(); QueryMarshaller qm = new QueryMarshaller(Page.GlobalValues); Page.GlobalValues.SQL = DALWSAS.WSASGrades(qm); qm.AssignQuery(new DALWSAS(), Page.GlobalValues.SQL); DataSet result = qm.Database.DataSet.Copy(); if (result == null || result.Tables[0].Rows.Count == 0) { return(codes); } //throw new Exception(tbl.GetLength(0).ToString() + " || " + tbl[0][0].ToString()); foreach (DataRow row in result.Tables[0].Rows) { codes.Add(row[0].ToString()); } //disable all tested: String disag = Page.GlobalValues.Grade.Range[GradeKeys.AllDisAgg]; if (codes.Contains(disag)) { codes.Remove(disag); } //unsupported grade by Subject: string[] unsupported = { Page.GlobalValues.Grade.Range[GradeKeys.Grade_3], Page.GlobalValues.Grade.Range[GradeKeys.Grade_5], Page.GlobalValues.Grade.Range[GradeKeys.Grade_6], Page.GlobalValues.Grade.Range[GradeKeys.Grade_7] }; if (Page.GlobalValues.SubjectID.Key == SubjectIDKeys.Language || Page.GlobalValues.SubjectID.Key == SubjectIDKeys.Science || Page.GlobalValues.SubjectID.Key == SubjectIDKeys.SocialStudies) { int i = 0; for (i = 0; i < unsupported.Length; i++) { codes.Remove(unsupported[i]); } } return(codes); }
protected void populateSelectedTable(List <String> selected) { if (selected.Count > 0) { GlobalValues.SQL = (GlobalValues.CompareTo.Key == CompareToKeys.SelSchools) ? DALAgencies.GetSelectedSchoolsSQL( SligoCS.BL.WI.Utilities.BLUtil.GetCommaDeliFullKeyString(String.Join("", selected.ToArray()))) : DALAgencies.GetSelectedDistrictsSQL( SligoCS.BL.WI.Utilities.BLUtil.GetCommaDeliFullKeyString(String.Join("", selected.ToArray()))) ; QueryMarshaller.AssignQuery(new DALAgencies(), GlobalValues.SQL); DataSet _dsSelected = QueryMarshaller.Database.DataSet.Copy(); if (_dsSelected == null || _dsSelected.Tables[0].Rows.Count <= 0) { return; } int distName = _dsSelected.Tables[0].Columns["DistrictName"].Ordinal; int schlName = _dsSelected.Tables[0].Columns["SchoolName"].Ordinal; foreach (DataRow row in _dsSelected.Tables[0].Rows) { TableRow newRow = new TableRow(); TableCell newCell = new TableCell(); newCell.ColumnSpan = 2; newCell.CssClass = "smtext"; newCell.BorderStyle = BorderStyle.Double; newCell.BorderWidth = 2; if (GlobalValues.CompareTo.Key == CompareToKeys.SelSchools) { newCell.Text = "<b>" + row.ItemArray[distName] + "/" + row.ItemArray[schlName] + "</b>"; } if (GlobalValues.CompareTo.Key == CompareToKeys.SelDistricts) { newCell.Text = "<b>/" + row.ItemArray[distName] + "</b>"; } newRow.Cells.Add(newCell); SelectedListTable.Rows.Add(newRow); } } }
private void populateSelectedGrid(String selectedCSV) { GlobalValues.SQL = (GlobalValues.CompareTo.Key == CompareToKeys.SelSchools) ? DALAgencies.GetSelectedSchoolsSQL(selectedCSV) : DALAgencies.GetSelectedDistrictsSQL(selectedCSV) ; QueryMarshaller.AssignQuery(new DALAgencies(), GlobalValues.SQL); _dsSelected = QueryMarshaller.Database.DataSet.Copy(); if (_dsSelected != null && _dsSelected.Tables[0].Rows.Count > 0) { gvSelected.DataSource = DataTableSorter.SortTable(_dsSelected.Tables[0], "SchoolName, DistrictName"); gvSelected.DataBind(); } gvSelected.ShowHeader = false; PanelSelected.Visible = (gvSelected.Rows.Count > 0); PanelNoChosen.Visible = !PanelSelected.Visible; }
public List <String> getGradeCodeRange() { List <String> codes = new List <String>(); QueryMarshaller qm = new QueryMarshaller(GlobalValues); GlobalValues.SQL = DALWSAS.WSASGrades(qm); qm.AssignQuery(new DALWSAS(), GlobalValues.SQL); DataSet result = qm.Database.DataSet.Copy(); if (result == null || result.Tables[0].Rows.Count == 0) { return(codes); } //throw new Exception(tbl.GetLength(0).ToString() + " || " + tbl[0][0].ToString()); foreach (DataRow row in result.Tables[0].Rows) { codes.Add(row[0].ToString()); } return(codes); }
protected void Load_Display(string s_type, string alpha_fl, string f_key, string var_hs) { switch (s_type) { case "SC": ((SligoCS.Web.WI.WI)Page.Master).set_visible_state(WI.displayed_obj.InitSelSchoolInfo1, false); ((SligoCS.Web.WI.WI)Page.Master).set_visible_state(WI.displayed_obj.DistrictMapInfo1, false); ((SligoCS.Web.WI.WI)Page.Master).set_visible_state(WI.displayed_obj.DistrictInfo1, true); ((SligoCS.Web.WI.WI)Page.Master).set_visible_state(WI.displayed_obj.WI_DPI_Disclaim1, true); if ((alpha_fl != string.Empty) && (f_key == FullKeyUtils.StateFullKey(GlobalValues.FULLKEY))) // if (alpha_fl != string.Empty) { QueryMarshaller.Database = new SligoCS.DAL.WI.DALAgencies(); QueryMarshaller.Database.SQL = SligoCS.DAL.WI.DALALLAgencies.GetSchoolsByStartNameSQL(alpha_fl); QueryMarshaller.ManualQuery(); GlobalValues.SQL = GlobalValues.SQL + "//" + QueryMarshaller.Database.SQL; SligoDataGrid1.DataSource = QueryMarshaller.Database.DataSet; SligoDataGrid1.DataBind(); SligoDataGrid1.AddSuperHeader("Searching in SCHOOL by Letter " + alpha_fl); SligoDataGrid1.Visible = true; No_Records_Found("No Schools Found Starting with ", alpha_fl); } else { QueryMarshaller.Database = new SligoCS.DAL.WI.DALAgencies(); QueryMarshaller.Database.SQL = SligoCS.DAL.WI.DALALLAgencies.GetSchoolByDistrictKeySQL(f_key); QueryMarshaller.ManualQuery(); GlobalValues.SQL = GlobalValues.SQL + " //" + QueryMarshaller.Database.SQL; SligoDataGrid4.DataSource = QueryMarshaller.Database.DataSet; SligoDataGrid4.DataBind(); try { SligoDataGrid4.AddSuperHeader("Searching Schools in DISTRICT, " + QueryMarshaller.Database.DataSet.Tables[0].Rows[0][SligoCS.DAL.WI.v_AgencyFull.DistrictName].ToString()); } catch { } SligoDataGrid4.Visible = true; } break; case "DI": GlobalValues.SQL = DALALLAgencies.GetDistrictByNameSQL(alpha_fl); QueryMarshaller.AssignQuery(new DALAgencies(), GlobalValues.SQL); SligoDataGrid2.DataSource = QueryMarshaller.Database.DataSet; SligoDataGrid2.DataBind(); SligoDataGrid2.AddSuperHeader("Searching in DISTRICT by Letter " + alpha_fl); SligoDataGrid2.Visible = true; No_Records_Found("No Districts Found Starting with ", alpha_fl); break; case "CO": GlobalValues.SQL = DALALLAgencies.GetCountyByNameSQL(alpha_fl); QueryMarshaller.AssignQuery(new DALAgencies(), GlobalValues.SQL); SligoDataGrid3.DataSource = QueryMarshaller.Database.DataSet; SligoDataGrid3.DataBind(); SligoDataGrid3.AddSuperHeader("Searching in COUNTY by Letter " + alpha_fl); SligoDataGrid3.Visible = true; No_Records_Found("No Counties Found Starting with ", alpha_fl); break; case "CE": if (alpha_fl.Length == 1) { string pad = "0"; alpha_fl = pad + alpha_fl; } CESA_maps(alpha_fl, var_hs); GlobalValues.SQL = DALALLAgencies.GetDistrictByCESASQL(alpha_fl, var_hs); QueryMarshaller.AssignQuery(new DALAgencies(), GlobalValues.SQL); SligoDataGrid5.DataSource = QueryMarshaller.Database.DataSet; SligoDataGrid5.DataBind(); SligoDataGrid5.AddSuperHeader("Results for CESA " + alpha_fl); if ((var_hs == "1") || (var_hs == "0")) { if (var_hs == "1") { SligoDataGrid5.AddSuperHeader(SligoDataGrid5.SuperHeaderText + " with Union High School Districts"); } else { SligoDataGrid5.AddSuperHeader(SligoDataGrid5.SuperHeaderText + " with Elementary School Districts"); } } SligoDataGrid5.Visible = true; break; } }