Ejemplo n.º 1
0
        public static IList <DataJoin <T, StatisticData> > GetPage <T>(DataSource ds, int type, DataSortType sort, DataColumn[] columns, DataOrder[] order, long index, int size, out long count, string idName, DataWhereQueue where) where T : DbTable, new()
        {
            List <DataColumn> list = new List <DataColumn>();

            if (columns == null)
            {
                list.Add(C <T>("*"));
            }
            else
            {
                list.AddRange(columns);
            }
            List <DataOrder> olist = new List <DataOrder>();

            if (type > 0)
            {
                olist.Add(new DataOrder <StatisticData>("Count", sort));
            }
            if (order != null)
            {
                olist.AddRange(order);
            }
            DataWhereQueue queue = WD;

            if (type > 0)
            {
                queue &= P <StatisticData>("Type", type);
            }
            if (queue != null)
            {
                queue &= where;
            }
            return(ExecuteReader <T, StatisticData>(ds, list.ToArray(), olist.ToArray(), index, size, out count, idName, "TargetId", DataJoinType.Inner, queue));
        }
Ejemplo n.º 2
0
 public DataOrder(string column, DataSortType sort = DataSortType.Asc)
     : base(column)
 {
     _sort = sort;
 }