private void btnInBenhAn_Click(object sender, EventArgs e) { btnTroLai.Visible = true; btnInBenhAn.Visible = false; expandableSplitter1.Expanded = true; groupPanel4.Visible = false; //SqlConnection cnn; //string connectionString = null; //string sql = null; //connectionString = connectData.ChuoiKetNoi(); //cnn = new SqlConnection(connectionString); //cnn.Open(); //sql = "EXEC CHITIETDONTHUOC_TENTHUOC1 '" + txtDonThuoc_MaDonThuoc.Text.ToString() + "'"; //SqlDataAdapter dscmd = new SqlDataAdapter(sql, cnn); //QLBVDataSet ds = new QLBVDataSet(); //dscmd.Fill(ds, "CHITIETDONTHUOC_TENTHUOC1"); ////MessageBox.Show(ds.Tables[1].Rows.Count.ToString()); //cnn.Close(); //rpBenhAn rp = new rpBenhAn(); //rp.Database.Tables["CHITIETDONTHUOC_TENTHUOC1"].SetDataSource(ds); //crystalReportViewer1.ReportSource = rp; //crystalReportViewer1.Refresh(); rpBenhAn rp = new rpBenhAn(); ParameterValues a = new ParameterValues(); ParameterDiscreteValue b = new ParameterDiscreteValue(); b.Value = txtBenhNhan_HoBN.Text; a.Add(b); rp.DataDefinition.ParameterFields["HoBenhNhan"].ApplyCurrentValues(a); b.Value = txtBenhNhan_TenBN.Text; a.Add(b); rp.DataDefinition.ParameterFields["TenBenhNhan"].ApplyCurrentValues(a); b.Value = txtBenhNhan_GioiTinhBN.Text; a.Add(b); rp.DataDefinition.ParameterFields["GioiTinh"].ApplyCurrentValues(a); b.Value = dtPickerBenhNhan_NgaySinhBN.Text; a.Add(b); rp.DataDefinition.ParameterFields["NgaySinh"].ApplyCurrentValues(a); b.Value = txtBenhNhan_NgheNghiep.Text; a.Add(b); rp.DataDefinition.ParameterFields["NgheNghiep"].ApplyCurrentValues(a); b.Value = txtBenhNhan_TenDoiTuong.Text; a.Add(b); rp.DataDefinition.ParameterFields["DoiTuong"].ApplyCurrentValues(a); b.Value = txtBenhNhan_DiaChiBN.Text; a.Add(b); rp.DataDefinition.ParameterFields["DiaChi"].ApplyCurrentValues(a); b.Value = txtKBenh_CanNangBN.Text; a.Add(b); rp.DataDefinition.ParameterFields["CanNang"].ApplyCurrentValues(a); b.Value = txtKBenh_NhomMauBN.Text; a.Add(b); rp.DataDefinition.ParameterFields["NhomMau"].ApplyCurrentValues(a); b.Value = txtKBenh_NhietDoBN.Text; a.Add(b); rp.DataDefinition.ParameterFields["NhietDo"].ApplyCurrentValues(a); b.Value = txtKBenh_MachBN.Text; a.Add(b); rp.DataDefinition.ParameterFields["Mach"].ApplyCurrentValues(a); b.Value = txtKBenh_HuyetApBN.Text; a.Add(b); rp.DataDefinition.ParameterFields["HuyetAp"].ApplyCurrentValues(a); b.Value = txtKBenh_NhipThoBN.Text; a.Add(b); rp.DataDefinition.ParameterFields["NhipTho"].ApplyCurrentValues(a); b.Value = txtKBenh_YeuCauKham.Text; a.Add(b); rp.DataDefinition.ParameterFields["YeuCauKham"].ApplyCurrentValues(a); b.Value = txtKBenh_TinhTrangHienTai.Text; a.Add(b); rp.DataDefinition.ParameterFields["TinhTrangHienTai"].ApplyCurrentValues(a); b.Value = txtKBenh_BenhSuBN.Text; a.Add(b); rp.DataDefinition.ParameterFields["BenhSu"].ApplyCurrentValues(a); b.Value = txtKBenh_ChuanDoanSoBo.Text; a.Add(b); rp.DataDefinition.ParameterFields["ChanDoanSoBo"].ApplyCurrentValues(a); b.Value = txtKBenh_ChuanDoanSauCung.Text; a.Add(b); rp.DataDefinition.ParameterFields["ChanDoanSauCung"].ApplyCurrentValues(a); b.Value = txtKBenh_HuongDieuTri.Text; a.Add(b); rp.DataDefinition.ParameterFields["HuongDieuTri"].ApplyCurrentValues(a); b.Value = txtDonThuoc_MaDonThuoc.Text; a.Add(b); rp.DataDefinition.ParameterFields["MaDonThuoc"].ApplyCurrentValues(a); b.Value = dtPickerDonThuoc_NgayTao.Text; a.Add(b); rp.DataDefinition.ParameterFields["NgayTao"].ApplyCurrentValues(a); b.Value = dtPickerDonThuoc_GioTao.Text; a.Add(b); rp.DataDefinition.ParameterFields["GioTao"].ApplyCurrentValues(a); b.Value = txtDonThuoc_HoBS.Text; a.Add(b); rp.DataDefinition.ParameterFields["HoBacSiDonThuoc"].ApplyCurrentValues(a); b.Value = txtDonThuoc_TenBS.Text; a.Add(b); rp.DataDefinition.ParameterFields["TenBacSiDonThuoc"].ApplyCurrentValues(a); if (txtXetNghiem_MaPhongXN.Text.ToString() != "") { b.Value = txtXetNghiem_TenPhongXN.Text; a.Add(b); rp.DataDefinition.ParameterFields["PhongXN"].ApplyCurrentValues(a); b.Value = txtXetNghiem_MaPhieuXN.Text; a.Add(b); rp.DataDefinition.ParameterFields["PhieuXetNghiem"].ApplyCurrentValues(a); b.Value = txtXetNghiem_YeuCauXN.Text; a.Add(b); rp.DataDefinition.ParameterFields["YeuCauXetNghiem"].ApplyCurrentValues(a); b.Value = txtXetNghiem_KetLuan.Text; a.Add(b); rp.DataDefinition.ParameterFields["KetLuan"].ApplyCurrentValues(a); b.Value = txtXetNghiem_DeNghi.Text; a.Add(b); rp.DataDefinition.ParameterFields["DeNghi"].ApplyCurrentValues(a); } else { b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["PhongXN"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["PhieuXetNghiem"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["YeuCauXetNghiem"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["KetLuan"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["DeNghi"].ApplyCurrentValues(a); } if (txtXQuang_MaPhieuXQ.Text.ToString() != "") { b.Value = txtXQuang_TenPhongXQ.Text; a.Add(b); rp.DataDefinition.ParameterFields["TenPhongXquang"].ApplyCurrentValues(a); b.Value = txtXQuang_MaPhieuXQ.Text; a.Add(b); rp.DataDefinition.ParameterFields["MaPhieuChup"].ApplyCurrentValues(a); b.Value = txtXQuang_MoTaAnh.Text; a.Add(b); rp.DataDefinition.ParameterFields["MoTaHinhAnh"].ApplyCurrentValues(a); b.Value = txtXQuang_KetLuan.Text; a.Add(b); rp.DataDefinition.ParameterFields["KetLuanXquang"].ApplyCurrentValues(a); b.Value = txtXQuang_DeNghi.Text; a.Add(b); rp.DataDefinition.ParameterFields["DeNghiXquang"].ApplyCurrentValues(a); } else { b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["TenPhongXquang"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["MaPhieuChup"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["MoTaHinhAnh"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["KetLuanXquang"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["DeNghiXquang"].ApplyCurrentValues(a); } if (txtNhapVien_MaNV.Text.ToString() != "") { b.Value = dtPickerNhapVien_NgayNV.Text; a.Add(b); rp.DataDefinition.ParameterFields["NgayNhapVien"].ApplyCurrentValues(a); b.Value = txtNhapVien_KetQuaCD.Text; a.Add(b); rp.DataDefinition.ParameterFields["KetQuaChanDoan"].ApplyCurrentValues(a); b.Value = txtNhapVien_PPDieuTri.Text; a.Add(b); rp.DataDefinition.ParameterFields["PPDieuTri"].ApplyCurrentValues(a); } else { b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["NgayNhapVien"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["KetQuaChanDoan"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["PPDieuTri"].ApplyCurrentValues(a); } if (txtTheoDoi_MaTheoDoi.Text.ToString() != "") { b.Value = txtPhongBenh_TenPB.Text; a.Add(b); rp.DataDefinition.ParameterFields["PhongBenh"].ApplyCurrentValues(a); b.Value = txtPhongBenh_MaGiuongBenh.Text; a.Add(b); rp.DataDefinition.ParameterFields["GiuongBenh"].ApplyCurrentValues(a); b.Value = txtPhongBenh_HoBS.Text; a.Add(b); rp.DataDefinition.ParameterFields["HoBSPhuTrach"].ApplyCurrentValues(a); b.Value = txtPhongBenh_TenBS.Text; a.Add(b); rp.DataDefinition.ParameterFields["TenBSPhuTrach"].ApplyCurrentValues(a); b.Value = txtPhongBenh_HoYT.Text; a.Add(b); rp.DataDefinition.ParameterFields["HoYTPhuTrach"].ApplyCurrentValues(a); b.Value = txtPhongBenh_HoYT.Text; a.Add(b); rp.DataDefinition.ParameterFields["TenYTPhuTrach"].ApplyCurrentValues(a); b.Value = txtTheoDoi_NhanDinhTT.Text; a.Add(b); rp.DataDefinition.ParameterFields["NhanDinhTinhTrang"].ApplyCurrentValues(a); b.Value = txtTheoDoi_KeHoachChamSoc.Text; a.Add(b); rp.DataDefinition.ParameterFields["KeHoach"].ApplyCurrentValues(a); } else { b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["PhongBenh"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["GiuongBenh"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["HoBSPhuTrach"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["TenBSPhuTrach"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["HoYTPhuTrach"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["TenYTPhuTrach"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["NhanDinhTinhTrang"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["KeHoach"].ApplyCurrentValues(a); } if (txtXuatVien_MaXV.Text.ToString() != "") { b.Value = dtPickerXuatVien_NgayRaVien.Text; a.Add(b); rp.DataDefinition.ParameterFields["NgayXuatVien"].ApplyCurrentValues(a); b.Value = txtXuatVien_ChuanDoan.Text; a.Add(b); rp.DataDefinition.ParameterFields["ChanDoan"].ApplyCurrentValues(a); b.Value = txtXuatVien_PPDieuTri.Text; a.Add(b); rp.DataDefinition.ParameterFields["PPDieuTri1"].ApplyCurrentValues(a); } else { b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["NgayXuatVien"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["ChanDoan"].ApplyCurrentValues(a); b.Value = ""; a.Add(b); rp.DataDefinition.ParameterFields["PPDieuTri1"].ApplyCurrentValues(a); } crystalReportViewer1.ReportSource = rp; }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rpBenhAn rpt = new rpBenhAn(); rpt.Site = this.Site; return rpt; }