示例#1
0
        public List <InformationInfo> FindAll4(PagerInfo info, string fieldToSort, bool isDescending)
        {
            var    action   = System.Reflection.MethodBase.GetCurrentMethod().Name;
            string url      = this.GetPostUrlWithToken(action) + string.Format("&fieldToSort={0}&isDescending={1}", fieldToSort, isDescending);
            string postData = info.ToJson();

            var result = JsonHelper <List <InformationInfo> > .ConvertJson(url, postData);

            return(result);
        }
示例#2
0
        /// <summary>
        /// 根据条件,从视图里面获取记录
        /// </summary>
        /// <param name="viewName">视图名称</param>
        /// <param name="condition">查询条件</param>
        /// <param name="sortField">排序字段</param>
        /// <param name="isDescending">是否为降序</param>
        /// <param name="pagerInfo">分页条件</param>
        /// <returns></returns>
        public virtual DataTable FindByViewWithPager(string viewName, string condition, string sortField, bool isDescending, PagerInfo pagerInfo)
        {
            var    action   = "FindByViewWithPager";
            string url      = GetTokenUrl(action) + string.Format("&viewName={0}&condition={1}&sortField={2}&isDescending={3}", viewName.UrlEncode(), condition.UrlEncode(), sortField.UrlEncode(), isDescending);
            var    postData = pagerInfo.ToJson();

            DataTable     result = new DataTable();
            PageTableList list   = JsonHelper <PageTableList> .ConvertJson(url, postData);

            if (list != null)
            {
                pagerInfo.RecordCount = list.total_count;//修改总记录数
                result = list.list;
            }
            return(result);
        }
示例#3
0
        /// <summary>
        /// 根据条件查询数据库,并返回DataTable集合(用于分页数据显示)
        /// </summary>
        /// <param name="condition">查询的条件</param>
        /// <param name="pagerInfo">分页实体</param>
        /// <param name="fieldToSort">排序字段</param>
        /// <param name="desc">是否降序</param>
        /// <returns>指定DataTable的集合</returns>
        public virtual DataTable FindToDataTableWithPager2(string condition, ref PagerInfo pagerInfo, string fieldToSort, bool desc)
        {
            var    action   = "FindToDataTableWithPager2";
            string url      = GetTokenUrl(action) + string.Format("&fieldToSort={0}&desc={1}&condition={2}", fieldToSort.UrlEncode(), desc, condition.UrlEncode());
            var    postData = pagerInfo.ToJson();

            DataTable     result = new DataTable();
            PageTableList list   = JsonHelper <PageTableList> .ConvertJson(url, postData);

            if (list != null)
            {
                pagerInfo.RecordCount = list.total_count;//修改总记录数
                result = list.list;
            }
            return(result);
        }
示例#4
0
        /// <summary>
        /// 根据分页条件,返回DataSet对象
        /// </summary>
        /// <param name="pagerInfo">分页条件</param>
        /// <returns></returns>
        public virtual DataTable GetAllToDataTableWithPager(ref PagerInfo pagerInfo)
        {
            var    action   = "GetAllToDataTableWithPager";
            string url      = GetTokenUrl(action);
            var    postData = pagerInfo.ToJson();

            DataTable     result = new DataTable();
            PageTableList list   = JsonHelper <PageTableList> .ConvertJson(url, postData);

            if (list != null)
            {
                pagerInfo.RecordCount = list.total_count;//修改总记录数
                result = list.list;
            }
            return(result);
        }
示例#5
0
        /// <summary>
        /// 返回数据库所有的对象集合(用于分页数据显示)
        /// </summary>
        /// <param name="pagerInfo">分页实体信息</param>
        /// <param name="fieldToSort">排序字段</param>
        /// <param name="desc">是否降序</param>
        /// <returns>指定对象的集合</returns>
        public virtual List <T> GetAllWithPager2(ref PagerInfo pagerInfo, string fieldToSort, bool desc)
        {
            var    action   = "GetAllWithPager2";
            string url      = GetTokenUrl(action) + string.Format("&fieldToSort={0}&desc={1}", fieldToSort, desc);
            var    postData = pagerInfo.ToJson();

            List <T>      result = new List <T>();
            PagedList <T> list   = JsonHelper <PagedList <T> > .ConvertJson(url, postData);

            if (list != null)
            {
                pagerInfo.RecordCount = list.total_count;//修改总记录数
                result = list.list;
            }
            return(result);
        }
示例#6
0
        /// <summary>
        /// 返回数据库所有的对象集合(用于分页数据显示)
        /// </summary>
        /// <param name="pagerInfo">分页实体信息</param>
        /// <returns>指定对象的集合</returns>
        public virtual List <T> GetAllWithPager(ref PagerInfo pagerInfo)
        {
            var    action   = "GetAllWithPager";
            string url      = GetTokenUrl(action);
            var    postData = pagerInfo.ToJson();

            List <T>      result = new List <T>();
            PagedList <T> list   = JsonHelper <PagedList <T> > .ConvertJson(url, postData);

            if (list != null)
            {
                pagerInfo.RecordCount = list.total_count;//修改总记录数
                result = list.list;
            }
            return(result);
        }
示例#7
0
        /// <summary>
        /// 根据条件查询数据库,并返回对象集合(用于分页数据显示)
        /// </summary>
        /// <param name="condition">查询的条件</param>
        /// <param name="pagerInfo">分页实体</param>
        /// <param name="fieldToSort">排序字段</param>
        /// <param name="desc">是否降序</param>
        /// <returns>指定对象的集合</returns>
        public virtual List <T> FindWithPager3(string condition, ref PagerInfo pagerInfo, string fieldToSort, bool desc)
        {
            var    action   = "FindWithPager3";
            string url      = GetTokenUrl(action) + string.Format("&condition={0}&fieldToSort={1}&desc={2}", condition.UrlEncode(), fieldToSort.UrlEncode(), desc);
            var    postData = pagerInfo.ToJson();

            List <T>      result = new List <T>();
            PagedList <T> list   = JsonHelper <PagedList <T> > .ConvertJson(url, postData);

            if (list != null)
            {
                pagerInfo.RecordCount = list.total_count;//修改总记录数
                result = list.list;
            }
            return(result);
        }