Example #1
0
        /// <summary>
        /// 得到数据
        /// </summary>
        public void ReadDataTable()
        {
            switch (_type)
            {
            case CSPNType.WellInfo:
                table = wellInfoService.GetWellInfo_Table(_info, pageSize, pageIndex, out recorderCount);
                break;

            case CSPNType.SysLogInfo:
                table = logservice.GetSystemLogInfo(pageSize, pageIndex, out recorderCount);
                break;

            case CSPNType.UserLogInfo_WellInfo:
                table = logservice.GetUserLogInfo_WellInfo(pageSize, pageIndex, out recorderCount);
                break;

            case CSPNType.UserLogInfo_GeneralInfo:
                table = logservice.GetUserLogInfo_GeneralInfo(pageSize, pageIndex, out recorderCount);
                break;

            case CSPNType.MaintainInfo:
                table = wellStateService.GetMaintainInfo(pageSize, pageIndex, out recorderCount);
                break;

            case CSPNType.OperatorInfo:
                table = userservice.GetOperator_Table(pageSize, pageIndex, out recorderCount);
                break;

            case CSPNType.UserInfo:
                table = userservice.GetUserInfo_Table(pageSize, pageIndex, out recorderCount);
                break;
            }
            //--控制
            lbPageSize.Text  = "每页" + pageSize.ToString() + "条";
            lbPageCount.Text = "/共" + PageCount.ToString() + "页";
            tbPageIndex.Text = pageIndex.ToString();
            btnLast.Tag      = PageCount;

            if (PageCount > 1 && PageCount > pageIndex)
            {
                btnNext.Enabled = true;
                btnLast.Enabled = true;
            }
            else
            {
                btnNext.Enabled = false;
                btnLast.Enabled = false;
            }

            if (pageIndex > 1 && pageIndex <= PageCount)
            {
                btnFirst.Enabled = true;
                btnPrev.Enabled  = true;
            }
            else
            {
                btnFirst.Enabled = false;
                btnPrev.Enabled  = false;
            }
            _grid.DataSource = table;
            table.Dispose();
        }