Пример #1
0
 public void PageUpdateLastPageNameLookupDate(int pageID)
 {
     BHLProvider bhlServer = new BHLProvider();
     bhlServer.PageUpdateLastPageNameLookupDate(pageID);
 }
        /// <summary>
        /// Uses the OCR for the page to look up any names that weren't previously identified by SciLINC
        /// </summary>
        /// <param name="itemID"></param>
        /// <param name="sequenceOrder"></param>
        private void PopulatePageNames(int pageID)
        {
            BHLProvider provider = new BHLProvider();
            Page page = provider.PageSelectAuto(pageID);
            bool doLookup = false;

            // Look up the page names if we never have for this page, or if it's been longer
            // than the maximum page name age since we've looked them up
            if (page.LastPageNameLookupDate == null)
            {
                doLookup = true;
            }
            else
            {
                TimeSpan ts = DateTime.Now.Subtract((DateTime)page.LastPageNameLookupDate);
                if (ts.Days > Convert.ToInt32(ConfigurationManager.AppSettings["MaximumPageNameAge"]))
                    doLookup = true;
            }

            if (doLookup)
            {
                FindItItem[] items = new PageSummaryService().GetUBioNames(pageID);
                provider.PageNameUpdateList(pageID, items);
                provider.PageUpdateLastPageNameLookupDate(page.PageID);
            }
        }