Exemplo n.º 1
0
        private void btndy_Click(object sender, EventArgs e)
        {
            try
            {
                //获得卡号信息
                string    sql   = "  select  kh from YY_KDJB where brxxid='" + Dqcf.brxxid + "'";
                DataTable tbPat = FrmMdiMain.Database.GetDataTable(sql);
                string    brkh  = "";
                if (tbPat.Rows.Count > 0)
                {
                    brkh = tbPat.Rows[0]["KH"].ToString();
                }
                DsJyJc.rptAPPDataTable tb = new DsJyJc.rptAPPDataTable();
                DataTable dt = (DataTable)this.control_jysq1.dataGridView1.DataSource;

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataRow dr = tb.NewRow();
                    dr["binname"]     = lblxm.Text;
                    dr["sex"]         = lblxb.Text;
                    dr["age"]         = lblnl.Text;
                    dr["yqDoc"]       = FrmMdiMain.CurrentUser.Name;
                    dr["yqDate"]      = dtpsqrq.Value;
                    dr["deptName"]    = FrmMdiMain.CurrentDept.DeptName;
                    dr["wardName"]    = FrmMdiMain.CurrentDept.DeptName;
                    dr["bedID"]       = "";
                    dr["symptom"]     = control_jysq1.richTextBoxEx1.Text.Trim();
                    dr["diagnosis"]   = control_jysq1.TextLczd.textBox1.Text.Trim(); //this.txtzd.Text.Trim();
                    dr["place"]       = cmbbw.Text;                                  //this.cmbPlace.Text.Trim();
                    dr["itemName"]    = dt.Rows[i]["name"].ToString();               // chkListBox.CheckedItems;
                    dr["inpatientid"] = lblmzh.Text;                                 // 门诊号
                    dr["price"]       = "      " + dt.Rows[i]["je"].ToString();

                    for (int j = 4; j < 7; j++)
                    {
                        dr["col" + j.ToString()] = "";
                    }
                    if (i < dt.Rows.Count - 1)
                    {
                        dr["bz"]   = "  标本名称:" + dt.Rows[i]["bbmc"].ToString();
                        dr["col3"] = "附加说明:" + dt.Rows[i]["fjsm"].ToString();
                    }


                    dr["yymc"] = (new SystemCfg(2)).Config;
                    dr["lxmc"] = "门诊病人" + this.cmbClassJC.Text.Trim() + "申请单";
                    dr["col1"] = brkh;
                    dr["col2"] = dt.Rows[i]["zxksmc"].ToString();  //cmbjcks.Text;//检查科室

                    tb.Rows.Add(dr);
                }
                string        printFile = "Mz_化验申请.rpt";
                FrmReportView rv        = new FrmReportView(tb, Constant.ApplicationDirectory + "\\report\\" + printFile, null, false);
                rv.ShowDialog();
            }
            catch (Exception ea)
            {
                MessageBox.Show("打印出现异常!原因:" + ea.Message, "提示");
            }
        }
Exemplo n.º 2
0
        private void btPrintJC_Click(object sender, EventArgs e)
        {
            //获得卡号信息
            string    sql   = "  select  kh from YY_KDJB   where brxxid='" + Dqcf.brxxid + "'";
            DataTable tbPat = FrmMdiMain.Database.GetDataTable(sql);
            string    brkh  = "";

            if (tbPat.Rows.Count > 0)
            {
                brkh = tbPat.Rows[0]["KH"].ToString();
            }
            DsJyJc.rptAPPDataTable tb = new DsJyJc.rptAPPDataTable();
            for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
            {
                DataRow dr = tb.NewRow();
                dr["binname"]  = lblxm.Text;
                dr["sex"]      = lblxb.Text;
                dr["age"]      = lblnl.Text;
                dr["yqDoc"]    = FrmMdiMain.CurrentUser.Name;
                dr["yqDate"]   = dtpsqrq.Value;
                dr["deptName"] = FrmMdiMain.CurrentDept.DeptName;
                dr["wardName"] = FrmMdiMain.CurrentDept.DeptName;
                dr["bedID"]    = "";
                //			dr["address"]=dt.Rows[0]["unit_name"];
                //			dr["tele"]=dt.Rows[0]["unit_tel"];
                dr["symptom"]     = txtbs.Text;
                dr["diagnosis"]   = this.txtzd.Text.Trim();
                dr["place"]       = cmbbw.Text;                                      //this.cmbPlace.Text.Trim();
                dr["itemName"]    = dataGridView1.Rows[i].Cells[0].Value.ToString(); // chkListBox.CheckedItems;
                dr["inpatientid"] = lblmzh.Text;                                     // 门诊号
                dr["price"]       = dataGridView1.Rows[i].Cells[2].Value.ToString();
                dr["bz"]          = "";
                dr["yymc"]        = (new SystemCfg(2)).Config;
                dr["lxmc"]        = "门诊病人" + this.cmbClassJC.Text.Trim() + "申请单";
                for (int j = 1; j < 7; j++)
                {
                    dr["col" + j.ToString()] = "";
                }
                dr["col1"] = brkh;
                dr["col2"] = cmbjcks.Text;//检查科室
                tb.Rows.Add(dr);
            }
            string        printFile = "Mz_检查申请.rpt";
            FrmReportView rv        = new FrmReportView(tb, Constant.ApplicationDirectory + "\\report\\" + printFile, null, false);

            rv.ShowDialog();
        }