public ModulesScheduleProtectionLabsViewModel(int subjectId, Module module)
            : base(subjectId, module)
        {
            var subject = this.SubjectManagementService.GetSubject(subjectId);
            var firstOrDefault = subject.SubjectGroups.FirstOrDefault();
            if (firstOrDefault != null)
            {
                var defaultOr = firstOrDefault.SubGroups.FirstOrDefault();
                if (defaultOr != null)
                {
                    this.SubGroupId = defaultOr.Id.ToString(CultureInfo.InvariantCulture);
                }
            }

            var subjectGroup = subject.SubjectGroups.FirstOrDefault();
            if (subjectGroup != null)
            {
                this.GroupId = subjectGroup.GroupId.ToString(CultureInfo.InvariantCulture);
            }

            this.ScheduleProtectionLabs = subject.Labs.Select(e => new ScheduleProtectionLabsDataViewModel(e, int.Parse(SubGroupId))).ToList();

            var groups = GroupManagementService.GetGroups(new Query<Group>(e => e.SubjectGroups.Any(x => x.SubjectId == subjectId)).Include(e => e.Students));
            FillGroupsList(groups);
        }
Beispiel #2
0
 public ModulesViewModel(Module module, bool check = false)
 {
     Name = module.DisplayName;
     ModuleId = module.Id;
     Checked = check;
     Type = module.ModuleType;
 }
 public ModulesBaseViewModel(int subjectId, Module module)
 {
     SubjectId = subjectId;
     Module = module;
 }
 public ModulesNewsViewModel(int subjectId, Module module)
     : base(subjectId, module)
 {
     News = SubjectManagementService.GetSubject(subjectId).SubjectNewses.Select(e => new NewsDataViewModel(e)).ToList();
 }
 public ModulesLabsViewModel(int subjectId, Module module)
     : base(subjectId, module)
 {
     LabsData =
         SubjectManagementService.GetSubject(subjectId).Labs.Select(e => new LabsDataViewModel(e)).ToList();
 }
 public ModulesPracticalViewModel(int subjectId, Module module)
     : base(subjectId, module)
 {
     PracticalsData =
         SubjectManagementService.GetSubject(subjectId).Practicals.Select(e => new PracticalsDataViewModel(e)).ToList();
 }