private void butIn_Click(object sender, System.EventArgs e) { if (m.bInchidinh_dien) { foreach (DataRow r in ds.Tables[0].Select("chon=true")) { DLLPrintchidinh.frmPrintchidinh f1 = new DLLPrintchidinh.frmPrintchidinh(); f1.f_Print_Chidinh(false, r["mabn"].ToString(), r["maql"].ToString(), "", ngay.Text.Substring(0, 10), ""); m.execute_data("update " + xxx + ".v_chidinh set lan=lan+1 where mabn='" + r["mabn"].ToString() + "' and to_char(ngay,'dd/mm/yyyy')='" + ngay.Text + "' and loai=2 and makp='" + r["ghichu"].ToString() + "'"); } } else { dsxml.Clear(); string sid = ""; foreach (DataRow r in ds.Tables[0].Select("chon=true")) { sid += r["id"].ToString() + ","; sql = "update " + xxx + ".v_chidinh set lan=lan+1 where id=" + decimal.Parse(r["id"].ToString()); m.execute_data(sql); } if (sid == "") { MessageBox.Show(lan.Change_language_MessageText("Đề nghị chọn bệnh nhân !"), LibMedi.AccessData.Msg); try { mabn.Focus(); } catch {} return; } in_toa(sid); if (dsxml.Tables[0].Rows.Count > 0) { if (chkXem.Checked) { dllReportM.frmReport f = new dllReportM.frmReport(m, dsxml, "", "rptChidinh.rpt", true); f.ShowDialog(); } else { print.Printer(m, dsxml, "rptChidinh.rpt", "", 1); } } else { MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), LibMedi.AccessData.Msg); } } butTim_Click(sender, e); }
private void bieu_04(bool prn) { string smakp = "'", stenkp = ""; if (makp.CheckedItems.Count > 0) { for (int i = 0; i < makp.Items.Count; i++) { if (makp.GetItemChecked(i)) { smakp += dtkp.Rows[i]["makp"].ToString().Trim() + "','"; stenkp += dtkp.Rows[i]["tenkp"].ToString().Trim() + ";"; } } } if (s_makp != "") { string[] ss_makp = s_makp.Split(','); string temp_makp = ""; for (int i = 0; i < ss_makp.Length - 1; i++) { temp_makp += "'" + ss_makp[i].ToString() + "',"; } s_makp = temp_makp; } s_makp = (smakp.Length > 1) ? smakp.Substring(0, smakp.Length - 1) : s_makp; s_tenkp = (stenkp != "")?stenkp.Substring(0, stenkp.Length - 1):s_tenkp; string tit = (s_tenkp != "")?title + " " + s_tenkp:title; ds = e.bieu_04_khoa(s_makp, s_tu, s_tu1, s_den, s_table, i_loaiba, time.Checked); if (m.getrowbyid(ds.Tables[0], "c01+c02+c03+c04+c05+c06+c07+c08+c09+c10>0") == null) { MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), LibMedi.AccessData.Msg); } else { if (prn) { p.Printer(m, ds, "bieu_04.rpt", tit.ToUpper(), 2); } else { dllReportM.frmReport f = new dllReportM.frmReport(m, ds, tit.ToUpper(), "bieu_04.rpt"); f.ShowDialog(this); } } }
private void bieu_11(bool prn) { ds = e.bieu_11_khoa(s_tu, s_tu1, s_den, s_table, s_makp, phatsinh.Checked, time.Checked); string tenfile = (m.Mabv.Substring(0, 3) == "701")?"bieu_11_18.rpt":"bieu_11.rpt"; if (m.getrowbyid(ds.Tables[0], "c01+c02+c03+c04+c05+c06+c07+c08+c09+c10+c11+c12>0") == null) { MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), LibMedi.AccessData.Msg); } else { if (prn) { p.Printer(m, ds, tenfile, title.ToUpper(), 2); } else { dllReportM.frmReport f = new dllReportM.frmReport(m, ds, title.ToUpper(), tenfile); f.ShowDialog(this); } } }
private void butOk_Click(object sender, EventArgs e) { if (dt.Select("chon=true").Length == 0) { MessageBox.Show(lan.Change_language_MessageText("Chọn danh sách cần in ?"), LibMedi.AccessData.Msg); dataGrid1.Focus(); return; } dsnhan.Clear(); DataRow r; DataRow[] r1 = dt.Select("chon=true", "mabn,loai,idcls"); int i = 0; string _mabn = ""; while (i < r1.Length) { _mabn = r1[i]["mabn"].ToString(); r = dsnhan.Tables[0].NewRow(); r["mabn"] = r1[i]["mabn"].ToString(); r["hoten"] = r1[i]["hoten"].ToString(); r["tuoi"] = r1[i]["tuoi"].ToString(); r["phai"] = r1[i]["phai"].ToString(); r["diachi"] = r1[i]["diachi"].ToString().Replace(lan.Change_language_MessageText("Không xác định"), ""); r["khoa"] = r1[i]["makp"].ToString(); r["ngay"] = r1[i]["ngay"].ToString(); r["idcls"] = r1[i]["idcls"].ToString(); r["bscd"] = r1[i]["bscd"].ToString().Trim().ToUpper() + "/" + r1[i]["bvcd"].ToString().Trim().ToUpper(); r["bvcd"] = ""; r["loai"] = r1[i]["loai"].ToString().Trim().ToUpper() + "." + r1[i]["vung"].ToString().Trim().ToUpper(); r["vung"] = ""; i++; if (i < r1.Length) { if (_mabn == r1[i]["mabn"].ToString()) { r["mabn"] = r1[i]["mabn"].ToString(); r["hoten"] = r1[i]["hoten"].ToString(); r["tuoi"] = r1[i]["tuoi"].ToString(); r["phai"] = r1[i]["phai"].ToString(); r["diachi"] = r1[i]["diachi"].ToString().Replace(lan.Change_language_MessageText("Không xác định"), ""); r["khoa"] = r1[i]["makp"].ToString(); r["ngay"] = r1[i]["ngay"].ToString(); r["idcls"] = r["idcls"].ToString().Trim() + "-" + r1[i]["idcls"].ToString().Trim(); if (r["bscd"].ToString().IndexOf(r["bscd"].ToString().Trim() + "-" + r1[i]["bscd"].ToString().Trim().ToUpper() + "/" + r1[i]["bvcd"].ToString().Trim().ToUpper()) != -1) { r["bscd"] = r["bscd"].ToString().Trim() + "-" + r1[i]["bscd"].ToString().Trim().ToUpper() + "/" + r1[i]["bvcd"].ToString().Trim().ToUpper(); } r["bvcd"] = ""; r["loai"] = r["loai"].ToString().Trim() + "-" + r1[i]["loai"].ToString().Trim().ToUpper() + "." + r1[i]["vung"].ToString().Trim().ToUpper(); r["vung"] = ""; i++; } else if (i < r1.Length) { _mabn = r1[i]["mabn"].ToString(); r["mabn1"] = r1[i]["mabn"].ToString(); r["hoten1"] = r1[i]["hoten"].ToString(); r["tuoi1"] = r1[i]["tuoi"].ToString(); r["phai1"] = r1[i]["phai"].ToString(); r["diachi1"] = r1[i]["diachi"].ToString().Replace(lan.Change_language_MessageText("Không xác định"), ""); r["khoa1"] = r1[i]["makp"].ToString(); r["ngay1"] = r1[i]["ngay"].ToString(); r["idcls1"] = r1[i]["idcls"].ToString(); r["bscd1"] = r1[i]["bscd"].ToString().Trim().ToUpper() + "/" + r1[i]["bvcd"].ToString().Trim().ToUpper(); r["bvcd1"] = ""; // r1[i]["bvcd"].ToString(); r["loai1"] = r1[i]["loai"].ToString().Trim().ToUpper() + "." + r1[i]["vung"].ToString().Trim().ToUpper(); r["vung1"] = ""; // r1[i]["vung"].ToString(); i++; if (i < r1.Length) { if (_mabn == r1[i]["mabn"].ToString()) { r["mabn1"] = r1[i]["mabn"].ToString(); r["hoten1"] = r1[i]["hoten"].ToString(); r["tuoi1"] = r1[i]["tuoi"].ToString(); r["phai1"] = r1[i]["phai"].ToString(); r["diachi1"] = r1[i]["diachi"].ToString().Replace(lan.Change_language_MessageText("Không xác định"), ""); r["khoa1"] = r1[i]["makp"].ToString(); r["ngay1"] = r1[i]["ngay"].ToString(); r["idcls1"] = r["idcls1"].ToString().Trim() + "-" + r1[i]["idcls"].ToString().Trim(); if (r["bscd1"].ToString().IndexOf(r["bscd1"].ToString().Trim() + "-" + r1[i]["bscd"].ToString().Trim().ToUpper() + "/" + r1[i]["bvcd"].ToString().Trim().ToUpper()) != -1) { r["bscd1"] = r["bscd1"].ToString().Trim() + "-" + r1[i]["bscd"].ToString().Trim().ToUpper() + "/" + r1[i]["bvcd"].ToString().Trim().ToUpper(); } r["bvcd1"] = ""; r["loai1"] = r["loai1"].ToString().Trim() + "-" + r1[i]["loai"].ToString().Trim().ToUpper() + "." + r1[i]["vung"].ToString().Trim().ToUpper(); r["vung1"] = ""; i++; } } } } dsnhan.Tables[0].Rows.Add(r); } if (chkXem.Checked) { dllReportM.frmReport f = new dllReportM.frmReport(m, dsnhan, "", "rptNhan.rpt", true); f.ShowDialog(); } else { print.Printer(m, dsnhan, "rptNhan.rpt", "", 1); } }