Beispiel #1
0
        public static string getFamily(string appno, string pageNumber, string pageSize, string CPIC)
        {
            int pindex = Convert.ToInt32(pageNumber);
            int Psize = Convert.ToInt32(pageSize);
            string strappno = appno;
            int intid = Convert.ToInt32(CPIC);
            ResultDataManagerDataContext db = new ResultDataManagerDataContext();
            Table<Cpic.Cprs2010.Search.ResultData.DocdbDocInfo> tbDocdbInfo = db.DocdbDocInfo;

            var tmp = (from item in tbDocdbInfo
                       where intid != 0 && item.CPIC.Equals(intid)
                       select item).Skip(Psize * (pindex - 1)).Take(Psize);
            List<enfml> result = (from item in tmp
                                  select new enfml
                                  {
                                      ANX = string.Empty,
                                      apno = item.PubID,
                                      title = item.Title
                                  }).ToList<enfml>();
            int count = (from item in tbDocdbInfo
                         where intid != 0 && item.CPIC.Equals(intid)
                         select item).Count();

            SearchInterface.ClsSearch search = new SearchInterface.ClsSearch();

            foreach (var x in result)
            {

                x.ANX = UrlParameterCode_DE.encrypt(x.apno);

                try
                {
                    if (string.IsNullOrEmpty(x.title.Trim()))
                    {
                        x.title = search.GetEnxmlDataInfo(x.ANX).StrTitle;
                    }
                }
                catch (Exception ex) { }
            }

            return JsonHelper.ListToJson<enfml>(result, "rows", count.ToString());
        }
Beispiel #2
0
    public string FormateDisPlayTz(string strPubNo, string CPIC)
    {
        string strRs = "";
        int nTopN = 50;
        int nCount = 0;
        try
        {
            ResultDataManagerDataContext db = new ResultDataManagerDataContext();
            Table<DocdbDocInfo> tbDocdbInfo = db.DocdbDocInfo;
            var result = from item in tbDocdbInfo
                         where CPIC != "0" && item.CPIC.Equals(CPIC) && item.PubID != strPubNo
                         select item.PubID;

            nCount = result.Count();

            strRs += "[" + nCount.ToString() + "]&nbsp;";

            if (nTopN < nCount)
            {
                result = result.Take(nTopN);
            }
            foreach (var pub in result)
            {
                strRs += string.Format("&nbsp;<a class='patItem' href='EnPatentDetails.aspx?Id={0}' target='_blank'>{1}</a>",
                    Cpic.Cprs2010.Cfg.UrlParameterCode_DE.encrypt(pub), pub);
            }

            if (nTopN < nCount)
            {
                strRs += string.Format("&nbsp;&nbsp;<a class='int' href='#' onclick=\"showFamily('{1}','{2}')\">更多[{0}]</a>", nCount - nTopN, strPubNo, CPIC);
            }
        }
        catch (Exception ex)
        {
        }
        return strRs;
    }
Beispiel #3
0
        /// <summary>
        /// 得到某一结果文件的全部数据
        /// </summary>
        /// <param name="sp">检索式</param>
        /// <param name="SortExpression">排序</param>
        /// <returns>list int</returns>
        public IEnumerable GetResultList(SearchPattern sp, string SortExpression)
        {
            ResultDataManagerDataContext db = new ResultDataManagerDataContext();
            Table<DocdbFamilyInfo> tbCnDocInfo = db.DocdbFamilyInfo;

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

            var result = from item in tbCnDocInfo
                         where lstNo.Contains(Convert.ToInt32(item.CPIC))
                         select new
                         {
                             TI = item.Title,
                             AN = item.AppNo,
                             AD = item.AppDate,
                             IPC = item.IPC,
                         };

            //paging... (LINQ)
            //IEnumerable ien = result.Skip((PageNumber - 1) * PageSize).Take(PageSize);
            IEnumerable ien = result.DefaultIfEmpty();

            return ien;
        }
Beispiel #4
0
        /// <summary>
        /// 得到给定号单(成员)的结果数据 并按某一字段排序
        /// </summary>
        /// <param name="lstNo"></param>
        /// <returns></returns>
        public List<GeneralDataInfo> GetResulDoctListDataInfo(List<int> _lstNo, int PageSize, int PageIndex, string SortExpression)
        {
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();
                Table<DocdbDocInfo> tbDocdbDocInfo = db.DocdbDocInfo;

                ResultServices res = new ResultServices();
                List<int> lstNo = (_lstNo.Skip((PageIndex - 1) * PageSize).Take(PageSize)).ToList();

                var result = from item in tbDocdbDocInfo
                             where lstNo.Contains(Convert.ToInt32(item.ID))
                             orderby item.ID descending
                             select new GeneralDataInfo
                             {
                                 StrTI = item.Title,
                                 StrPubID=item.PubID.Trim(),
                                 StrPtCode = UrlParameterCode_DE.encrypt(item.PubID.Trim()),  //add by xiwl
                                 StrAD = item.AppDate,
                                 StrIPC = item.IPC,
                                 NCPIC =Convert.ToInt64(item.CPIC), //add by wsx-->up by xiwl on 20120315 id>CPIC
                                 NID=item.ID,
                                 StrAN = item.AppNo,
                             };

                //paging... (LINQ)
                //IEnumerable ien = result.Skip((PageNumber - 1) * PageSize).Take(PageSize);
                List<GeneralDataInfo> ien = result.ToList<GeneralDataInfo>();
                return ien;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                return null;
            }
        }
Beispiel #5
0
        public xmlDataInfo GetEnxmlDataInfo(string strPubX)
        {
            string PubNo = UrlParameterCode_DE.DecryptionAll(strPubX);
            xmlDataInfo resXmlInfo = null;
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();
                Table<DocdbDocInfo> tbDocDocInfo = db.DocdbDocInfo;

                var result = from item in tbDocDocInfo
                             where item.PubID == PubNo
                             orderby item.ID descending
                             select new xmlDataInfo
                             {
                                 StrTitle = item.Title,
                                 StrApNo = item.AppNo,
                                 StrApDate = item.AppDate,
                                 StrANX = strPubX,
                                 StrIpc = item.IPC.Substring(0, 50),
                                 StrPubNo = item.PubID,
                                 CPIC = item.CPIC.ToString(),
                                 StrSerialNo = item.ID.ToString(),
                             };

                resXmlInfo = result.First();
                UpdateByEnXmlFile(resXmlInfo, true);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
            }
            return resXmlInfo;
        }
Beispiel #6
0
        /// <summary>
        /// 得到给定号单的结果数据
        /// </summary>
        /// <param name="_lstNo"></param>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="SortExpression"></param>
        /// <returns></returns>
        public IEnumerable GetResultList(List<int> _lstNo, int PageSize, int PageIndex, string SortExpression)
        {
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();
                Table<DwpiAccessionNoSerialNo> tbCnDocInfo = db.DwpiAccessionNoSerialNo;

                List<int> lstNo = (_lstNo.Skip((PageIndex - 1) * PageSize).Take(PageSize)).ToList();

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

                //paging... (LINQ)
                IEnumerable ien = null;
                ien = result.DefaultIfEmpty();
                return ien;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                return null;
            }
        }
Beispiel #7
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;
            }
        }
Beispiel #8
0
 public void getdbfml(int fmlid)
 {
     ResultDataManagerDataContext en = new ResultDataManagerDataContext();
     List<datainfo> res = (from tmp in en.DocdbDocInfo
                          where tmp.CPIC == fmlid
                          select new datainfo()
                          {
                              id  = tmp.ID,
                              pn = tmp.PubID,
                              an = tmp.AppNo,
                              pr = tmp.PR
                          }).ToList<datainfo>();
     this.fmlSource = res;
     foreach (var tmp in fmlSource)
     {
         if (tmp.pr.Trim() == "") continue;
         tmp.pr = tmp.pr.Replace(tmp.an,"");
     }
 }
Beispiel #9
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="lstNo"></param>
        /// <returns></returns>
        private List<GeneralDataInfo> GetResultListDataInfo(List<int> lstNo)
        {
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();
                Table<CnGeneral_Info> tbCnDocInfo = db.CnGeneral_Info;

                var result = from item in tbCnDocInfo
                             where lstNo.Contains(Convert.ToInt32(item.SerialNo))
                             orderby item.SerialNo descending
                             select new GeneralDataInfo
                             {
                                 StrTI = item.Title,
                                 //AN = item.ApNo,
                                 StrAN = string.Format("{0}.{1}", item.ApNo.Trim(), CnAppLicationNo.getValidCode(item.ApNo)), //add by xiwl
                                 StrPtCode = UrlParameterCode_DE.encrypt(item.ApNo.Trim()),  //add by xiwl
                                 StrAD = item.ApDate,
                                 StrIPC = item.Ipc1,
                                 StrTrsTI = item.titleen,
                                 //OAN = item.Old_ApNo,
                                 NCPIC = item.SerialNo, //add by wsx-->up by xiwl on 20120315 id>CPIC
                                 NID=item.SerialNo,
                             };

                //paging... (LINQ)
                //IEnumerable ien = result.Skip((PageNumber - 1) * PageSize).Take(PageSize);
                List<GeneralDataInfo> ien = result.ToList<GeneralDataInfo>();
                return ien;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                return null;
            }
        }
Beispiel #10
0
        /// <summary>
        /// 中国专利检索
        /// </summary>
        /// <param name="lstNo"></param>
        /// <returns></returns>
        private List<xmlDataInfo> GetCNResult(List<int> lstNo)
        {
            List<xmlDataInfo> lstxml = new List<xmlDataInfo>();
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();
                Table<CnGeneral_Info> tbCnDocInfo = db.CnGeneral_Info;

                var result = from item in tbCnDocInfo
                             where lstNo.Contains(Convert.ToInt32(item.SerialNo))
                             orderby item.SerialNo descending
                             select new xmlDataInfo
                             {
                                 StrTitle = item.Title,
                                 StrApNo = item.ApNo.Trim(),
                                 StrApDate = item.ApDate,
                                 StrANX = UrlParameterCode_DE.encrypt(item.ApNo.Trim()),  //add by xiwl
                                 StrMainIPC = item.Ipc1,
                                 StrSerialNo = item.SerialNo.ToString(),
                                 //StrFtUrl = string.Format("http://202.106.92.181/cprs2010/comm/getimg.aspx?idx={0}&Ty=CNG", UrlParameterCode_DE.encrypt(item.ApNo.Trim())),
                                 CPIC = item.SerialNo.ToString(),
                                 ZLNl=item.zlnl.ToString(),
                             };

                lstxml = result.ToList();
                //循环读取对应的XML补充其它字段数据信息
                foreach (var item in lstxml)
                {
                    UpdateByCnXmlFile(item, true);
                }

            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
            }
            return lstxml;
        }
Beispiel #11
0
        private List<xmlDataInfo> GetCNRestulAge(List<int> lstNo)
        {
            List<xmlDataInfo> lstxml = new List<xmlDataInfo>();
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();
                Table<CnGeneral_Info> tbCnDocInfo = db.CnGeneral_Info;

                var result = from item in tbCnDocInfo
                             where lstNo.Contains(Convert.ToInt32(item.SerialNo))
                             orderby item.SerialNo descending
                             select new xmlDataInfo
                             {
                                 StrApNo = item.ApNo.Trim(),

                                 ZLNl = item.zlnl.ToString(),
                             };

                lstxml = result.ToList();

            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
            }
            return lstxml;
        }
Beispiel #12
0
        /// <summary>
        /// 获取同组专利的公开号 xxt20130606
        /// </summary>
        /// <param name="PubNo">公开号</param>
        /// <returns>同组专利的公开号,不包含本身</returns>
        public string GetTongZu(string PubNo)
        {
            ResultDataManagerDataContext db = new ResultDataManagerDataContext();
            Table<DocdbDocInfo> tbDocdbInfo = db.DocdbDocInfo;

            string pubNos = "";

            var result = from item in tbDocdbInfo
                         where item.PubID.Equals(PubNo)
                         select item.CPIC;

            pubNos = GetTongZu(PubNo, result.First().Value.ToString(), 0);
            return pubNos;
        }
Beispiel #13
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<GeneralDataInfo> GetResultFmlListDataInfo(List<int> _lstNo, int PageSize, int PageIndex, string SortExpression)
        {
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();
                Table<DocdbFamilyInfo> tbCnDocInfo = db.DocdbFamilyInfo;

                ResultServices res = new ResultServices();
                List<int> lstNo = (_lstNo.Skip((PageIndex - 1) * PageSize).Take(PageSize)).ToList();

                var result = from item in tbCnDocInfo
                             where lstNo.Contains(Convert.ToInt32(item.CPIC))
                             select new GeneralDataInfo
                             {
                                 NCPIC = item.CPIC,
                                 StrTI = item.Title,
                                 StrAN = item.AppNo,
                                 StrAD = item.AppDate,
                                 StrIPC = item.IPC,
                                 NMembers = item.PubIDs.Length - (item.PubIDs.Replace(",", "").Length) + 1,//PIDNum = item.PubIDNum,
                                 //PubIds=item.PubIDs,
                                 //PubID = item.PubIDs.Contains(",") ? item.PubIDs.Substring(0, item.PubIDs.IndexOf(",")) : item.PubIDs,
                             };

                //paging... (LINQ)
                //IEnumerable ien = result.Skip((PageIndex - 1) * PageSize).Take(PageSize);
                List<GeneralDataInfo> ien = result.ToList<GeneralDataInfo>();
                return ien;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                return null;
            }
        }
Beispiel #14
0
        /// <summary>
        /// 获取指定公开的的数据
        /// </summary>
        /// <param name="PageSize">每页数据</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="LsPubs">公开号</param>
        /// <returns></returns>
        public List<GeneralDataInfo> GetRstDetailListDataInfo(int PageSize, int PageIndex, List<string> LsPubs)
        {
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();

                Table<DocdbDocInfo> tbDocDocInfo = db.DocdbDocInfo;

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

                string strPubIds = String.Join(",", LsPubs.ToArray());
                var result = from item in tbDocDocInfo
                             where LsPubs.Contains(item.PubID)
                             orderby strPubIds.IndexOf(item.PubID)
                             select new GeneralDataInfo
                             {
                                 StrAN = item.AppNo,
                                 StrAD = item.AppDate,
                                 StrIPC = item.IPC.Substring(0, 50),
                                 StrPubID = item.PubID,
                                 StrPtCode = UrlParameterCode_DE.encrypt(item.PubID),
                                 StrTI = item.Title,
                             };

                //paging... (LINQ)
                List<GeneralDataInfo> ien = result.Skip((PageIndex - 1) * PageSize).Take(PageSize).ToList<GeneralDataInfo>();
                //IEnumerable ien = result.DefaultIfEmpty();
                return ien;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                return null;
            }
        }
Beispiel #15
0
        // add by zhangqiuyi 获取世界专利指定类型引证文献信息
        public string GetEnCitedWithSrepPhase(string strPubX, string srepPhase, string type)
        {
            string strRefDoc = "";
            string PubNo = UrlParameterCode_DE.DecryptionAll(strPubX);
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();
                Table<DocdbDocInfo> tbDocDocInfo = db.DocdbDocInfo;

                var result = from item in tbDocDocInfo
                             where item.PubID == PubNo
                             orderby item.ID descending
                             select new xmlDataInfo
                             {
                                 StrTitle = item.Title,
                                 StrApNo = item.AppNo,
                                 StrApDate = item.AppDate,
                                 StrANX = strPubX,
                                 StrIpc = item.IPC.Substring(0, 50),
                                 StrPubNo = item.PubID,
                                 CPIC = item.CPIC.ToString(),
                                 StrSerialNo = item.ID.ToString(),
                             };

                xmlDataInfo resXmlInfo = result.First();

                XmlParser xmlParser = new XmlParser("", "UTF-8");
                DocDBIndexExtract docDBIndexExtract = new DocDBIndexExtract(xmlParser);
                String xmlContent = getEnMainXmlContent(resXmlInfo.StrPubNo);
                if (!xmlContent.Contains("exch:"))
                {
                    docDBIndexExtract.exch = "";
                }

                using (StringReader xmlString = new StringReader(xmlContent))
                {
                    using (XmlReader reader = XmlReader.Create(xmlString, xmlParser.Settings, xmlParser.Context))
                    {
                        XDocument xRoot = XDocument.Load(reader, LoadOptions.None);

                        if (type.Equals("not"))
                            strRefDoc = docDBIndexExtract.getCitedNotContain(xRoot, srepPhase);
                        else
                            strRefDoc = docDBIndexExtract.getCited(xRoot, srepPhase);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
            }

            if (strRefDoc.Equals(""))
            {
                return "暂无数据";
            }
            return strRefDoc;
        }
Beispiel #16
0
        /// <summary>
        /// 根据加密申请号获取著录项目数据信息
        /// </summary>
        /// <param name="AppNoX"></param>
        /// <returns></returns>
        public xmlDataInfo GetCnxmlDataInfo(string AppNoX)
        {
            string AppNo = UrlParameterCode_DE.DecryptionAll(AppNoX);
            xmlDataInfo resXmlInfo = null;
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();
                Table<CnGeneral_Info> tbCnDocInfo = db.CnGeneral_Info;

                var result = from item in tbCnDocInfo
                             where item.ApNo.Equals(AppNo)
                             select new xmlDataInfo
                             {
                                 StrTitle = item.Title,
                                 StrApNo = item.ApNo.Trim(),
                                 StrApDate = item.ApDate,
                                 StrANX = UrlParameterCode_DE.encrypt(item.ApNo.Trim()),  //add by xiwl
                                 StrMainIPC = item.Ipc1,
                                 StrSerialNo = item.SerialNo.ToString(),
                                 //StrFtUrl = string.Format("http://202.106.92.181/cprs2010/comm/getimg.aspx?idx={0}&Ty=CNG", UrlParameterCode_DE.encrypt(item.ApNo.Trim())),
                                 CPIC = item.SerialNo.ToString(),
                             };

                resXmlInfo = result.First();
                UpdateByCnXmlFile(resXmlInfo, false);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
            }
            return resXmlInfo;
        }
Beispiel #17
0
        /// <summary>
        /// 获取同组专利的公开号 xxt20130606
        /// </summary>
        /// <param name="PubNo">公开号</param>
        /// <returns>同组专利的公开号,不包含本身</returns>
        private string GetTongZu(string PubNo, string CPIC, int nTopN)
        {
            ResultDataManagerDataContext db = new ResultDataManagerDataContext();
            Table<DocdbDocInfo> tbDocdbInfo = db.DocdbDocInfo;

            string pubNos = "";

            var result = from item in tbDocdbInfo
                         where item.CPIC.Equals(CPIC) && item.PubID != PubNo
                         select item.PubID;

            if (nTopN > 0)
            {
                result = result.Take(nTopN);
            }
            foreach (var pub in result)
            {
                pubNos = pubNos + pub + ";";
            }
            pubNos = pubNos.TrimEnd(';');
            return pubNos;
        }
Beispiel #18
0
        /// <summary>
        /// 获取公开号
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="_strsFamilyID"></param>
        /// <returns></returns>
        private List<string> getPubId(int PageSize, int PageIndex, string _strsFamilyID, List<string> _LststrTopFiledId, string _strTopFiledType)
        {
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();

                Table<DocdbDocInfo> tbDocDocInfo = db.DocdbDocInfo;

                var result = from item in tbDocDocInfo
                             where item.CPIC.Equals(_strsFamilyID)
                             select new
                             {
                                 PubID = item.PubID,
                                 TopId = OrderbyTopPubId(item, _LststrTopFiledId, _strTopFiledType)
                             };

                var resultOrdby = from item in result.ToList()
                                  orderby item.TopId, item.PubID
                                  select item;

                //paging... (LINQ)
                var skpResult = resultOrdby.Skip((PageIndex - 1) * PageSize).Take(PageSize);
                //IEnumerable ien = result.DefaultIfEmpty();

                List<string> LsPubs = new List<string>();
                foreach (var item in skpResult)
                {
                    LsPubs.Add(item.PubID);
                }

                //如果取不到申请号,通过tbDocdbFamilyInfo表中的pubIDS取-----------------
                if (LsPubs.Count == 0)
                {
                    Table<DocdbFamilyInfo> tbDocdbFamilyInfo = db.DocdbFamilyInfo;

                    var result2 = from item in tbDocdbFamilyInfo
                                  where _strsFamilyID.Equals(item.CPIC)
                                  select new
                                  {
                                      PubIds = item.PubIDs,
                                  };
                    var result22 = from item in result2.First().PubIds.Split(',').ToList()
                                   select new
                                   {
                                       PubID = item,
                                       TopId = 1
                                   };

                    //paging... (LINQ)
                    var skpResult2 = result22.Skip((PageIndex - 1) * PageSize).Take(PageSize);
                    //IEnumerable ien = result.DefaultIfEmpty();
                    foreach (var item in skpResult2)
                    {
                        LsPubs.Add(item.PubID);
                    }
                }

                return LsPubs;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                return null;
            }
        }
Beispiel #19
0
        /// <summary>
        /// 获取公开号
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="_strsFamilyID"></param>
        /// <returns></returns>
        private List<string> getPubId(int PageSize, int PageIndex, string _strsFamilyID)
        {
            return getPubId(PageSize, PageIndex, _strsFamilyID, new List<string>(), "");

            #region 关闭代码
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();

                Table<DocdbDocInfo> tbDocDocInfo = db.DocdbDocInfo;

                var result = from item in tbDocDocInfo
                             where item.CPIC.Equals(_strsFamilyID)
                             orderby item.PubID
                             select new
                             {
                                 //AN = item.AppNo,
                                 //AD = item.AppDate,
                                 //IPC = item.IPC.Substring(0, 50),
                                 PubID = item.PubID,
                                 //Ti = item.Title,
                             };

                //paging... (LINQ)
                var ien = result.Skip((PageIndex - 1) * PageSize).Take(PageSize);

                List<string> LsPubs = new List<string>();
                foreach (var item in ien)
                {
                    LsPubs.Add(item.PubID);
                }

                return LsPubs;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                return null;
            }
            #endregion
        }
Beispiel #20
0
        /// <summary>
        /// 世界专利检索 xxt 20130607添加
        /// </summary>
        /// <param name="lstNo"></param>
        /// <param name="DBType"></param>
        /// <returns></returns>
        public List<xmlDataInfo> GetResult(List<int> lstNo, string DBType)
        {
            if (string.IsNullOrEmpty(DBType) || DBType.ToUpper().Equals("CN"))
            {
                return GetCNResult(lstNo);
            }

            List<xmlDataInfo> lstxml = new List<xmlDataInfo>();
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();
                Table<DocdbDocInfo> tbDocDocInfo = db.DocdbDocInfo;

                var result = from item in tbDocDocInfo
                             where lstNo.Contains(item.ID)
                             orderby item.ID descending
                             select new xmlDataInfo
                             {
                                 CPIC = item.CPIC.ToString(),
                                 StrTitle = item.Title,
                                 StrApNo = item.AppNo,
                                 StrApDate = item.AppDate,
                                 StrANX = UrlParameterCode_DE.encrypt(item.PubID.Trim()),
                                 StrIpc = item.IPC.Substring(0, 50),
                                 StrPubNo = item.PubID,
                                 StrSerialNo = item.ID.ToString(),
                             };

                lstxml = result.ToList();
                //循环读取对应的XML补充其它字段数据信息
                foreach (var item in lstxml)
                {
                    UpdateByEnXmlFile(item, false);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
            }

            return lstxml;
        }
Beispiel #21
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="lstNo"></param>
        /// <returns></returns>
        private IEnumerable GetResult(List<int> lstNo)
        {
            try
            {
                ResultDataManagerDataContext db = new ResultDataManagerDataContext();
                Table<CnGeneral_Info> tbCnDocInfo = db.CnGeneral_Info;

                var result = from item in tbCnDocInfo
                             where lstNo.Contains(Convert.ToInt32(item.SerialNo))
                             orderby item.SerialNo descending
                             select new xmlDataInfo
                             {
                                 StrTitle = item.Title,
                                 StrApNo = item.ApNo,
                                 StrApDate = item.ApDate,
                                 StrANX = UrlParameterCode_DE.encrypt(item.ApNo.Trim()),  //add by xiwl
                                 StrIpc = item.Ipc1,
                                 StrSerialNo = item.SerialNo.ToString(),
                                 StrFtUrl = string.Format("http://search.patentstar.com.cn/bns/comm/getimg.aspx?idx={0}&Ty=CNG", UrlParameterCode_DE.encrypt(item.ApNo)),
                                 CPIC = item.SerialNo.ToString(),
                             };

                XmlParser xmlParser = new XmlParser("", "GB2312");
                CnIndexExtract cnIndexExtract = new CnIndexExtract();
                List<xmlDataInfo> lstxml = new List<xmlDataInfo>();
                //循环读取对应的XML补充其它字段数据信息
                foreach (var item in result)
                {
                    item.StrApNo = "198710002005";
                    String xmlpath = cnDataService.getAbsXmlFile(item.StrApNo);
                    // String xmlContent = FileChoose.EncryptString(System.IO.File.ReadAllText(xmlpath, System.Text.Encoding.GetEncoding("gb2312")), FileChoose.key);
                    using (StreamReader xmlreader = new StreamReader(xmlpath, Encoding.GetEncoding("gb2312")))
                    {
                        String xmlContent = xmlreader.ReadToEnd();
                        xmlContent = Util.StringUtil.ReplaceLowOrderASCIICharacters(xmlContent);
                        using (StringReader xmlString = new StringReader(xmlContent))
                        {
                            using (XmlReader reader = XmlReader.Create(xmlString, xmlParser.Settings, xmlParser.Context))
                            {
                                XDocument xRoot = XDocument.Load(reader, LoadOptions.None);
                                item.StrApNo = string.Format("{0}.{1}", item.StrApNo.Trim(), CnAppLicationNo.getValidCode(item.StrApNo)); //add by xiwl;
                                item.StrAgency = cnIndexExtract.getAgency(xRoot);
                                item.StrAnnDate = cnIndexExtract.getAnnouncementDate(xRoot);
                                item.StrAnnNo = cnIndexExtract.getAnnouncementNo(xRoot);
                                item.StrApply = cnIndexExtract.getApply(xRoot);
                                item.StrCountryCode = cnIndexExtract.getProvinceCode(xRoot);
                                item.StrFiled = cnIndexExtract.getField(xRoot);
                                item.StrInventor = cnIndexExtract.getInventor(xRoot);
                                item.StrPri = cnIndexExtract.getPriorNo(xRoot);
                                item.StrPubDate = getPubApdDate(cnIndexExtract.getPublicDate(xRoot), cnIndexExtract.getAnnouncementDate(xRoot));
                                item.StrPubNo = getPubApdNo(cnIndexExtract.getPublicNo(xRoot), cnIndexExtract.getAnnouncementNo(xRoot));
                                item.StrAbstr = cnIndexExtract.getAbstract(xRoot).Length >= 140 ? cnIndexExtract.getAbstract(xRoot).Substring(0, 140) : string.IsNullOrEmpty(cnIndexExtract.getAbstract(xRoot)) ? "无" : cnIndexExtract.getAbstract(xRoot);
                                item.StrClaim = cnIndexExtract.getMainClaim(xRoot);
                                item.Brief = GetBriefInfo(item.StrApNo);
                            }
                        }
                    }
                    lstxml.Add(item);
                }

                //paging... (LINQ)
                //IEnumerable ien = result.Skip((PageNumber - 1) * PageSize).Take(PageSize);
                IEnumerable ien = lstxml.DefaultIfEmpty();
                return ien;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                return null;
            }
        }