Пример #1
0
        public void AddNewGradedActivity()
        {
            var window = new AddGradedActivity();

            GradedActivity newActivity = new GradedActivity();

            window.DataContext = newActivity;

            var result = window.ShowDialog();

            if (result == true)
            {
                SelectedUser.SelectedSemester.SelectedClass.SelectedGradingPeriod.SelectedGradingComponent.ListActivities.Add(newActivity);
            }
        }
Пример #2
0
        public void EditGradedActivity()
        {
            var window = new AddGradedActivity();

            window.DataContext = SelectedUser.SelectedSemester.SelectedClass.SelectedGradingPeriod.SelectedGradingComponent.SelectedActivity;
            GradedActivity uneditedActivity = new GradedActivity();

            uneditedActivity.ActivityName = SelectedUser.SelectedSemester.SelectedClass.SelectedGradingPeriod.SelectedGradingComponent.SelectedActivity.ActivityName;
            uneditedActivity.PercentScore = SelectedUser.SelectedSemester.SelectedClass.SelectedGradingPeriod.SelectedGradingComponent.SelectedActivity.PercentScore;
            uneditedActivity.Score        = SelectedUser.SelectedSemester.SelectedClass.SelectedGradingPeriod.SelectedGradingComponent.SelectedActivity.Score;
            uneditedActivity.TotalItems   = SelectedUser.SelectedSemester.SelectedClass.SelectedGradingPeriod.SelectedGradingComponent.SelectedActivity.TotalItems;

            var result = window.ShowDialog();

            if (result == false)
            {
                SelectedUser.SelectedSemester.SelectedClass.SelectedGradingPeriod.SelectedGradingComponent.SelectedActivity.ActivityName = uneditedActivity.ActivityName;
                SelectedUser.SelectedSemester.SelectedClass.SelectedGradingPeriod.SelectedGradingComponent.SelectedActivity.PercentScore = uneditedActivity.PercentScore;
                SelectedUser.SelectedSemester.SelectedClass.SelectedGradingPeriod.SelectedGradingComponent.SelectedActivity.Score        = uneditedActivity.Score;
                SelectedUser.SelectedSemester.SelectedClass.SelectedGradingPeriod.SelectedGradingComponent.SelectedActivity.TotalItems   = uneditedActivity.TotalItems;
            }
        }