Exemplo n.º 1
0
        public IDictionary <string, object>[] take(int count)
        {
            var query = new IndexedDB.Dynamic.Query(this.ktable.table);

            if (!string.IsNullOrEmpty(this.SearchCondition))
            {
                var filter = query.ParserFilter(this.SearchCondition);
                query.items = filter;
            }
            else
            {
                //throw new Exception("You do not any search condition");
            }

            if (!string.IsNullOrEmpty(this.OrderByField))
            {
                if (this.Ascending)
                {
                    query.OrderByAscending(this.OrderByField);
                }
                else
                {
                    query.OrderByDescending(this.OrderByField);
                }
            }

            return(query.Skip(this.skipcount).Take(count).ToArray());
        }
Exemplo n.º 2
0
        public DynamicTableObject[] take(int count)
        {
            var query = new IndexedDB.Dynamic.Query(this.ktable.table);

            if (!string.IsNullOrEmpty(this.SearchCondition))
            {
                var filter = query.ParserFilter(this.SearchCondition);
                query.items = filter;
            }
            else
            {
                //throw new Exception("You do not any search condition");
            }

            if (!string.IsNullOrEmpty(this.OrderByField))
            {
                if (this.Ascending)
                {
                    query.OrderByAscending(this.OrderByField);
                }
                else
                {
                    query.OrderByDescending(this.OrderByField);
                }
            }

            var result = query.Skip(this.skipcount).Take(count).ToArray();

            return(DynamicTableObject.CreateList(result, this.ktable.table, this.ktable.context));
        }
Exemplo n.º 3
0
        public int count()
        {
            var query = new IndexedDB.Dynamic.Query(this.ktable.table);

            if (!string.IsNullOrEmpty(this.SearchCondition))
            {
                var filter = query.ParserFilter(this.SearchCondition);
                query.items = filter;
            }
            return(query.Count());
        }