public static List <QE_CLASS> GetClasses(Dictionary <string, string> Ds) { Ds.Add("TERM", TermService.GetCurrentTerm().ID.ToString()); Ds.Add("ACTIVE", "1"); try { return(WillORM.GetDBSource("QE_CLASS", WillORM.QueryBuilder(null, "QE_CLASS", Ds, new string[] { "FORM", "NAME" })).Cast <QE_CLASS>().ToList()); } catch { return(null); } }
public static List <STUDENT> GetStudents(int term) // get students by term { try { return(KennyORM.GetDBSource("STUDENT", "select * from STUDENT where ID in (select STUDENT from CLASS_STUDENT_LIST where ID in (select ID from QE_CLASS where TERM = " + TermService.GetCurrentTerm().ID + " and active=1 order by FORM, NAME) and active=1) and active=1").Cast <STUDENT>().ToList()); } catch { return(new List <STUDENT>()); } }
public static List <STUDENT> getStudentByGroup(int group_id) { string query = "select * from STUDENT where ID in (select STUDENT from STUDENT_GROUP_STUDENT_LIST where STUDENT_GROUP in (select ID from STUDENT_GROUP where ID = " + group_id + " and TERM = " + TermService.GetCurrentTerm().ID + ")) and active=1"; try { return(WillORM.GetDBSource("STUDENT", query).Cast <STUDENT>().ToList()); } catch { return(null); } }
public static List <HOMEWORK> GetWorks() { try { return(WillORM.GetDBSource("HOMEWORK", "select * from HOMEWORK where STUDENT_GROUP in (select ID from STUDENT_GROUP where TERM='" + TermService.GetCurrentTerm().ID + "' and active=1) and active=1").Cast <HOMEWORK>().ToList()); } catch { return(null); } }
public static List <HOMEWORK> GetHomeworksByType(int homework_type) { try { return(KennyORM.GetDBSource("HOMEWORK", "select * from HOMEWORK where STUDENT_GROUP in (select ID from STUDENT_GROUP where TERM='" + TermService.GetCurrentTerm().ID + "' and active=1) and HOMEWORK_TYPE=" + homework_type + " and active=1").Cast <HOMEWORK>().ToList()); } catch { return(null); } }
public static List <STUDENT_GROUP> GetStudentGroups(int subject) { try { return(KennyORM.GetDBSource("STUDENT_GROUP", "select * from STUDENT_GROUP where TERM='" + TermService.GetCurrentTerm().ID + "' and SUBJECT=" + subject + " and active=1").Cast <STUDENT_GROUP>().ToList()); } catch { return(null); } }
public static List <QE_CLASS> GetClassesByForm(int form) { try { return(KennyORM.GetDBSource("QE_CLASS", "select * from QE_CLASS where TERM = '" + TermService.GetCurrentTerm().ID + "' and active=1 and FORM = " + form + " order by FORM, NAME").Cast <QE_CLASS>().ToList()); } catch { return(null); } }
public static QE_CLASS GetClass(int form, string name) { try { return(KennyORM.GetDBSource("QE_CLASS", "select * from QE_CLASS where TERM = '" + TermService.GetCurrentTerm().ID + "' and active=1 and FORM = " + form + " and NAME = '" + name + "'").Cast <QE_CLASS>().First()); } catch { return(null); } }