public async void GetSemesters() { SemesterList = await Data.Semester.GetAllAsync(); foreach (var semester in SemesterList) { semester.SemesterNumber = semester.SemesterNumber.Trim(); } SelectedSemester = SemesterList.SingleOrDefault(s => s.SemesterID == selectedCourse.SemesterID); CourseList = CourseList.Where(c => c.SemesterID == selectedSemester.SemesterID).ToList(); SemesterList = SemesterList.Where(s => s.StudyID == SelectedStudy.StudyID).ToList(); }
private void CopySelectedSemester() { Semester activeSemester = SemesterList.Where(x => x.IsActive).FirstOrDefault(); CopySemesterWindow target = new CopySemesterWindow(activeSemester) { Owner = this.SourceWindow }; SwitchWindows(target, true); this.SemesterList = ReloadSemesterList(); this.SessionGroupList = ReloadActiveSessionGroupList(); this.TeamList = ReloadActiveTeamList(); this.TeamFilterList = ReloadTeamFilterList(); this.StudentList = ReloadStudentList(); }
public SessionGroupEditViewModel(SessionGroupEditWindow sessionGroupEditWindow, SessionGroup selectedSessionGroup) { this.SourceWindow = sessionGroupEditWindow; this._contextDal = new SessionGroupDAL(); this.SelectedSessionGroup = selectedSessionGroup; this.SaveCommand = new RelayCommand(SaveSessionGroup, CanExecute); this.TeacherList = new ObservableCollection <Teacher>(((SessionGroupDAL)_contextDal).TeacherList); this.SemesterList = new ObservableCollection <Semester>(((SessionGroupDAL)_contextDal).SemesterList); this.DictionaryDal = new DictionaryTypeDAL(); this.SessionGroupTypes = new ObservableCollection <DictionaryType>(DictionaryDal.FindAll(x => x.IsSessionGroup != null && x.IsSessionGroup == true)); if (SelectedSessionGroup.Semester == null) { if (SemesterList.Where(x => x.IsActive).SingleOrDefault() != null) { this.SelectedSessionGroup.SemesterID = SemesterList.Where(x => x.IsActive).FirstOrDefault().ID; GenerateTeams = true; } } if (SelectedSessionGroup.ID != 0) { SelectedSessionGroupTypeID = SessionGroupTypes.First().ID; } }
private bool CanCopySemester() { return(SemesterList.Where(x => x.IsActive).FirstOrDefault() != null); }