Esempio n. 1
0
        private CourseViewModel findCourse(GradingPeriodViewModel gradingPeriod)
        {
            foreach(CourseViewModel course in gradingPeriod.Courses) {
                if(course.Id.Equals(this.courseId)) {
                    return course;
                }
            }

            return null;
        }
        public void CreateGradingPeriodFromCurrent()
        {
            GradingPeriodViewModel gradingPeriodVm = new GradingPeriodViewModel();

            this.GradingPeriods.Add(gradingPeriodVm);

            gradingPeriodVm.Students = cloneStudents(this.CurrentGradingPeriod.Students);
            gradingPeriodVm.Courses  = cloneCourses(this.CurrentGradingPeriod.Courses);

            this.CurrentGradingPeriod.isComplete = true;
            this.CurrentGradingPeriod            = gradingPeriodVm;
        }
        /**
         * Creates a new grading period as the current grading period.
         **/
        public void CreateGradingPeriod()
        {
            GradingPeriodViewModel gradingPeriodVm = new GradingPeriodViewModel();
            this.GradingPeriods.Add(gradingPeriodVm);

            if (this.CurrentGradingPeriod != null)
            {
                this.CurrentGradingPeriod.isComplete = true;
            }

            this.CurrentGradingPeriod = gradingPeriodVm;
        }
        /**
         * Creates a new grading period as the current grading period.
         **/
        public void CreateGradingPeriod()
        {
            GradingPeriodViewModel gradingPeriodVm = new GradingPeriodViewModel();

            this.GradingPeriods.Add(gradingPeriodVm);

            if (this.CurrentGradingPeriod != null)
            {
                this.CurrentGradingPeriod.isComplete = true;
            }

            this.CurrentGradingPeriod = gradingPeriodVm;
        }
Esempio n. 5
0
        public GradingPeriod(GradingPeriodViewModel gradingPeriodVM)
        {
            this.Id = gradingPeriodVM.Id;
            this.Name = gradingPeriodVM.Name;
            this.isComplete = gradingPeriodVM.isComplete;
            this.Courses = new List<Course>();
            foreach (CourseViewModel courseVM in gradingPeriodVM.Courses)
            {
                this.Courses.Add(new Course(courseVM));
            }

            this.Students = new List<Student>();
            foreach (StudentViewModel studentVM in gradingPeriodVM.Students)
            {
                this.Students.Add(new Student(studentVM));
            }
        }
        public SchoolYearViewModel(SchoolYear schoolYear)
        {
            this.Id             = schoolYear.Id;
            this.Name           = schoolYear.Name;
            this.isComplete     = schoolYear.isComplete;
            this.GradingPeriods = new List <GradingPeriodViewModel>();

            if (schoolYear.GradingPeriods != null)
            {
                foreach (GradingPeriod gradingPeriod in schoolYear.GradingPeriods)
                {
                    GradingPeriodViewModel gradingPeriodVM = new GradingPeriodViewModel(gradingPeriod);
                    this.GradingPeriods.Add(gradingPeriodVM);

                    if (!gradingPeriodVM.isComplete)
                    {
                        this.CurrentGradingPeriod = gradingPeriodVM;
                    }
                }
            }
        }
        public SchoolYearViewModel(SchoolYear schoolYear)
        {
            this.Id = schoolYear.Id;
            this.Name = schoolYear.Name;
            this.isComplete = schoolYear.isComplete;
            this.GradingPeriods = new List<GradingPeriodViewModel>();

            if (schoolYear.GradingPeriods != null)
            {
                foreach (GradingPeriod gradingPeriod in schoolYear.GradingPeriods)
                {
                    GradingPeriodViewModel gradingPeriodVM = new GradingPeriodViewModel(gradingPeriod);
                    this.GradingPeriods.Add(gradingPeriodVM);

                    if (!gradingPeriodVM.isComplete)
                    {
                        this.CurrentGradingPeriod = gradingPeriodVM;
                    }
                }
            }
        }
        public void CreateGradingPeriodFromCurrent()
        {
            GradingPeriodViewModel gradingPeriodVm = new GradingPeriodViewModel();
            this.GradingPeriods.Add(gradingPeriodVm);

            gradingPeriodVm.Students = cloneStudents(this.CurrentGradingPeriod.Students);
            gradingPeriodVm.Courses = cloneCourses(this.CurrentGradingPeriod.Courses);

            this.CurrentGradingPeriod.isComplete = true;
            this.CurrentGradingPeriod = gradingPeriodVm;
        }