private void RegisterCourse(string courseId, bool replacementCourse = false) { if (!string.IsNullOrWhiteSpace(courseId) && SelectedParticipant != null) { if (!Workspace.CurrentData.CourseParticipants.Any(x => x.CourseId == courseId && x.ParticipantId == SelectedParticipant.Id && !x.IsReplacementCourse && (x.Present ?? true))) { var newParticipant = CourseParticipantModel.CreateNewCourseParticipant(); newParticipant.CourseId = courseId; newParticipant.ParticipantId = SelectedParticipant.Id; newParticipant.IsReplacementCourse = replacementCourse; } } }
public CoursePresenceViewModel(CourseParticipantModel storageParicipantModel) { this.storageParicipantModel = storageParicipantModel; this.PropertyChanged += CoursePresenceViewModel_PropertyChanged; }