Ejemplo n.º 1
0
        public static List <STUDENT> GetActiveStudentsByClass(int qe_class)
        {
            string first = WillORM.QueryBuilder("STUDENT", "CLASS_STUDENT_LIST", new List <MutliQuery>()
            {
                new MutliQuery()
                {
                    field1 = "QE_CLASS", field2 = qe_class.ToString(), function = null
                }
            }, null);
            string second = WillORM.QueryBuilder(null, "STUDENT", new List <MutliQuery>()
            {
                new MutliQuery()
                {
                    field1 = "ID", field2 = "(" + first + ")", function = "in"
                }, new MutliQuery()
                {
                    field1 = "active", field2 = "1", function = null
                }
            }, null);

            try { return(WillORM.GetDBSource("STUDENT", second).Cast <STUDENT>().ToList()); }
            catch { return(new List <STUDENT>()); }
        }
Ejemplo n.º 2
0
 public bool updateRecord(object record)
 {
     try { return(WillORM.UpdateRecord(record)); }
     catch { return(false); }
 }
Ejemplo n.º 3
0
 public static bool UpdateStudent(STUDENT student)
 {
     try { return(WillORM.UpdateRecord(student)); }
     catch { return(false); }
 }
Ejemplo n.º 4
0
 public static int countStudentByGroup(int group_id)
 {
     try { return(WillORM.CountRecord("STUDENT", "SELECT COUNT(ID) 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 ACTIVE = 1")); }
     catch { return(0); }
 }
Ejemplo n.º 5
0
 public static bool InactiveStudent(int student_id, int user_id)
 {
     try { return(WillORM.InactiveRecord("STUDENT", student_id, user_id)); }
     catch { return(false); }
 }
Ejemplo n.º 6
0
 public static bool DeleteSubmission(int id)
 {
     try { return(WillORM.DeleteRecord("HOMEWORK_SUBMISSION_LIST", id)); }
     catch { return(false); }
 }
Ejemplo n.º 7
0
 public static bool InactiveSubmssion(int Submission_id, int user_id)
 {
     try { return(WillORM.InactiveRecord("HOMEWORK_SUBMISSION_LIST", Submission_id, user_id)); }
     catch { return(false); }
 }
Ejemplo n.º 8
0
 public static bool InactiveWork(int work_id, int user_id)
 {
     try { return(WillORM.InactiveRecord("HOMEWORK", work_id, user_id)); }
     catch { return(false); }
 }
Ejemplo n.º 9
0
 public static int CreateGroup(STUDENT_GROUP newGroup)
 {
     int newGroup_id = WillORM.InsertRecord(newGroup); return(newGroup_id > 0 ? newGroup_id : 0);
 }
Ejemplo n.º 10
0
 public static bool InactiveGroup(int group_id, int user_id)
 {
     try { return(WillORM.InactiveRecord("STUDENT_GROUP", group_id, user_id)); }
     catch { return(false); }
 }
Ejemplo n.º 11
0
 public static QE_CLASS GetClassesByStudent(int student_id)
 {
     try { return(WillORM.GetDBSource("QE_CLASS", "select * from QE_CLASS where ID in (select QE_CLASS from CLASS_STUDENT_LIST where STUDENT = " + student_id + " and active = 1) and active = 1").Cast <QE_CLASS>().FirstOrDefault()); }
     catch { return(null); }
 }
Ejemplo n.º 12
0
 public static bool InactiveClass(int id)
 {
     try { return(WillORM.InactiveRecord("QE_CLASS", id, ClientSessionService.GetSession.loginedUser.ID)); }
     catch { return(false); }
 }
Ejemplo n.º 13
0
 public static int AddClass(QE_CLASS newClass)
 {
     try { return(WillORM.InsertRecord(newClass)); }
     catch { return(0); }
 }
Ejemplo n.º 14
0
 public static int CreateClassStudentMap(CLASS_STUDENT_LIST newMap)
 {
     int newMap_id = 0; newMap_id = WillORM.InsertRecord(newMap); return(newMap_id);
 }
Ejemplo n.º 15
0
 public static List <CLASS_STUDENT_LIST> getClassStudentMap(int class_id, int student_id, int term_id)
 {
     try { return(WillORM.GetDBSource("CLASS_STUDENT_LIST", "select * from CLASS_STUDENT_LIST where QE_CLASS in (select ID from QE_CLASS where ID = " + class_id + " and TERM = " + term_id + " and active=1) and STUDENT =" + student_id + " and active=1").Cast <CLASS_STUDENT_LIST>().ToList()); }
     catch { return(null); }
 }
Ejemplo n.º 16
0
 public static int AddType(HOMEWORK_TYPE newType)
 {
     try { return(WillORM.InsertRecord(newType)); }
     catch { return(0); }
 }
Ejemplo n.º 17
0
 public static bool InactiveType(int type_id, int user_id)
 {
     try { return(WillORM.InactiveRecord("HOMEWORK_TYPE", type_id, user_id)); }
     catch { return(false); }
 }
Ejemplo n.º 18
0
 public static int AddGroupStudentMap(STUDENT_GROUP_STUDENT_LIST newMap)
 {
     int newMap_id = WillORM.InsertRecord(newMap); return(newMap_id > 0 ? newMap_id : 0);
 }
Ejemplo n.º 19
0
 public static int AddWork(HOMEWORK newWork)
 {
     try { return(WillORM.InsertRecord(newWork)); }
     catch { return(0); }
 }
Ejemplo n.º 20
0
 public static bool InactiveStudentMap(int map_id, int user_id)
 {
     try { return(WillORM.InactiveRecord("STUDENT_GROUP_STUDENT_LIST", map_id, user_id)); }
     catch { return(false); }
 }
Ejemplo n.º 21
0
 public static int AddSubmission(HOMEWORK_SUBMISSION_LIST newSubmission)
 {
     try { return(WillORM.InsertRecord(newSubmission)); }
     catch { return(0); }
 }
Ejemplo n.º 22
0
 public static List <USER_GROUP> GetGroup()
 {
     try { return(WillORM.GetDBSource("USER_GROUP").Cast <USER_GROUP>().ToList()); }
     catch { return(null); }
 }
Ejemplo n.º 23
0
 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); }
 }
Ejemplo n.º 24
0
 public static int AddRecord(object newRecord)
 {
     try { return(WillORM.InsertRecord(newRecord)); }
     catch { return(0); }
 }
Ejemplo n.º 25
0
 public static int CreateStudent(STUDENT student)
 {
     try { return(WillORM.InsertRecord(student)); }
     catch { return(0); }
 }
Ejemplo n.º 26
0
 public static bool RemoveGroup(int group_id)
 {
     try { return(WillORM.DeleteRecord("USER_GROUP", group_id)); }
     catch { return(false); }
 }
Ejemplo n.º 27
0
 public static List <USER_GROUP_USER_LIST> GetGroupUsers()
 {
     try { return(WillORM.GetDBSource("USER_GROUP_USER_LIST").Cast <USER_GROUP_USER_LIST>().ToList()); }
     catch { return(null); }
 }
Ejemplo n.º 28
0
 public static List <USER_GROUP_RIGHT> GetGroupRights()
 {
     try { return(WillORM.GetDBSource("USER_GROUP_RIGHT").Cast <USER_GROUP_RIGHT>().ToList()); }
     catch { return(null); }
 }
Ejemplo n.º 29
0
 public static List <QE_USER> GetAllUser()
 {
     try { return(WillORM.GetDBSource("QE_USER").Cast <QE_USER>().ToList()); }
     catch { return(new List <QE_USER>()); }
 }
Ejemplo n.º 30
0
 public int addRecordReturnID(object newRecord)
 {
     try { return(WillORM.InsertRecord(newRecord)); }
     catch { return(0); }
 }