public DemoModel Get(
     Context context,
     Sqls.TableTypes tableType    = Sqls.TableTypes.Normal,
     SqlColumnCollection column   = null,
     SqlJoinCollection join       = null,
     SqlWhereCollection where     = null,
     SqlOrderByCollection orderBy = null,
     SqlParamCollection param     = null,
     bool distinct = false,
     int top       = 0)
 {
     where = where ?? Rds.DemosWhereDefault(this);
     Set(context, Repository.ExecuteTable(
             context: context,
             statements: Rds.SelectDemos(
                 tableType: tableType,
                 column: column ?? Rds.DemosDefaultColumns(),
                 join: join ?? Rds.DemosJoinDefault(),
                 where : where,
                 orderBy: orderBy,
                 param: param,
                 distinct: distinct,
                 top: top)));
     return(this);
 }
예제 #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.SelectDemos(
                    dataTableName: "Main",
                    column: column ?? Rds.DemosDefaultColumns(),
                    join: join ?? Rds.DemosJoinDefault(),
                    where : where,
                    orderBy: orderBy,
                    param: param,
                    tableType: tableType,
                    distinct: distinct,
                    top: top,
                    offset: offset,
                    pageSize: pageSize,
                    countRecord: countRecord)
            };

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

            Aggregations.Set(dataSet, aggregations);
            return(dataSet.Tables["Main"].AsEnumerable());
        }
예제 #3
0
        private EnumerableRowCollection <DataRow> Get(
            Context context,
            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)
        {
            var statements = new List <SqlStatement>
            {
                Rds.SelectDemos(
                    dataTableName: "Main",
                    column: column ?? Rds.DemosDefaultColumns(),
                    join: join ?? Rds.DemosJoinDefault(),
                    where : where,
                    orderBy: orderBy,
                    param: param,
                    tableType: tableType,
                    distinct: distinct,
                    top: top,
                    offset: offset,
                    pageSize: pageSize),
                Rds.SelectCount(
                    tableName: "Demos",
                    tableType: tableType,
                    join: join ?? Rds.DemosJoinDefault(),
                    where : where)
            };
            var dataSet = Rds.ExecuteDataSet(
                context: context,
                transactional: false,
                statements: statements.ToArray());

            TotalCount = Rds.Count(dataSet);
            return(dataSet.Tables["Main"].AsEnumerable());
        }