Exemplo n.º 1
0
        protected virtual dynamic GetInstanceList(SelectTransaction <T> selecttrcn)
        {
            var      size = GetPageSize();
            List <T> list = selecttrcn.SelectAll(size.PageSize * (size.PageIndex - 1), size.PageSize * size.PageIndex + 1);//查询出结果

            return(new { List = list, Count = selecttrcn.SelectRowsCount() });
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获得查询结果
        /// </summary>
        /// <param name="selecttrcn"></param>
        /// <returns></returns>
        protected override dynamic GetInstanceList(SelectTransaction <T> selecttrcn)
        {
            var size = GetPageSize();

            //组合查询语句
            string where = GetSearchWhere();
            InitParams();
            if (param.Count > 0)
            {
                foreach (var p in param)
                {
                    if (p.Value.Length > 0)
                    {
                        where += string.Format(" AND {0}='{1}' ", p.Key, p.Value);
                    }
                    else
                    {
                        where += string.Format(" AND {0}", p.Key);
                    }
                }
            }
            List <T> list = selecttrcn.SelectAll(where, size.PageSize * (size.PageIndex - 1), size.PageSize * size.PageIndex + 1);//查询出结果

            return(new { Draw = size.Draw, recordsTotal = selecttrcn.SelectRowsCount(), recordsFiltered = selecttrcn.SelectRowsCount(where), List = list });
        }
Exemplo n.º 3
0
        protected virtual dynamic GetInstanceList(SelectTransaction <T> selecttrcn)
        {
            var      size = GetPageSize();
            List <T> list = selecttrcn.SelectAll(size.PageSize * (size.PageIndex - 1), size.PageSize * size.PageIndex + 1);//查询出结果

            return(new { Draw = size.Draw, recordsTotal = selecttrcn.SelectRowsCount(), recordsFiltered = selecttrcn.SelectRowsCount(), List = list });
        }