예제 #1
0
        private static string RepositoryFunctionsSnippet(ReportFileInfo info)
        {
            // TODO: Implement UseExecutionContext concept for reports, then remove the predefined parameter executionContext from _ReportFile_FileGenerator.
            return string.Format(
            @"        protected static Func<object[][], string, Common.ExecutionContext, Rhetos.Dom.DefaultConcepts.ReportFile> _ReportFile_FileGenerator = {2};

            public Rhetos.Dom.DefaultConcepts.ReportFile GenerateReport({0}.{1} parameter, string convertFormat = null)
            {{
            {3}
            object[][] reportData = GetReportData(parameter);
            {4}
            Rhetos.Dom.DefaultConcepts.ReportFile file = _ReportFile_FileGenerator(reportData, convertFormat, _executionContext);
            {5}

            return file;
            }}

            Rhetos.Dom.DefaultConcepts.ReportFile IReportRepository.GenerateReport(object parameters, string convertFormat)
            {{
            return GenerateReport(({0}.{1}) parameters, convertFormat);
            }}

            ",
            info.Module.Name,
            info.Name,
            info.Expression,
            BeforePrepareDataTag.Evaluate(info),
            BeforeGenerateReportTag.Evaluate(info),
            AfterGenerateReportTag.Evaluate(info));
        }
예제 #2
0
 public static string RegisterRepository(ReportFileInfo info)
 {
     return string.Format(@"builder.RegisterType<{0}._Helper.{1}_Repository>().Keyed<IReportRepository>(""{0}.{1}"");
     ", info.Module.Name, info.Name);
 }