public static ClassGradingBoxesViewData Create(IList <GradingPeriod> gradingPeriods,
                                                TeacherClassGrading gradingSummary, IList <ClaimInfo> claims)
 {
     return(new ClassGradingBoxesViewData
     {
         GradingPeriods = gradingPeriods.Select(GradingPeriodViewData.Create).ToList(),
         CurrentGradingBox = GradingClassSummaryViewData.Create(gradingSummary, claims)
     });
 }
        public static GradingClassSummaryViewData Create(IList <AnnouncementDetails> announcements,
                                                         GradingPeriod gradingPeriod, IList <GradedClassAnnouncementType> announcementTypes, double?avg, IList <ClaimInfo> claims)
        {
            var res = new GradingClassSummaryViewData
            {
                GradingPeriod       = GradingPeriodViewData.Create(gradingPeriod),
                Avg                 = (decimal?)avg,
                ByAnnouncementTypes = new List <GradingClassSummaryItemViewData>()
            };

            if (announcements != null && announcementTypes != null)
            {
                foreach (var gradedClassAnnouncementType in announcementTypes)
                {
                    var anns = announcements.Where(x => x.ClassAnnouncementData.ClassAnnouncementTypeRef == gradedClassAnnouncementType.Id).ToList();
                    res.ByAnnouncementTypes.Add(GradingClassSummaryItemViewData.Create(anns, gradedClassAnnouncementType, claims));
                }
            }
            return(res);
        }