Beispiel #1
0
 public ReportProcessingTaskData(UserContext userContext,
                                 ReportCardsInputModel reportInput, string contentUrl)
 {
     DistrictId       = userContext.DistrictId.Value;
     UserContext      = userContext;
     ReportInputModel = reportInput;
     ContentUrl       = contentUrl;
 }
Beispiel #2
0
        public static CustomReportCardsExportModel Create(ReportCard reportCard, Student studentData, ReportCardAddressData recipient, string logoRef, DateTime reportDate
                                                          , ReportCardsInputModel inputModel)
        {
            var res = new CustomReportCardsExportModel
            {
                AcadYear        = reportCard.AcadYear,
                LogoHref        = logoRef,
                AcadSessionName = reportCard.AcadSessionName,
                ReportDate      = reportDate.ToString("M/dd/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture),
                CopyRight       = $"Copyright (c) {DateTime.Now.Year} Chalkable",
                School          = new SchoolReportCardsExportModel
                {
                    Address1 = reportCard.School.Address1,
                    Address2 = reportCard.School.Address2,
                    City     = reportCard.School.City,
                    Name     = reportCard.School.Name,
                    Phone    = FormatSchoolPhone(reportCard.School.Phone),
                    State    = reportCard.School.State,
                    Zip      = reportCard.School.Zip
                },
                Student                  = StudentReportCardsExportModel.Create(reportCard.GradingPeriod, studentData, recipient, inputModel.IncludeGradedStandardsOnly, inputModel.IncludeComments),
                IncludeSignature         = inputModel.IncludeParentSignature,
                RecipientType            = inputModel.RecipientType,
                IncludeMeritDemerit      = inputModel.IncludeMeritDemerit,
                TraditionalGradingScales = new List <GradingScaleExportModel <TraditionalGradingScaleRangeExportModel> >(),
                StandardsGradingScales   = new List <GradingScaleExportModel <StandardsGradingScaleRangeExportModel> >(),
                IdToPrint                = inputModel.IdToPrint != 0 // 0 - this is NONE option on ui.
            };

            if (inputModel.IncludeGradingScaleTraditional)
            {
                res.TraditionalGradingScales = GradingScaleExportModel <TraditionalGradingScaleRangeExportModel> .Create(reportCard.GradingScales,
                                                                                                                         studentData.Sections, s => s.GradingScaleId, TraditionalGradingScaleRangeExportModel.Create);
            }
            if (inputModel.IncludeGradingScaleStandards)
            {
                res.StandardsGradingScales = GradingScaleExportModel <StandardsGradingScaleRangeExportModel> .Create(reportCard.GradingScales,
                                                                                                                     studentData.Sections, s => s.StandardGradingScaleId, StandardsGradingScaleRangeExportModel.Create);
            }
            return(res);
        }