public SubjectDetailsViewModel(string id, MainWindowViewModel mainWindowViewModel)
        {
            _mainWindowViewModel = mainWindowViewModel;
            _adding = false;
            Subject = SubjectDao.FindById(id);

            var softwareList = SoftwareDao.FindAll();

            foreach (var software in softwareList)
            {
                var softwareViewModel = new SoftwareViewModel(software)
                {
                    IsChecked = Subject.RequiredSoftware.FirstOrDefault(s => s.Id == software.Id) != null
                };
                SoftwareList.Add(softwareViewModel);
            }

            var courses = CourseDao.FindAll();

            courses.ForEach(c => Courses.Add(c));

            foreach (var subject in SubjectDao.FindAll())
            {
                _takenIds.Add(subject.Id);
            }
        }
Exemple #2
0
        public SoftwareDetailsViewModel(string id)
        {
            _adding  = false;
            Software = SoftwareDao.FindById(id);

            foreach (var software in SoftwareDao.FindAll())
            {
                _takenIds.Add(software.Id);
            }
        }
Exemple #3
0
        public SoftwareDetailsViewModel()
        {
            _adding  = true;
            Software = new Software();

            foreach (var software in SoftwareDao.FindAll())
            {
                _takenIds.Add(software.Id);
            }
        }
Exemple #4
0
        public ClassroomDetailsViewModel(MainWindowViewModel mainWindowViewModel)
        {
            _mainWindowViewModel = mainWindowViewModel;
            _adding   = true;
            Classroom = new Classroom();
            var softwareList = SoftwareDao.FindAll();

            softwareList.ForEach(s => SoftwareList.Add(new SoftwareViewModel(s)));

            foreach (var classroom in ClassroomDao.FindAll())
            {
                _takenIds.Add(classroom.Id);
            }
        }
        public SubjectDetailsViewModel(MainWindowViewModel mainWindowViewModel)
        {
            _mainWindowViewModel = mainWindowViewModel;
            _adding = true;
            Subject = new Subject();

            var softwareList = SoftwareDao.FindAll();

            softwareList.ForEach(s => SoftwareList.Add(new SoftwareViewModel(s)));

            var courses = CourseDao.FindAll();

            courses.ForEach(c => Courses.Add(c));

            foreach (var subject in SubjectDao.FindAll())
            {
                _takenIds.Add(subject.Id);
            }
        }
Exemple #6
0
        public ClassroomDetailsViewModel(string id, MainWindowViewModel mainWindowViewModel)
        {
            _mainWindowViewModel = mainWindowViewModel;
            _adding   = false;
            Classroom = ClassroomDao.FindById(id);
            var softwareList = SoftwareDao.FindAll();

            foreach (var software in softwareList)
            {
                var softwareViewModel = new SoftwareViewModel(software)
                {
                    IsChecked = Classroom.InstalledSoftware.FirstOrDefault(s => s.Id == software.Id) != null
                };
                SoftwareList.Add(softwareViewModel);
            }

            foreach (var classroom in ClassroomDao.FindAll())
            {
                _takenIds.Add(classroom.Id);
            }
        }
Exemple #7
0
        public SoftwareListViewModel()
        {
            var softwareList = SoftwareDao.FindAll();

            softwareList.ForEach(s => SoftwareList.Add(s));
        }