コード例 #1
0
        public void SaveLoginLog(PKS_SearchHistory searhHistoryModel, string isStartPage)
        {
            PKS_SearchHistory searchHistory = new PKS_SearchHistory();

            searchHistory = _searchHistoryService.GetQuery().FirstOrDefault(o => o.TargetId == searhHistoryModel.TargetId);
            if (searchHistory == null)
            {
                return;
            }
            searchHistory.TargetPageNameEnum = searhHistoryModel.TargetPageNameEnum;
            searchHistory.PageResultsEnum    = searhHistoryModel.PageResultsEnum;
            TimeSpan ts = new TimeSpan();

            // DateTime startTime = Convert() searhHistoryModel.TargetTime.ToString();
            searchHistory.TargetTime = DateTime.Now;
            ts = Convert.ToDateTime(searchHistory.TargetTime) - Convert.ToDateTime(searchHistory.SourceTime);
            searchHistory.RunTime            = ts.Minutes * 60 + ts.Seconds + Convert.ToDouble(ts.Milliseconds) / 1000;
            searchHistory.TargetPageNameEnum = searhHistoryModel.TargetPageNameEnum;
            if (searhHistoryModel.TargetPageNameEnum.Equals("SearchResultDetailed"))
            {
                searchHistory.BO    = searhHistoryModel.BO;
                searchHistory.BOT   = searhHistoryModel.BOT;
                searchHistory.PT    = searhHistoryModel.PT;
                searchHistory.BP    = searhHistoryModel.BP;
                searchHistory.Iiid  = searhHistoryModel.Iiid;
                searchHistory.Title = searhHistoryModel.Title;
                //historylist.AdapterName = searhHistoryModel.AdapterName;
                searchHistory.ResourcesName   = searhHistoryModel.ResourcesName;
                searchHistory.ResourcesFormat = searhHistoryModel.ResourcesFormat;
            }
            _searchHistoryService.Update(searchHistory);
        }
コード例 #2
0
 /// <summary>
 /// 保存基本的历史记录信息
 /// </summary>
 /// <param name="searhHistoryModel">基本历史记录信息的实体模型</param>
 /// <param name="isStartPage">是否是起始页</param>
 public void SaveClickLog(PKS_SearchHistory searhHistoryModel, string isStartPage)
 {
     _searchHistoryService.Add(searhHistoryModel);
 }