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);
        }
Esempio n. 2
0
 public ModulesViewModel(Module module, bool check = false)
 {
     Name = module.DisplayName;
     ModuleId = module.Id;
     Checked = check;
     Type = module.ModuleType;
 }
Esempio n. 3
0
 public ModulesBaseViewModel(int subjectId, Module module)
 {
     SubjectId = subjectId;
     Module = module;
 }
Esempio n. 4
0
 public ModulesNewsViewModel(int subjectId, Module module)
     : base(subjectId, module)
 {
     News = SubjectManagementService.GetSubject(subjectId).SubjectNewses.Select(e => new NewsDataViewModel(e)).ToList();
 }
Esempio n. 5
0
 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();
 }