Example #1
0
 public AddExamViewModel(Student student, AddExamView window)
 {
     this.Student       = student;
     this.Exam          = new Exam();
     this.window        = window;
     this.SaveCommand   = new MyCommand(SaveExam);
     this.CancelCommand = new MyCommand(Cancel);
 }
Example #2
0
        private void ExecuteEdit(object p)
        {
            if (p != null && p is Exam)
            {
                var exam = p as Exam;

                AddExamView view = new AddExamView(exam);
                view.ShowDialog();
            }
        }
Example #3
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;
            }
        }
Example #4
0
        private void AddExam(object property)
        {
            AddExamView window = new AddExamView((Student)property);

            window.ShowDialog();
        }
Example #5
0
        private void ExecuteOpen()
        {
            AddExamView view = new AddExamView();

            view.ShowDialog();
        }