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(); }
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; }
private String getAvailableQuery(String selectedAndCurrent) { String Key = GlobalValues.SRegion.Key; String compare = GlobalValues.CompareTo.Key; String sql = String.Empty; if (compare == CompareToKeys.SelSchools) { if (Key == SRegionKeys.County) { sql = DALAgencies.GetSchoolsInCountySQL(GlobalValues.SCounty, int.Parse(GlobalValues.STYP.Value), selectedAndCurrent);//fullkeys to be excluded } if (Key == SRegionKeys.AthleticConf) { sql = DALAgencies.GetSchoolsInAthleticConfSQL(Int32.Parse(GlobalValues.SAthleticConf), int.Parse(GlobalValues.STYP.Value), selectedAndCurrent); //fullkeys to be excluded } if (Key == SRegionKeys.CESA) { sql = DALAgencies.GetSchoolsInCESASQL(GlobalValues.SCESA, int.Parse(GlobalValues.STYP.Value), selectedAndCurrent); //fullkeys to be excluded } } if (compare == CompareToKeys.SelDistricts) { if (Key == SRegionKeys.County) { sql = DALAgencies.GetDistrictsInCountyAndExcludeListSQL(GlobalValues.SCounty, selectedAndCurrent);//fullkeys to be excluded } if (Key == SRegionKeys.AthleticConf) { sql = DALAgencies.GetDistrictsInAthleticConfAndExcludeListSQL(Int32.Parse(GlobalValues.SAthleticConf), selectedAndCurrent); //fullkeys to be excluded } if (Key == SRegionKeys.CESA) { sql = DALAgencies.GetDistrictsInCESASQL(GlobalValues.SCESA, selectedAndCurrent); //fullkeys to be excluded } } return(sql); }