private static string GetReportDataSnippet(ReportDataSourceInfo info)
        {
            return string.Format(@"
	        {{
                var dataSourceRepositiory = _domRepository.{1};
                var data = dataSourceRepositiory.Filter(parameter);
                var order = {2};
	            reportData.Add(order, data);
            }}
",
            info.Report.GetKeyProperties(),
            info.DataSource.GetKeyProperties(),
            CsUtility.QuotedString(info.Order));
        }
Exemplo n.º 2
0
        private static string GetReportDataSnippet(ReportDataSourceInfo info)
        {
            return string.Format(@"
            {{
                var dataSourceRepositiory = _domRepository.{1} as IFilterRepository<{0}, {1}>;
                if (dataSourceRepositiory == null)
                    throw new Rhetos.UserException(""Report's data source '{1}' does not implement the filter for '{0}'."");

                var data = dataSourceRepositiory.Filter(parameter);
                var order = {2};
                reportData.Add(order, data);
            }}
            ",
            info.Report.GetKeyProperties(),
            info.DataSource.GetKeyProperties(),
            CsUtility.QuotedString(info.Order));
        }
Exemplo n.º 3
0
 private static string DataSourceNameSnippet(ReportDataSourceInfo info)
 {
     return CsUtility.QuotedString(info.DataSource.GetKeyProperties()) + @", ";
 }