Exemple #1
0
        private void GetData()
        {
            string where = this.GetWhere();

            if (string.IsNullOrEmpty(where))
            {
                MessageBox.Show("请选择查询条件!", "查询条件", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
            else
            {
                this.btnQuery.Enabled = false;

                // 取得清单总笔数
                this.totalCount = archive_baseinfo.GetDiabeteDataCount(reqBaseCol + reqVisitCol, where + reqWhere);

                this.totalPages = (this.totalCount <= this.pageCount) ? 1 : ((this.totalCount / this.pageCount) +
                                                                             (((this.totalCount % this.pageCount) > 0) ? 1 : 0));
                this.lbTotalCount.Text = string.Format("共计{0}条", this.totalCount.ToString());

                if (this.currentPage > totalPages - 1)
                {
                    this.currentPage--;
                }

                // 清单资料
                DataTable dt = archive_baseinfo.GetDiabeteData(reqBaseCol + reqVisitCol + reqBaseTipCol + reqVisitTipCol,
                                                               where + reqWhere, "", this.currentPage * this.pageCount, this.pageCount);

                this.TransDs(dt);

                this.lbPages.Text = string.Format("{0}/{1}页", this.currentPage + 1, this.totalPages);

                this.bds.DataSource     = dt;
                this.dgvData.DataSource = this.bds;

                if (dt != null && dt.Rows.Count > 0)
                {
                    toolTipX  = this.dgvData.GetCellDisplayRectangle(8, 0, false).X;
                    toolTipX2 = this.dgvData.GetCellDisplayRectangle(9, 0, false).X;
                }

                this.groupBox1.Enabled = false;
                this.btnQuery.Enabled  = true;
                this.btnQuery.Text     = "重置条件";
            }
        }