private GradebookViewModel() { GradebookModel _gradebook = GradebookDao.getGradebook(); this.SchoolYears = new List <SchoolYearViewModel>(); foreach (SchoolYear schoolYear in _gradebook.SchoolYears) { SchoolYearViewModel schoolYearVM = new SchoolYearViewModel(schoolYear); this.SchoolYears.Add(schoolYearVM); if (!schoolYearVM.isComplete) { this.SchoolYear = schoolYearVM; } } if (this.SchoolYear == null) { this.SchoolYear = new SchoolYearViewModel(); this.SchoolYears.Add(this.SchoolYear); } if (SchoolYear.CurrentGradingPeriod == null) { SchoolYear.CreateGradingPeriod(); } GradingPeriod = SchoolYear.CurrentGradingPeriod; }
private GradebookViewModel() { GradebookModel _gradebook = GradebookDao.getGradebook(); this.SchoolYears = new List<SchoolYearViewModel>(); foreach (SchoolYear schoolYear in _gradebook.SchoolYears) { SchoolYearViewModel schoolYearVM = new SchoolYearViewModel(schoolYear); this.SchoolYears.Add(schoolYearVM); if (!schoolYearVM.isComplete) { this.SchoolYear = schoolYearVM; } } if (this.SchoolYear == null) { this.SchoolYear = new SchoolYearViewModel(); this.SchoolYears.Add(this.SchoolYear); } if (SchoolYear.CurrentGradingPeriod == null) { SchoolYear.CreateGradingPeriod(); } GradingPeriod = SchoolYear.CurrentGradingPeriod; }
public GradeTotalsForm(SchoolYearViewModel schoolYear) { InitializeComponent(); gradeTotalsVM = new GradeTotalsViewModel(schoolYear); addCourseTabs(); }
public SchoolYear(SchoolYearViewModel schoolYearVM) { this.Id = schoolYearVM.Id; this.Name = schoolYearVM.Name; this.isComplete = schoolYearVM.isComplete; this.GradingPeriods = new List<GradingPeriod>(); foreach (GradingPeriodViewModel gradingPeriodVM in schoolYearVM.GradingPeriods) { this.GradingPeriods.Add(new GradingPeriod(gradingPeriodVM)); } }
public void CreateSchoolYearFromCurrent() { this.SchoolYear.isComplete = true; this.SchoolYear.CurrentGradingPeriod.isComplete = true; SchoolYearViewModel nextSchoolYear = new SchoolYearViewModel(); nextSchoolYear.CreateGradingPeriod(); nextSchoolYear.CurrentGradingPeriod.Courses = cloneCourses(this.SchoolYear.CurrentGradingPeriod.Courses); this.SchoolYear = nextSchoolYear; this.SchoolYears.Add(nextSchoolYear); this.GradingPeriod = nextSchoolYear.CurrentGradingPeriod; }