示例#1
0
        public AddExamViewModel(AddExamView view, Exam editExam)
        {
            this.view     = view;
            this.editExam = editExam;

            ExamPeriods = new ObservableCollection <ExamPeriod>(ServiceDataProvider.GetAllExamPeriods());
            Courses     = new ObservableCollection <Course>(ServiceDataProvider.GetAllCourses());

            if (editExam != null)
            {
                ExamPeriodId = editExam.ExamPeriodId;
                CourseId     = editExam.CourseId;
                DateAndTime  = editExam.DateAndTime;
                Place        = editExam.Place;
                Price        = editExam.Price;
                IsPassed     = editExam.IsPassed;
            }
        }
示例#2
0
 public ExamPeriodViewModel()
 {
     ExamPeriods = new ObservableCollection <ExamPeriod>(ServiceDataProvider.GetAllExamPeriods());
     ServiceDataProvider.AddExamPeriodNotification += ServiceDataProvider_AddExamPeriodNotification;
 }