コード例 #1
0
        private void DoSearch(bool searchCount = false)
        {
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                try
                {
                    Maticsoft.BLL.SMT_LOG_INFO logBll = new Maticsoft.BLL.SMT_LOG_INFO();
                    if (searchCount)
                    {
                        int count = logBll.GetRecordCount(pageDataGridView.SqlWhere);
                        this.Invoke(new Action(() =>
                        {
                            pageDataGridView.Reset();
                            pageDataGridView.PageControl.TotalRecords = count;
                        }));
                    }
                    var ds     = logBll.GetListByPage(pageDataGridView.SqlWhere, "OPR_TIME desc", pageDataGridView.PageControl.StartIndex, pageDataGridView.PageControl.EndIndex);
                    var models = logBll.DataTableToList(ds.Tables[0]);
                    this.Invoke(new Action(() =>
                    {
                        ShowModels(models);
                    }));
                }
                catch (Exception ex)
                {
                    WinInfoHelper.ShowInfoWindow(this, "查询日志异常:" + ex.Message);
                    log.Error("查询日志异常:", ex);
                }
            });

            waiting.Show(this);
        }