Esempio n. 1
0
        /// <summary>
        /// 加载阅读历史列表
        /// </summary>
        public void loadViewHistoryList()
        {
            removeFromFlp(flp_viewHistory);
            List <ViewHistory> list = db.getViewHistory(viewHistoryFilter.queryParam);

            foreach (ViewHistory vh in list)
            {
                ViewHistoryListItem item = new ViewHistoryListItem();
                item.viewHistory = vh;
                item.fillViewHistory();
                item.parentForm = this;
                flp_viewHistory.Controls.Add(item);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 将阅读历史主动加到阅读历史列表中,避免再次查库。加入时,如果列表中没有相同的法规,则新增,如果有,则将其提至第一条
        /// </summary>
        /// <param name="history"></param>
        public void addHistory(ViewHistory history)
        {
            bool found = false;

            for (int i = 1; i < flp_viewHistory.Controls.Count; i++)
            {
                var tempVh = flp_viewHistory.Controls[i] as ViewHistoryListItem;
                if (tempVh.viewHistory.LawID == history.LawID)
                {
                    flp_viewHistory.Controls.SetChildIndex(tempVh, 1);
                    found = true;
                    break;
                }
            }
            if (found == false)
            {
                ViewHistoryListItem item = new ViewHistoryListItem();
                item.parentForm  = this;
                item.viewHistory = history;
                item.fillViewHistory();
                flp_viewHistory.Controls.Add(item);
                flp_viewHistory.Controls.SetChildIndex(item, 1);
            }
        }