Exemplo n.º 1
0
        public List <object> GetGroupsForParentSubgroup(Subgroup parentSubgroup)
        {
            var groups = from group_1 in context.Group
                         where group_1.SUBGROUP_ID == parentSubgroup.ID
                         select group_1;

            return(groups.ToList <object>());
        }
Exemplo n.º 2
0
        public List <SubjectDefinition> GetSubjectsForYear(Subgroup subgroup)
        {
            var subjects = from subject in context.SubjectDefinition
                           where subject.MAJOR_ID == subgroup.MAJOR_ID && subject.YEAR_OF_STUDY == subgroup.YEAR_OF_STUDY
                           select subject;

            return(subjects.ToList());
        }
Exemplo n.º 3
0
        public List <SubjectDefinition> GetSubjectsForYearIncludingSemesterType(Subgroup subgroup)
        {
            int semesterTypeDvId = (int)semesterBehavior.GetActiveSemester().SEMESTER_TYPE_DV_ID;

            var subjects = from subject in context.SubjectDefinition
                           where subject.MAJOR_ID == subgroup.MAJOR_ID && subject.YEAR_OF_STUDY == subgroup.YEAR_OF_STUDY && subject.SEMESTER_TYPE_DV_ID == semesterTypeDvId
                           select subject;

            return(subjects.ToList());
        }
Exemplo n.º 4
0
        public List <Subgroup> GetSubgroupsForParentSubgroup(Subgroup parentSubgroup)
        {
            int activeSemesterID = new Semester(context).GetActiveSemester().ID;

            var subgroups = from subgroup in context.Subgroup
                            where subgroup.MAJOR_ID == parentSubgroup.MAJOR_ID && subgroup.SEMESTER_ID == activeSemesterID && subgroup.SUBGROUP_ID == parentSubgroup.ID
                            select subgroup;

            return(subgroups.ToList());
        }
Exemplo n.º 5
0
        public TreeViewData(serverDBEntities context, Department department)
        {
            this.context = context;

            majorBehavior      = new Major(context);
            subgroupBehavior   = new Subgroup(context);
            groupBehavior      = new Group(context);
            departmentBehavior = new Department(context);
            locationBehavior   = new Location(context);
            roomBehavior       = new Room(context);

            initializeGroupList(department);
        }
Exemplo n.º 6
0
        public List <Classes> GetListForSubgroup_S2(Subgroup subgroup, Week week)
        {
            var oddClassesList = from classes in context.Classes
                                 join classesGroup in context.ClassesGroup on classes.ID equals classesGroup.Classes_ID
                                 join classesWeek in context.ClassesWeek on classes.ID equals classesWeek.Classes_ID
                                 join group_g in context.Group on classesGroup.Group_ID equals group_g.ID
                                 join subgroup_s1 in context.Subgroup on group_g.SUBGROUP_ID equals subgroup_s1.ID
                                 where subgroup_s1.ID == subgroup.ID && /*(classes.CLASSESS_TYPE_DV_ID == 42 || classes.CLASSESS_TYPE_DV_ID == 43)*/
                                 (classes.SCOPE_LEVEL == (int)SchedulerGroupType.SUBGROUP_S1 || classes.SCOPE_LEVEL == (int)SchedulerGroupType.SUBGROUP_S2) &&                                // wykład lub ćwiczenia
                                 classesWeek.Week_ID == week.ID
                                 select new ClassesWithClassesGroup_ClassesId {
                Classes = classes, ClassesGroup_ClassesId = classesGroup.Classes_ID
            };

            List <Classes> classesList = GetDistinctClassesForSubgroup(oddClassesList.ToList());

            return(classesList);
        }
Exemplo n.º 7
0
 public Major(serverDBEntities context)
 {
     this.context     = context;
     subgroupBehavior = new Subgroup(context);
 }
Exemplo n.º 8
0
 public Semester(serverDBEntities context)
 {
     this.context          = context;
     this.subgroupBehavior = new Subgroup(context);
 }