예제 #1
0
 private void btnQuery_Click(object sender, EventArgs e)
 {
     if (this.btnQuery.Text == "重置条件")
     {
         this.groupBox1.Enabled = true;
         this.btnQuery.Text     = "查询";
         txtIdNum.Text          = "";
         tbAddr.Text            = "";
         dtpSt.Text             = "";
         dtpEd.Text             = "";
         dtpCreatedDateSt.Text  = "";
         dtpCreatedDateEd.Text  = "";
     }
     else if (this.ckCheckDate.Checked && (this.dtpSt.Value.Date > this.dtpEd.Value.Date))
     {
         MessageBox.Show(" 体检日期:开始日期大于结束日期!", "日期错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
     else if (this.ckxCreatedDate.Checked && (this.dtpCreatedDateSt.Value.Date > this.dtpCreatedDateEd.Value.Date))
     {
         MessageBox.Show(" 建档日期:开始日期大于结束日期!", "日期错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
     else
     {
         this.btnQuery.Enabled  = false;
         string where           = this.GetWhere();
         this.lbTotalCount.Text = "";
         if (string.IsNullOrEmpty(where))
         {
             MessageBox.Show("请选择查询条件!", "查询条件", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.btnQuery.Enabled = true;
         }
         else
         {
             TypeBBLL archive_baseinfo = new TypeBBLL();
             this.totalCount        = archive_baseinfo.GetRecordCount(where);
             this.totalPages        = (this.totalCount <= this.pageCount) ? 1 : ((this.totalCount / this.pageCount) + (((this.totalCount % this.pageCount) > 0) ? 1 : 0));
             this.currentPage       = 0;
             this.lbTotalCount.Text = string.Format("共计{0}条", this.totalCount.ToString());
             DataSet ds = archive_baseinfo.GetListByPage(where, "", 0, this.pageCount);
             this.lbPages.Text = string.Format("{0}/{1}页", this.currentPage + 1, this.totalPages);
             if (ds.Tables.Count > 0)
             {
                 this.TransDs(ds);
                 this.bds.DataSource     = ds.Tables[0];
                 this.dgvData.DataSource = this.bds;
             }
             else
             {
                 this.dgvData.DataSource = null;
             }
             this.groupBox1.Enabled = false;
             this.btnQuery.Enabled  = true;
             this.btnQuery.Text     = "重置条件";
         }
     }
 }
예제 #2
0
        private void TransDs(DataSet ds)
        {
            ds.Tables[0].Columns.Add("MIDName");
            TypeBBLL recordsEcgBll = new TypeBBLL();

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                row["CustomerName"] = row["CustomerName"].ToString().Trim();
                row["Sex"]          = !(row["Sex"].ToString() == "1") ? "女" : "男";
                row["Nation"]       = !(row["Nation"].ToString() == "1") ? row["MINORITY"] : "汉";
                row["MIDName"]      = row["MID"].ToString() == "" ? "" : "B超";
            }
        }
예제 #3
0
 private void btnNext_Click(object sender, EventArgs e)
 {
     if (this.currentPage < (this.totalPages - 1))
     {
         this.lbPages.Text = string.Format("{0}/{1}页", ++this.currentPage + 1, this.totalPages);
         DataSet ds = new TypeBBLL().GetListByPage(this.GetWhere(), "", this.currentPage * this.pageCount, this.pageCount);
         if (ds.Tables.Count > 0)
         {
             this.TransDs(ds);
             this.bds.DataSource     = ds.Tables[0];
             this.dgvData.DataSource = this.bds;
         }
     }
 }