public static List<KeyValuePair> GetSubjectsList(string grade) { string sql = string.Empty; if (!string.IsNullOrWhiteSpace(grade)) { sql = string.Format("SELECT DISTINCT Subject FROM CurrCourses AS C WHERE C.Grade='{0}' AND C.Active='{1}'", grade, "Yes"); } else { sql = string.Format("SELECT DISTINCT Subject FROM CurrCourses AS C WHERE C.Active='Yes'"); } List<KeyValuePair> subjects = new List<KeyValuePair>(); //subjects.Insert(0, new KeyValuePair("0", " -- Select --")); DataTable dt = GetDataTable(getLocalDbConnectionString(rootConnectionString), sql); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { KeyValuePair subject = new KeyValuePair(dr["Subject"].ToString(), dr["Subject"].ToString()); subjects.Add(subject); } } return subjects; }
public static List<KeyValuePair> GetGradesList() { string sql = string.Format("SELECT DISTINCT Grade FROM CurrCourses C WHERE C.Active = 'Yes' ORDER BY Grade ASC"); List<KeyValuePair> grades = new List<KeyValuePair>(); //grades.Insert(0, new KeyValuePair("0", " -- Select --")); DataTable dt = GetDataTable(getLocalDbConnectionString(rootConnectionString), sql); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { KeyValuePair grade = new KeyValuePair(dr["Grade"].ToString(), dr["Grade"].ToString()); grades.Add(grade); } } return grades; }
public static List<KeyValuePair> GetStandardSetList() { string sql = "SELECT [StandardSet] FROM [StandardSets] WHERE ISNULL([StandardsSearch], '') <> 'no'"; List<KeyValuePair> standardSets = new List<KeyValuePair>(); //standardSets.Insert(0, new KeyValuePair("0", " -- Select --")); DataTable dt = GetDataTable(getLocalDbConnectionString(rootConnectionString), sql); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { KeyValuePair standardSet = new KeyValuePair(dr["StandardSet"].ToString(), dr["StandardSet"].ToString()); standardSets.Add(standardSet); } } return standardSets; }
public Criterion() { DataTextField = string.Empty; DataValueField = string.Empty; Key = string.Empty; Value = new KeyValuePair(string.Empty, string.Empty); Dependencies = new List<KeyValuePair>(); Header = string.Empty; Locked = false; // TODO: MERGE ISSUE //UIType = UIType.None; HandlerName = string.Empty; DefaultValue = null; IsUpdatedByUser = false; Visible = true; AutoHide = true; ToValue = new KeyValuePair(string.Empty, string.Empty); StandardSelection = new StandardSelections(null, null, null, null, null); CurriculumSelection = new CurriculumSelections(null, null, null, null); SchoolGradeNameSelection = new SchoolGradeNameSelections(null, null, null, null); }
public static List<KeyValuePair> GetCoursesList(string standardSet, string grade, string subject) { string sql = string.Empty; if (!string.IsNullOrWhiteSpace(standardSet)) { sql = string.Format("SELECT DISTINCT Course FROM Standards AS S WHERE S.standard_set='{0}' AND S.grade='{1}' AND S.subject='{2}' ORDER BY Course ASC", standardSet, grade, subject); } else { sql = string.Format("SELECT DISTINCT Course FROM Standards ORDER BY Course ASC"); } List<KeyValuePair> courses = new List<KeyValuePair>(); courses.Insert(0, new KeyValuePair("0", " -- Select --")); DataTable dt = GetDataTable(getLocalDbConnectionString(rootConnectionString), sql); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { KeyValuePair course = new KeyValuePair(dr["Course"].ToString(), dr["Course"].ToString()); courses.Add(course); } } return courses; }
public static List<KeyValuePair> GetStandardLevelList(string StandardSet) { string sql = "SELECT distinct [Level] FROM [Standards] WHERE Standard_Set = '" + StandardSet + "' "; List<KeyValuePair> standardSets = new List<KeyValuePair>(); DataTable dt = GetDataTable(getLocalDbConnectionString(rootConnectionString), sql); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { KeyValuePair standardSet = new KeyValuePair(dr["Level"].ToString(), dr["Level"].ToString()); standardSets.Add(standardSet); } } return standardSets; }