Example #1
0
        public override List <GroupDataItem> GroupInfoDataItems()
        {
            var groupQueryResult = DataQueryProvider
                                   .CreateQuery(LOG(GROUPQueryInfo.GROUPQuery))
                                   .SetParameters(QueryPARAMETERS)
                                   .List();

            var groupQueryDataSource = FIX_INSENSITIVE_COLLATION(groupQueryResult.Cast <object[]>().ToArray());


            var groupDataItemFactory = new GroupDataItemFactory(GROUPQueryInfo.PropertyExpressions, GROUPQueryInfo.SummaryDescriptors);

            var result = groupQueryDataSource.Select(groupDataItemFactory.Produce).ToList();


            if (GROUPQueryInfo.GROUPORDERQuery.IsNotEmpty())
            {
                var groupOrderQueryResult = DataQueryProvider
                                            .CreateQuery(LOG(GROUPQueryInfo.GROUPORDERQuery))
                                            .SetParameters(QueryPARAMETERS)
                                            .List()
                                            .ToArray();

                var groupOrderQueryDataSource = FIX_INSENSITIVE_COLLATION(groupOrderQueryResult.Select(x => x as object[] ?? new[] { x }).ToArray());

                var keysActualOrder = groupOrderQueryDataSource.Select(x => x.CalculateKey()).ToList();

                result = result.OrderBy(keysActualOrder, x => x.Key).ToList();
            }


            return(result);
        }
Example #2
0
 public override TResult[] Items(int firstResult, int maxResults)
 {
     return(ExecuteFetchingPostProcess(
                DataQueryProvider
                .CreateQuery(LOG(SELECTQuery))
                .SetFirstResult(firstResult)
                .SetMaxResults(maxResults)
                .SetParameters(QueryPARAMETERS)
                .List <TSource>()
                ).ToArray());
 }
Example #3
0
        public override SummaryRepository TotalSummaryRepository()
        {
            var queryResult = DataQueryProvider
                              .CreateQuery(LOG(TOTALQueryInfo.TOTALQuery))
                              .SetParameters(QueryPARAMETERS)
                              .List()[0];


            var dataSource = queryResult as object[] ?? new[] { queryResult };


            var summaryRepositoryItemFactory = new SummaryRepositoryItemFactory(dataSource);

            return(new SummaryRepository(
                       TOTALQueryInfo.SummaryDescriptors.Select(summaryRepositoryItemFactory.Produce).ToList()
                       ));
        }