示例#1
0
        /// <summary>
        /// 得到某一结果文件的某一页数据 并按某一字段排序
        /// </summary>
        /// <param name="sp">检索式</param>
        /// <param name="PageIndex">要取的页数</param>
        /// <param name="PageSize">页数大小</param>
        /// <param name="SortExpression">排序字段</param>
        /// <returns>list(int)</int></returns>
        public IEnumerable GetResultList(SearchPattern sp, int PageSize, int PageIndex, string SortExpression)
        {
            try
            {

                ResultServices res = new ResultServices();
                List<int> lstNo = res.GetResultListByEnd(sp, PageSize, PageIndex, SortExpression);

                IEnumerable ien = GetResult(lstNo);
                return ien;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                return null;
            }
        }
示例#2
0
        /// <summary>
        /// 得到某一结果文件的某一页数据 并按某一字段排序
        /// </summary>
        /// <param name="sp">检索式</param>
        /// <param name="PageIndex">要取的页数</param>
        /// <param name="PageSize">页数大小</param>
        /// <param name="SortExpression">排序字段</param>
        /// <returns>list(int)</int></returns>
        public IEnumerable GetResultList(SearchPattern sp, int PageSize, int PageIndex, string SortExpression)
        {
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();
                Table<DwpiAccessionNoSerialNo> tbCnDocInfo = db.DwpiAccessionNoSerialNo;

                ResultServices res = new ResultServices();
                List<int> lstNo = res.GetResultListByEnd(sp, PageSize, PageIndex, SortExpression);

                var result = from item in tbCnDocInfo
                             where lstNo.Contains(Convert.ToInt32(item.SerialNo))
                             orderby item.SerialNo descending
                             select new
                             {
                                 //TI = item.Title.Substring(0,100)+"......",//标题
                                 //AN = GetString(item.AppNo,";",1), //申请号
                                 //AD = GetString(item.PublicNo,";",3),//公开号
                                 //IPC = GetString(item.IPC,";",4),    //IPC
                                 //CPIC=item.AccessionNo, //入藏号
                                 TI = item.Title,//标题
                                 AN = item.AppNo, //申请号
                                 AD = item.PublicNo,//公开号
                                 IPC = item.IPC,    //IPC
                                 CPIC = item.AccessionNo, //入藏号
                             };

                //paging... (LINQ)
                //IEnumerable ien = result.Skip((PageNumber - 1) * PageSize).Take(PageSize);
                IEnumerable ien = result.DefaultIfEmpty();
                return ien;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                return null;
            }
        }
示例#3
0
        /// <summary>
        /// 得到某一结果文件的某一页数据 并按某一字段排序
        /// </summary>
        /// <param name="sp">检索式</param>
        /// <param name="PageIndex">要取的页数</param>
        /// <param name="PageSize">页数大小</param>
        /// <param name="SortExpression">排序字段</param>
        /// <returns>list(int)</int></returns>
        public List<xmlDataInfo> GetResultList(Cpic.Cprs2010.Search.SearchPattern sp, int PageSize, int PageIndex, string SortExpression)
        {
            List<xmlDataInfo> ien = new List<xmlDataInfo>();
            try
            {
                ResultServices res = new ResultServices();

                List<int> lstNo = res.GetResultListByEnd(sp, PageSize, PageIndex, SortExpression);
                if (sp.DbType == Cpic.Cprs2010.Search.SearchDbType.Cn)
                {
                    ien = GetResult(lstNo, "CN");
                }
                else if (sp.DbType == Cpic.Cprs2010.Search.SearchDbType.DocDB)
                {
                    ien = GetResult(lstNo, "DocDB");
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                //return null;
            }
            return ien;
        }