private void chkDeath_CheckedChanged(object sender, EventArgs e) //heyan   [20100720.1.12]
 {
     if (chkDeath.Checked)
     {
         if (dtAllOutPat == null)
         {
             dtAllOutPat = PatientRpt.GetOutPatinetData(this.cbDept.SelectedValue.ToString(), this.dateTimePicker1.Value, this.dateTimePicker2.Value);
         }
         if (dtAllOutPat == null || dtAllOutPat.Rows.Count == 0)
         {
             return;
         }
         DataTable dt   = dtAllOutPat.Clone();
         DataRow[] rows = dtAllOutPat.Select("out_flag=3");
         dt.Clear();
         for (int i = 0; i < rows.Length; i++)
         {
             dt.Rows.Add(rows[i].ItemArray);
         }
         if (dt.Rows.Count > 0)
         {
             DataRow dr = dt.NewRow();
             dr["cureno"]       = "合计";
             dr["patname"]      = "共" + dt.Rows.Count + "人";
             dr["total_fee"]    = dt.Compute("sum(total_fee)", "");
             dr["DEPTOSIT_FEE"] = dt.Compute("sum(DEPTOSIT_FEE)", "");
             dr["REALITY_FEE"]  = dt.Compute("sum(REALITY_FEE)", "");
             dr["VILLAGE_FEE"]  = dt.Compute("sum(VILLAGE_FEE)", "");
             dr["FAVOR_FEE"]    = dt.Compute("sum(FAVOR_FEE)", "");
             dt.Rows.Add(dr);
         }
         dgvData.DataSource = dt;
     }
     else
     {
         dgvData.DataSource = dtAllOutPat;
     }
 }
 private void button1_Click(object sender, EventArgs e)
 {
     this.dgvData.DataSource = PatientRpt.GetOutPatinetData(this.cbDept.SelectedValue.ToString(), this.dateTimePicker1.Value, this.dateTimePicker2.Value);
     dtAllOutPat             = (DataTable)dgvData.DataSource;
 }