コード例 #1
0
        private static void SetAggregations(
            SiteSettings ss,
            IEnumerable <Aggregation> aggregations,
            SqlJoinCollection join,
            SqlWhereCollection where,
            List <SqlStatement> statements)
        {
            switch (ss.ReferenceType)
            {
            case "Depts":
                statements.AddRange(Rds.DeptsAggregations(aggregations, join, where));
                break;

            case "Groups":
                statements.AddRange(Rds.GroupsAggregations(aggregations, join, where));
                break;

            case "Users":
                statements.AddRange(Rds.UsersAggregations(aggregations, join, where));
                break;

            case "Issues":
                statements.AddRange(Rds.IssuesAggregations(aggregations, join, where));
                break;

            case "Results":
                statements.AddRange(Rds.ResultsAggregations(aggregations, join, where));
                break;

            case "Wikis":
                statements.AddRange(Rds.WikisAggregations(aggregations, join, where));
                break;
            }
        }
コード例 #2
0
        private EnumerableRowCollection <DataRow> Get(
            SqlColumnCollection column   = null,
            SqlJoinCollection join       = null,
            SqlWhereCollection where     = null,
            SqlOrderByCollection orderBy = null,
            SqlParamCollection param     = null,
            Sqls.TableTypes tableType    = Sqls.TableTypes.Normal,
            bool distinct    = false,
            int top          = 0,
            int offset       = 0,
            int pageSize     = 0,
            bool history     = false,
            bool countRecord = false,
            IEnumerable <Aggregation> aggregations = null)
        {
            var statements = new List <SqlStatement>
            {
                Rds.SelectDepts(
                    dataTableName: "Main",
                    column: column ?? Rds.DeptsDefaultColumns(),
                    join: join ?? Rds.DeptsJoinDefault(),
                    where : where,
                    orderBy: orderBy,
                    param: param,
                    tableType: tableType,
                    distinct: distinct,
                    top: top,
                    offset: offset,
                    pageSize: pageSize,
                    countRecord: countRecord)
            };

            if (aggregations != null)
            {
                statements.AddRange(Rds.DeptsAggregations(
                                        aggregations: aggregations,
                                        join: join ?? Rds.DeptsJoinDefault(),
                                        where : where));
            }
            var dataSet = Rds.ExecuteDataSet(
                transactional: false,
                statements: statements.ToArray());

            Aggregations.Set(dataSet, aggregations);
            return(dataSet.Tables["Main"].AsEnumerable());
        }