Ejemplo n.º 1
0
        public static void InphieuDieuTri(DataTable dtPrint, DateTime ngayin)
        {
            string tieude = "", reportname = "";
            var    crpt = Utility.GetReport("noitru_phieudieutri", ref tieude, ref reportname);

            if (crpt == null)
            {
                return;
            }
            //var crpt = new crpt_PhieuDieuTri();
            var objForm = new frmPrintPreview("IN PHIẾU ĐIỀU TRỊ", crpt, true, true);

            crpt.SetDataSource(dtPrint);
            objForm.mv_sReportFileName = Path.GetFileName(reportname);
            objForm.mv_sReportCode     = "noitru_phieudieutri";
            Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
            Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
            Utility.SetParameterValue(crpt, "CurrentDate", Utility.FormatDateTime(ngayin));
            Utility.SetParameterValue(crpt, "sTitleReport", tieude);
            Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());

            objForm.crptViewer.ReportSource = crpt;
            objForm.ShowDialog();
            objForm.Dispose();
        }
        private void SoLuongXetNghiem()
        {
            try
            {
                string pFromBarcode = dtpDatePrintFrom.Value.ToString("yyMMdd") +
                                      txtFromBarcode.Text.Trim().PadLeft(4, '0');
                string pToBarcode = dtpDatePrintFrom.Value.ToString("yyMMdd") + txtToBarcode.Text.Trim().PadLeft(4, '0');

                m_Report =
                    LAOKHOA_SLMAU_THEOBARCODE(dtpDatePrintFrom.Value, Utility.sDbnull(pFromBarcode),
                                              Utility.sDbnull(pToBarcode)).GetDataSet().Tables[0];
                if (m_Report.Rows.Count <= 0)
                {
                    Utility.ShowMsg("Không tìm thấy bản ghi nào", "Thông Báo", MessageBoxIcon.Information);
                }
                else
                {
                    string stringBarcode = string.Format("Từ Barcode {0} đến barcode {1}", pFromBarcode, pToBarcode);
                    var    crpt          = new crpt_SoLuongMauTheoBarcode();
                    var    frm           = new frmPrintPreview("Thống Kê Số Lượng Mẫu", crpt, true, true);
                    crpt.SetDataSource(m_Report);
                    crpt.DataDefinition.FormulaFields["Formula_1"].Text = "";
                    crpt.SetParameterValue("stringBarcode", stringBarcode);
                    crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
                    crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
                    frm.crptViewer.ReportSource = crpt;
                    frm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                Utility.ShowMsg(ex.ToString(), "Lỗi xuất báo cáo!");
            }
        }
Ejemplo n.º 3
0
        //Hàm lấy dữ liệu và in
        private void GetDataForPrint(DataTable mDsReport)
        {
            var crpt    = new VD_1C_crpt_DetailTestReport_ALL();
            var objForm = new frmPrintPreview("", crpt, true, true);

            try
            {
                crpt.SetDataSource(mDsReport);

                //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) +
                //                                                      "    Bác sĩ điều trị                                                                   "
                //                                                          .Replace("#$X$#",
                //                                                                   Strings.Chr(34) + "&Chr(13)&" +
                //                                                                   Strings.Chr(34)) + Strings.Chr(34);
                crpt.SetParameterValue("ShowSubReport", 1);
                crpt.SetParameterValue("ShowMainReport", 0);

                crpt.SetParameterValue("ParentBranchName", LablinkBusinessConfig.GetParentBranchName());
                crpt.SetParameterValue("BranchName", LablinkBusinessConfig.GetBranchName());
                string sss = LablinkBusinessConfig.GetPhone();
                crpt.SetParameterValue("Address", LablinkBusinessConfig.GetAddress());
                crpt.SetParameterValue("sPhone", LablinkBusinessConfig.GetPhone());


                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// hàm thực hiện việc in phiếu dịch vụ
        /// </summary>
        /// <param name="m_dtReportPhieuThu"></param>
        /// <param name="NgayInPhieu"></param>
        /// <param name="sTitleReport"></param>
        public void LAOKHOA_INPHIEU_DICHVU(DataTable m_dtReportPhieuThu, DateTime NgayInPhieu, string sTitleReport)
        {
            Utility.UpdateLogotoDatatable(ref m_dtReportPhieuThu);
            string tieude = "", reportname = "";
            var    crpt = Utility.GetReport("thanhtoan_crpt_PhieuDV_A5", ref tieude, ref reportname);

            if (crpt == null)
            {
                return;
            }
            var objForm = new frmPrintPreview("", crpt, true, true);

            //try
            //{
            crpt.SetDataSource(m_dtReportPhieuThu);
            //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "                                                                      ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
            Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
            Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
            Utility.SetParameterValue(crpt, "Telephone", globalVariables.Branch_Phone);
            Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
            //  Utility.SetParameterValue(crpt,"DateTime", Utility.FormatDateTime(dtCreateDate.Value));
            Utility.SetParameterValue(crpt, "CurrentDate", Utility.FormatDateTime(NgayInPhieu));
            Utility.SetParameterValue(crpt, "sTitleReport", sTitleReport);
            Utility.SetParameterValue(crpt, "sMoneyCharacter",
                                      new MoneyByLetter().sMoneyToLetter(SumOfTotal(m_dtReportPhieuThu).ToString()));
            Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
            objForm.crptViewer.ReportSource = crpt;
            objForm.ShowDialog();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// hàm thực hiện việc in phiếu thu của y học hải quân
        /// </summary>
        /// <param name="sTitleReport"></param>
        private void YHHQ_PrintPhieuThu(string sTitleReport)
        {
            var crpt = new ReportDocument();

            Utility.WaitNow(this);

            crpt = new crpt_PhieuThu();

            var objForm = new frmPrintPreview("", crpt, true, true);

            //try
            //{
            crpt.SetDataSource(m_dtReportPhieuThu);
            // crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "    Nhân viên                                                                   ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
            crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
            crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
            crpt.SetParameterValue("DateTime", Utility.FormatDateTime(dtCreateDate.Value));
            crpt.SetParameterValue("CurrentDate", Utility.FormatDateTime(globalVariables.SysDate));
            crpt.SetParameterValue("sTitleReport", sTitleReport);
            crpt.SetParameterValue("CharacterMoney", sMoneyByLetter.sMoneyToLetter(txtSO_TIEN.Text));
            DataRow dataRow = m_dtReportPhieuThu.Rows[0];

            //if (status != 0)
            //crpt.SetParameterValue("NguoiChi", BusinessHelper.GetStaffByUserName(dataRow["NGUOI_NOP"].ToString()));
            objForm.crptViewer.ReportSource = crpt;
            objForm.ShowDialog();
            Utility.DefaultNow(this);
            //}
            //catch (Exception ex)
            //{
            //    Utility.DefaultNow(this);
            //}
        }
Ejemplo n.º 6
0
        /// <summary>
        /// hàm thực hiện việc in phieus thu của dệt may
        /// </summary>
        /// <param name="sTitleReport"></param>
        private void DM_PrintPhieuThu(string sTitleReport)
        {
            Utility.WaitNow(this);
            var crpt    = new crpt_PhieuThu();
            var objForm = new frmPrintPreview("", crpt, true, true);

            //try
            //{
            crpt.SetDataSource(m_dtReportPhieuThu);
            crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "    Nhân viên                                                                   ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
            crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
            crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
            crpt.SetParameterValue("DateTime", Utility.FormatDateTime(dtCreateDate.Value));
            crpt.SetParameterValue("CurrentDate", Utility.FormatDateTime(globalVariables.SysDate));
            crpt.SetParameterValue("sTitleReport", sTitleReport);
            crpt.SetParameterValue("CharacterMoney", sMoneyByLetter.sMoneyToLetter(txtSO_TIEN.Text));
            objForm.crptViewer.ReportSource = crpt;
            objForm.ShowDialog();
            Utility.DefaultNow(this);
            //}
            //catch (Exception ex)
            //{
            //    Utility.DefaultNow(this);
            //}
        }
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         string s = "";
         if (dtpFromDate.Value.Date == dtpToDate.Value.Date)
         {
             s = string.Format("{0}Ngày {1}", s, dtpFromDate.Value.ToString("dd/MM/yyyy"));
         }
         else
         {
             s = string.Format("{0}{1}", s,
                               string.Format("Thời gian từ ngày {0} đến ngày {1}", dtpFromDate.Value.ToString("dd/MM/yyyy"),
                                             dtpToDate.Value.ToString("dd/MM/yyyy")));
         }
         var crpt  = new Crp_DSBN_TestType();
         var oForm = new frmPrintPreview("In Báo cáo lưu", crpt, true, true);
         crpt.SetDataSource(dt);
         crpt.DataDefinition.FormulaFields["Formula_1"].Text = "";
         crpt.SetParameterValue("TongBenhNhan", dt.Rows.Count);
         crpt.SetParameterValue("TestType_Name", cboTestType.Text.ToUpper());
         crpt.SetParameterValue("strFromDateToDate", s);
         crpt.SetParameterValue("ParentBranchName", ManagementUnit.gv_sParentBranchName);
         crpt.SetParameterValue("BranchName", ManagementUnit.gv_sBranchName);
         crpt.SetParameterValue("sCurrentDate", dtCreatePrint.Value);
         oForm.crptViewer.ReportSource = crpt;
         oForm.ShowDialog();
         oForm.Dispose();
     }
     catch (Exception ex)
     {
         Utility.ShowMsg(ex.Message);
     }
 }
Ejemplo n.º 8
0
        private void ReportDepartmentVnio(DataTable m_dsReport)
        {
            //ds_dailyDetailTestReport.dtDailyDetailTestReportDataTable DT = new ds_dailyDetailTestReport.dtDailyDetailTestReportDataTable();
            string sTungayDenNgay = Getsday(Convert.ToDateTime(dtpFromDate.Text)) + " --- đến --- " +
                                    Getsday(Convert.ToDateTime(dtpTodate.Text));

            if (!InvaliData(_dsReport))
            {
                return;
            }
            var crpt    = new crpt_DailyTestReportDepartment();
            var objForm = new frmPrintPreview("", crpt, true, true);

            try
            {
                crpt.SetDataSource(m_dsReport);
                //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) +
                //                                                      "    Nhân viên                                                                   "
                //                                                          .Replace("#$X$#",
                //                                                                   Strings.Chr(34) + "&Chr(13)&" +
                //                                                                   Strings.Chr(34)) + Strings.Chr(34);
                crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
                crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
                //crpt.SetParameterValue("ShowGroup", "1");
                crpt.SetParameterValue("sTungayDenNgay", sTungayDenNgay);
                // crpt.SetParameterValue("TotalTest", intGetTotalTest( DT));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                Utility.DefaultNow(this);
            }
        }
        private void cmdInPhieu_Click(object sender, EventArgs e)
        {
            int trangthai = -1;

            DataTable dtDanhsach =
                SPs.BhytBaocaoDongchitra(dtFromDate.Value, dtToDate.Value,
                                         Utility.sDbnull(cboKhoa.SelectedValue, "KKB"), globalVariables.gv_intIDNhanvien, trangthai)
                .GetDataSet().Tables[0];

            Utility.SetDataSourceForDataGridEx(grdResult, dtDanhsach, false, false, "", "");

            THU_VIEN_CHUNG.CreateXML(dtDanhsach, "BHYT_baocao_dongchitra.XML");
            Utility.UpdateLogotoDatatable(ref dtDanhsach);
            string reportCode = "BHYT_baocao_dongchitra";

            string Condition =
                string.Format("Từ ngày {0} đến {1} - Khoa KCB :{2}",
                              dtFromDate.Text, dtToDate.Text, globalVariables.MA_KHOA_THIEN);
            ReportDocument crpt = Utility.GetReport(reportCode, ref tieude, ref reportname);

            if (crpt == null)
            {
                return;
            }

            string StaffName = globalVariables.gv_strTenNhanvien;

            if (string.IsNullOrEmpty(globalVariables.gv_strTenNhanvien))
            {
                StaffName = globalVariables.UserName;
            }
            try
            {
                var objForm = new frmPrintPreview(tieude, crpt, true, dtDanhsach.Rows.Count <= 0 ? false : true);
                crpt.SetDataSource(dtDanhsach);
                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode     = reportCode;
                crpt.SetParameterValue("StaffName", StaffName);
                crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
                crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
                crpt.SetParameterValue("Address", globalVariables.Branch_Address);
                crpt.SetParameterValue("Phone", globalVariables.Branch_Phone);
                crpt.SetParameterValue("FromDateToDate", Condition);
                crpt.SetParameterValue("sTitleReport", tieude);
                crpt.SetParameterValue("sCurrentDate", Utility.FormatDateTimeWithThanhPho(dtNgayInPhieu.Value));
                crpt.SetParameterValue("BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                Utility.SetParameterValue(crpt, "txtTrinhky", Utility.getTrinhky(objForm.mv_sReportFileName, globalVariables.SysDate));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
            }
            catch (Exception exception)
            {
                Utility.ShowMsg("Lỗi:" + exception.Message);
            }
            finally
            {
                Utility.FreeMemory(crpt);
            }
        }
        /// <summary>
        /// hàm thực hiện việc in phiếu báo cáo tổng hợp
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdInPhieuXN_Click(object sender, EventArgs e)
        {
            _dtData = BAOCAO_NGOAITRU.BaocaoTamungHoanung(Utility.Int16Dbnull(txtNhanvien.MyID, -1), chkByDate.Checked?dtFromDate.Value.ToString("dd/MM/yyyy"):"01/01/1900",
                                                          chkByDate.Checked ? dtToDate.Value.ToString("dd/MM/yyyy") : "01/01/1900",
                                                          Utility.Int16Dbnull(cbokhoa.SelectedValue, -1),
                                                          Utility.Int16Dbnull(cboDoituongKCB.SelectedValue, -1),
                                                          Utility.Bool2byte(optHoanung.Checked)
                                                          );

            Utility.SetDataSourceForDataGridEx(grdList, _dtData, false, true, "1=1", "");


            Utility.UpdateLogotoDatatable(ref _dtData);
            THU_VIEN_CHUNG.CreateXML(_dtData, "baocao_tamung.xml");
            if (_dtData.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không tìm thấy dữ liệu báo cáo theo điều kiện bạn chọn", "Thông báo", MessageBoxIcon.Information);
                return;
            }
            string Condition = string.Format("Từ ngày {0} đến {1} - Thu ngân viên :{2} ", dtFromDate.Text, dtToDate.Text, txtNhanvien.Text);
            var    crpt      = Utility.GetReport(optTamung.Checked?"baocao_tamung":"baocao_hoanung", ref tieude, ref reportname);

            if (crpt == null)
            {
                return;
            }

            string StaffName = globalVariables.gv_strTenNhanvien;

            if (string.IsNullOrEmpty(globalVariables.gv_strTenNhanvien))
            {
                StaffName = globalVariables.UserName;
            }
            try
            {
                frmPrintPreview objForm = new frmPrintPreview(tieude, crpt, true, _dtData.Rows.Count <= 0 ? false : true);
                //try
                //{
                crpt.SetDataSource(_dtData);
                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode     = optTamung.Checked?"baocao_tamung":"baocao_hoanung";
                Utility.SetParameterValue(crpt, "StaffName", StaffName);
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
                Utility.SetParameterValue(crpt, "Phone", globalVariables.Branch_Phone);
                Utility.SetParameterValue(crpt, "FromDateToDate", Condition);
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                Utility.SetParameterValue(crpt, "Tongtien_chu", new MoneyByLetter().sMoneyToLetter(_dtData.Compute("SUM(so_tien)", "1=1").ToString()));
                Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(dtNgayInPhieu.Value));
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
            }
            catch (Exception ex)
            {
                Utility.CatchException(ex);
            }
        }
Ejemplo n.º 11
0
        void cmdPrint_Click(object sender, EventArgs e)
        {
            Utility.WaitNow(this);
            DataTable dtData =
                SPs.KcbThamkhamPhieuchuyenvien(Utility.DoTrim(txtMaluotkham.Text)).GetDataSet().Tables[0];

            if (dtData.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không tìm thấy dữ liệu cho báo cáo", "Thông báo", MessageBoxIcon.Warning);
                return;
            }
            THU_VIEN_CHUNG.CreateXML(dtData, "thamkham_phieuchuyenvien.XML");
            Utility.UpdateLogotoDatatable(ref dtData);
            string StaffName = globalVariables.gv_strTenNhanvien;

            if (string.IsNullOrEmpty(globalVariables.gv_strTenNhanvien))
            {
                StaffName = globalVariables.UserName;
            }

            string         tieude = "", reportname = "";
            ReportDocument crpt = Utility.GetReport("thamkham_phieuchuyenvien", ref tieude, ref reportname);

            if (crpt == null)
            {
                return;
            }
            try
            {
                frmPrintPreview objForm = new frmPrintPreview("PHIẾU CHUYỂN TUYẾN", crpt, true, dtData.Rows.Count <= 0 ? false : true);
                crpt.SetDataSource(dtData);

                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode     = "thamkham_phieuchuyenvien";
                Utility.SetParameterValue(crpt, "StaffName", StaffName);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
                Utility.SetParameterValue(crpt, "Phone", globalVariables.Branch_Phone);
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                Utility.SetParameterValue(crpt, "CurrentDate", Utility.FormatDateTimeWithThanhPho(dtpNgayin.Value));
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                Utility.SetParameterValue(crpt, "txtTrinhky", Utility.getTrinhky(objForm.mv_sReportFileName, globalVariables.SysDate));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
            }
            catch (Exception ex)
            {
                Utility.CatchException(ex);
            }
            finally
            {
                Utility.DefaultNow(this);
                GC.Collect();
                Utility.FreeMemory(crpt);
            }
        }
        private void IN_BAOCAO_TIENKHAM_DICHVU()
        {
            DataTable v_dtData = new DataTable();

            v_dtData =
                GtvtBaocaoTongsluongLoaixetnghiem(
                    chkFormDate.Checked ? dtFromDate.Value : Convert.ToDateTime("01/01/1900"),
                    chkFormDate.Checked ? dtToDate.Value : Utility.getSysDate(),
                    Utility.Int32Dbnull(cboObjectType.SelectedValue, -1),
                    Utility.Int32Dbnull(cboDepartment.SelectedValue, -1),
                    Utility.Int32Dbnull(cboLoaiXetnghiem.SelectedValue, -1),
                    Utility.Int32Dbnull(cboHos_Status.SelectedValue, -1), chkTongKhoa.Checked?1:0).GetDataSet().Tables[0];

            // SubSonic.StoredProcedure.
            if (v_dtData.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không tìm thấy bản ghi nào", "Thông báo");
                return;
            }
            string sTungayDenNgay = dtFromDate.Value.Date != dtToDate.Value.Date
                                      ? string.Format("{0} --- đến --- {1}", Getsday(dtFromDate.Value),
                                                      Getsday(dtToDate.Value))
                                      : Getsday(dtFromDate.Value);

            Utility.UpdateLogotoDatatable(ref v_dtData);
            var crpt = new ReportDocument();

            if (chkTongLoaiXN.Checked)
            {
                crpt = new CRTP_GTVT_BAOCAO_SLUONG_XNGHIEM_THEO_TLOAI();
            }
            else
            {
                crpt = new CRPT_GTVT_BAOCAO_SOLUONG_LOAIXETNGHIEM();
            }
            var objForm = new frmPrintPreview("THỐNG KÊ TIỀN KHÁM DỊCH VỤ", crpt, true, true);

            crpt.SetDataSource(v_dtData);
            crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) +
                                                                  "        NGƯỜI LẬP BẢNG KÊ                                                           KẾ TOÁN                "
                                                                  .Replace("#$X$#",
                                                                           Strings.Chr(34) + "&Chr(13)&" +
                                                                           Strings.Chr(34)) +
                                                                  Strings.Chr(34);
            crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
            crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
            crpt.SetParameterValue("sTitleReport", "BÁO CÁO SỐ LƯỢNG LOẠI XÉT NGHIỆM");
            crpt.SetParameterValue("sTuNgayDenNgay", sTungayDenNgay);
            crpt.SetParameterValue("sCurrentDate", Utility.FormatDateTime(dtCreatePrint.Value));
            /// crpt.SetParameterValue("NgayIn", "Ngày " + dtCreatePrint.Value.Day + " tháng " + dtCreatePrint.Value.Month + " năm " + dtCreatePrint.Value.Year);
            // crpt.SetParameterValue("TienBangChu", sMoneyByLetter.sMoneyToLetter(v_dtData.Compute("SUM(TONG)", "1=1").ToString()));
            //  crpt.SetParameterValue("DateTime", "Từ ngày: " + dtFromDate.Value.ToShortDateString() + " đến ngày: " + dtToDate.Value.ToShortDateString());
            objForm.crptViewer.ReportSource = crpt;
            objForm.ShowDialog();
            Utility.DefaultNow(this);
        }
Ejemplo n.º 13
0
        public static void INMAU_CHUYENKHAM_CHUYENKHOA(DataTable mDtReport, string sTitleReport, string report,
                                                       string lydochuyen)
        {
            Utility.UpdateLogotoDatatable(ref mDtReport);
            string         tieude = "", reportname = "";
            ReportDocument reportDocument = report == "PHIEUKHAM_CHUYENKHOA"
                ? Utility.GetReport("thamkham_phieukham_chuyenkhoa", ref tieude, ref reportname)
                : Utility.GetReport("thamkham_phieuxn_benhpham", ref tieude, ref reportname);

            if (reportDocument == null)
            {
                return;
            }
            ReportDocument crpt = reportDocument;

            var objForm = new frmPrintPreview(sTitleReport, crpt, true, mDtReport.Rows.Count > 0);

            try
            {
                mDtReport.AcceptChanges();
                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode     = "thamkham_phieukham_chuyenkhoa";
                crpt.SetDataSource(mDtReport);
                Utility.SetParameterValue(crpt, "Phone", globalVariables.Branch_Phone + globalVariables.SOMAYLE);
                Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "CurrentDate", Utility.FormatDateTime(globalVariables.SysDate));
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                Utility.SetParameterValue(crpt, "lydochuyen", lydochuyen);
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                Utility.SetParameterValue(crpt, "txtTrinhky",
                                          Utility.getTrinhky(objForm.mv_sReportFileName,
                                                             globalVariables.SysDate));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                //if (Utility.isPrintPreview(PropertyLib._MayInProperties.TenMayInPhieuKCB, PropertyLib._MayInProperties.PreviewPhieuKCB))
                //{
                //    objForm.SetDefaultPrinter(PropertyLib._MayInProperties.TenMayInPhieuKCB, 0);
                //    objForm.ShowDialog();
                //}
                //else
                //{
                //    objForm.addTrinhKy_OnFormLoad();
                //    crpt.PrintOptions.PrinterName = PropertyLib._MayInProperties.TenMayInBienlai;
                //    crpt.PrintToPrinter(1, false, 0, 0);
                //}
            }
            catch (Exception ex)
            {
                Utility.ShowMsg(ex.ToString());
            }
            finally
            {
                GC.Collect();
            }
        }
Ejemplo n.º 14
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            frmPrintPreview printPreview = new frmPrintPreview(this.arrPicture, patient);

            printPreview.ShowDialog();
            //this.arrControls = this.SortControls(loader.CurrntPanel);
            //this.cboPage.Items.Clear();
            //TotalPage = 0;
            //this.Print();
        }
        /// <summary>
        /// hàm thực hiện in phiếu bảo hiểm đúng tuyến
        /// </summary>
        /// <param name="sTitleReport"></param>
        public void LAOKHOA_INPHIEU_BAOHIEM_NGOAITRU(DataTable m_dtReportPhieuThu, string sTitleReport, DateTime ngayIn)
        {
            Utility.UpdateLogotoDatatable(ref m_dtReportPhieuThu);
            THU_VIEN_CHUNG.Sapxepthutuin(ref m_dtReportPhieuThu, true);
            m_dtReportPhieuThu.DefaultView.Sort = "THU_TU ASC";
            m_dtReportPhieuThu.AcceptChanges();
            string tieude = "", reportname = "";
            var    crpt = Utility.GetReport("BHYT_InPhoi", ref tieude, ref reportname);

            if (crpt == null)
            {
                return;
            }
            var objForm = new frmPrintPreview("", crpt, true, true);

            //try
            //{

            crpt.SetDataSource(m_dtReportPhieuThu.DefaultView);
            //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "    Nhân viên                                                                   ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
            // Utility.SetParameterValue(crpt,"Telephone", globalVariables.Branch_Phone);
            // Utility.SetParameterValue(crpt,"Address", globalVariables.Branch_Address);
            Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
            Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
            Utility.SetParameterValue(crpt, "CurrentDate", Utility.FormatDateTime(ngayIn));
            Utility.SetParameterValue(crpt, "sTitleReport", sTitleReport);
            Utility.SetParameterValue(crpt, "sMoneyCharacter_Thanhtien",
                                      sMoneyByLetter.sMoneyToLetter(
                                          SumOfTotal_BH(m_dtReportPhieuThu, "THANH_TIEN").ToString()));
            Utility.SetParameterValue(crpt, "sMoneyCharacter_Thanhtien_BH",
                                      sMoneyByLetter.sMoneyToLetter(
                                          SumOfTotal_BH(m_dtReportPhieuThu, "BHCT").ToString()));
            Utility.SetParameterValue(crpt, "sMoneyCharacter_Thanhtien_BN",
                                      sMoneyByLetter.sMoneyToLetter(
                                          SumOfTotal_BH(m_dtReportPhieuThu, "BNCT").ToString()));
            Utility.SetParameterValue(crpt, "sMoneyCharacter_Thanhtien_Khac",
                                      sMoneyByLetter.sMoneyToLetter(
                                          SumOfTotal_BH(m_dtReportPhieuThu, "PHU_THU").ToString()));
            objForm.crptViewer.ReportSource = crpt;
            objForm.addTrinhKy_OnFormLoad();
            PrintDialog frmPrint = new PrintDialog();

            if (frmPrint.ShowDialog() == DialogResult.OK)
            {
                crpt.PrintOptions.PrinterName = frmPrint.PrinterSettings.PrinterName;
                crpt.PrintToPrinter(frmPrint.PrinterSettings.Copies, frmPrint.PrinterSettings.Collate, frmPrint.PrinterSettings.FromPage, frmPrint.PrinterSettings.ToPage);
            }
            //objForm.ShowDialog();

            //}
            //catch (Exception ex)
            //{
            //    Utility.DefaultNow(this);
            //}
        }
Ejemplo n.º 16
0
 private void PrintTonghop(bool view)
 {
     try
     {
         prgBar.Visible = true;
         if (m_dataTH != null)
         {
             if (m_dataTH.Rows.Count <= 0 || m_dataTH.Columns.Count <= 0)
             {
                 return;
             }
             string         tieude = "", reportname = "";
             ReportDocument crpt = Utility.GetReport("BHYT_05A_TH", ref tieude, ref reportname);
             if (crpt == null)
             {
                 return;
             }
             var Preview = new frmPrintPreview("BÁO CÁO BHYT 05A TỔNG HỢP", crpt, true, true);
             if (m_dataTH.Rows.Count <= 0)
             {
                 return;
             }
             Utility.UpdateLogotoDatatable(ref m_dataTH);
             Preview.mv_sReportFileName = Path.GetFileName(reportname);
             Preview.mv_sReportCode     = "BHYT_05A_TH";
             crpt.SetDataSource(m_dataTH);
             Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
             Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
             Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
             Utility.SetParameterValue(crpt, "TIEUDE", Utility.DoTrim(baocaO_TIEUDE1.TIEUDE));
             Utility.SetParameterValue(crpt, "DateTime",
                                       "Từ ngày: " + dtpFromDate.Value.ToShortDateString() + " đến ngày: " +
                                       dtpToDate.Value.ToShortDateString());
             Utility.SetParameterValue(crpt, "sTongTien", new MoneyByLetter().sMoneyToLetter(Utility.DecimaltoDbnull(m_dataTH.Compute("SUM(CONGTIEN)", "1=1"), 0).ToString()));
             Utility.SetParameterValue(crpt, "NgayIn", Utility.FormatDateTimeWithThanhPho(dtpNgayIn.Value));
             Preview.crptViewer.ReportSource = crpt;
             if (view)
             {
                 Preview.ShowDialog();
             }
             else
             {
                 crpt.PrintOptions.PaperSize        = PaperSize.PaperA4;
                 crpt.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
                 crpt.PrintToPrinter(1, false, 1, 1);
             }
             prgBar.Visible = false;
         }
     }
     catch (Exception ex)
     {
         log.Error("Loi trong qua trinh in bao cao : (0)", ex);
         prgBar.Visible = false;
     }
 }
Ejemplo n.º 17
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            try
            {
                ReportDocument crpt;

                string s;
                if (cboTestType.SelectedValue.ToString() == "-1")
                {
                    s = "TẤT CẢ CÁC LOẠI XÉT NGHIỆM";
                }
                else
                {
                    s = string.Format("XÉT NGHIỆM {0}", cboTestType.SelectedText.ToUpper());
                }
                var ds =
                    SPs.SpBaoCaoXoaKetQua(dtpFromDate.Value.ToString("yyyy/MM/dd"),
                                          dtpToDate.Value.ToString("yyyy/MM/dd"),
                                          Utility.Int32Dbnull(cboTestType.SelectedValue, -1),
                                          Utility.sDbnull(cboUserName.SelectedValue, "")).GetDataSet();
                if (cboReportType.SelectedIndex == 1)
                {
                    crpt = new crpt_BAOCAO_XOA_KETQUA_TONGHOP();
                    dt   = ds.Tables[0];
                }
                else
                {
                    crpt = new crpt_BAOCAO_XOA_KETQUA_CHITIET();
                    dt   = ds.Tables[1];
                }
                if (dt.Rows.Count <= 0)
                {
                    Utility.ShowMsg("Không có dữ liệu để báo cáo");
                }
                else
                {
                    var oForm = new frmPrintPreview("In báo cáo xóa", crpt, true, true);
                    crpt.SetDataSource(dt);
                    crpt.DataDefinition.FormulaFields["Formula_1"].Text = "";
                    //crpt.SetParameterValue("TongBenhNhan", dt.Rows.Count);
                    crpt.SetParameterValue("TestType_Name", s);
                    crpt.SetParameterValue("ParentBranchName", ManagementUnit.gv_sParentBranchName);
                    crpt.SetParameterValue("BranchName", ManagementUnit.gv_sBranchName);
                    //crpt.SetParameterValue("sCurrentDate", dtpDatePrintFrom.Value);
                    oForm.crptViewer.ReportSource = crpt;
                    oForm.ShowDialog();
                    oForm.Dispose();
                }
            }
            catch (Exception ex)
            {
                Utility.ShowMsg(ex.Message);
            }
        }
        /// <summary>
        /// HÀM THỰC HIỆN VIỆC IN PHIẾU BIÊN LAI CHO BẢO HIỂM Y TẾ
        /// </summary>
        /// <param name="m_dtReportPhieuThu"></param>
        /// <param name="sTitleReport"></param>
        /// <param name="ngayIn"></param>
        public void LAOKHOA_INPHIEU_BIENLAI_BHYT(DataTable m_dtReportPhieuThu, string sTitleReport, DateTime ngayIn)
        {
            if (m_dtReportPhieuThu.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không tìm thấy bản ghi nào", "Thông báo", MessageBoxIcon.Warning);
                return;
            }
            Utility.UpdateLogotoDatatable(ref m_dtReportPhieuThu);
            THU_VIEN_CHUNG.Sapxepthutuin(ref m_dtReportPhieuThu, true);
            m_dtReportPhieuThu.DefaultView.Sort = "THU_TU ASC";
            m_dtReportPhieuThu.AcceptChanges();
            decimal        phuthu = SumOfTotal(m_dtReportPhieuThu, "PHU_THU");
            decimal        bnct = SumOfTotal(m_dtReportPhieuThu, "BNCT");
            decimal        Total = bnct + phuthu;
            string         tieude = "", reportname = "";
            ReportDocument crpt = Utility.GetReport("thanhtoan_Bienlai_BHYT_A4", ref tieude, ref reportname);

            if (PropertyLib._MayInProperties.CoGiayInBienlai == Papersize.A4)
            {
                crpt = Utility.GetReport("thanhtoan_Bienlai_BHYT_A4", ref tieude, ref reportname);
            }
            else
            {
                crpt = Utility.GetReport("thanhtoan_Bienlai_BHYT_A5", ref tieude, ref reportname);
            }
            if (crpt == null)
            {
                return;
            }
            var objForm = new frmPrintPreview(sTitleReport, crpt, true, true);

            //try
            //{

            crpt.SetDataSource(m_dtReportPhieuThu.DefaultView);
            //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "    Nhân viên                                                                   ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
            Utility.SetParameterValue(crpt, "Phone", globalVariables.Branch_Phone);
            Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
            //Utility.SetParameterValue(crpt,"ParentBranchName", globalVariables.ParentBranch_Name);
            Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
            Utility.SetParameterValue(crpt, "CurrentDate", Utility.FormatDateTime(ngayIn));
            Utility.SetParameterValue(crpt, "sTitleReport", sTitleReport);
            Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
            Utility.SetParameterValue(crpt, "sMoneyLetter", _moneyByLetter.sMoneyToLetter(Total.ToString()));
            objForm.crptViewer.ReportSource = crpt;
            objForm.ShowDialog();

            //}
            //catch (Exception ex)
            //{
            //    Utility.DefaultNow(this);
            //}
        }
Ejemplo n.º 19
0
        public static void InphieuNhapkho(int IDPhieuNhap, string sTitleReport, DateTime NgayIn)
        {
            DataTable m_dtReport = new THUOC_NHAPKHO().Laythongtininphieunhapkhothuoc(IDPhieuNhap);

            if (m_dtReport.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không tìm thấy thông tin ", "Thông báo", MessageBoxIcon.Warning);
                return;
            }
            THU_VIEN_CHUNG.CreateXML(m_dtReport, "thuoc_phieu_nhapkho.xml");
            MoneyByLetter _moneyByLetter = new MoneyByLetter();
            string        tinhtong = TinhTong(m_dtReport, TPhieuNhapxuatthuocChitiet.ThanhTienColumn.ColumnName);
            string        tieude = "", reportname = "";
            var           crpt = Utility.GetReport("thuoc_phieunhapkho", ref tieude, ref reportname);

            // VNS.HIS.UI.BaoCao.PhieuNhapKho.CRPT_PHIEU_NHAPKHO crpt =new CRPT_PHIEU_NHAPKHO();
            var objForm = new frmPrintPreview(sTitleReport, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);

            Utility.UpdateLogotoDatatable(ref m_dtReport);
            try
            {
                m_dtReport.AcceptChanges();
                crpt.SetDataSource(m_dtReport);

                ////crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "  PHÒNG TIẾP ĐÓN   ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode     = "thuoc_phieunhapkho";
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "sMoneyLetter", _moneyByLetter.sMoneyToLetter(tinhtong));

                Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                Utility.SetParameterValue(crpt, "txtTrinhky", Utility.getTrinhky(objForm.mv_sReportFileName, globalVariables.SysDate));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                // Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                if (globalVariables.IsAdmin)
                {
                    Utility.ShowMsg(ex.ToString());
                }
            }
        }
Ejemplo n.º 20
0
        private void cmdPrint_Click(object sender, EventArgs e)
        {
            try
            {
                //Truyền dữ liệu vào datatable
                DataTable m_dtReport = BAOCAO_THUOC.ThuocLaythongtinInphieuDutruthuoc(Utility.Int16Dbnull(cboKhoxuat.SelectedValue, -1), KIEU_THUOC_VT);
                THU_VIEN_CHUNG.CreateXML(m_dtReport, "thuoc_PhieuDutru.xml");

                if (m_dtReport.Rows.Count <= 0)
                {
                    Utility.ShowMsg("Không tìm thấy dữ liệu cho báo cáo", "Thông báo", MessageBoxIcon.Warning);
                    return;
                }

                //Add logo vào datatable
                Utility.UpdateLogotoDatatable(ref m_dtReport);
                string tieude = "", reportname = "";
                string mabaocao = "thuoc_PhieuDutru";
                var    crpt     = Utility.GetReport(mabaocao, ref tieude, ref reportname);
                if (crpt == null)
                {
                    return;
                }

                //baocaO_TIEUDE1.TIEUDE
                frmPrintPreview objForm = new frmPrintPreview(tieude, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);
                crpt.SetDataSource(m_dtReport);

                objForm.mv_sReportFileName = System.IO.Path.GetFileName(reportname);
                objForm.mv_sReportCode     = mabaocao;
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(globalVariables.SysDate));
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                Utility.SetParameterValue(crpt, "txtTrinhky", "");
                Utility.SetParameterValue(crpt, "tenkho", cboKhoxuat.Text);


                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
            }
            catch (Exception exception)
            {
                Utility.ShowMsg("Lỗi:" + exception.Message);
            }
        }
Ejemplo n.º 21
0
        public static void InBienBanGiaoHang(int IDPhieuNhap, string sTitleReport, DateTime NgayIn)
        {
            DataTable m_dtReport = SPs.ThuocLaydulieuinphieuchuyenkho2lien(IDPhieuNhap).GetDataSet().Tables[0];

            if (m_dtReport.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không tìm thấy thông tin ", "Thông báo", MessageBoxIcon.Warning);
                return;
            }
            THU_VIEN_CHUNG.CreateXML(m_dtReport, "thuoc_phieu_bienbangiaohang");
            string tieude = "", reportname = "";
            var    crpt = Utility.GetReport("thuoc_phieu_bienbangiaohang", ref tieude, ref reportname);

            Utility.UpdateLogotoDatatable(ref m_dtReport);
            var objForm = new frmPrintPreview(sTitleReport, crpt, true, true);

            try
            {
                m_dtReport.AcceptChanges();
                crpt.SetDataSource(m_dtReport);
                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode     = "thuoc_phieu_bienbangiaohang";
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                //  Utility.SetParameterValue(crpt, "sMoneyLetter", new MoneyByLetter().sMoneyToLetter(tinhtong));
                Utility.SetParameterValue(crpt, "txtTrinhky", Utility.getTrinhky(objForm.mv_sReportFileName, globalVariables.SysDate));
                objForm.crptViewer.ReportSource = crpt;

                objForm.ShowDialog();
                // Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                if (globalVariables.IsAdmin)
                {
                    Utility.ShowMsg(ex.ToString());
                }
            }
            finally
            {
                Utility.FreeMemory(crpt);
            }
        }
Ejemplo n.º 22
0
        private void INMAU2(bool view)
        {
            if (m_dataCT != null)
            {
                if (m_dataCT.Rows.Count <= 0 || m_dataCT.Columns.Count <= 0)
                {
                    return;
                }
                string         tieude = "", reportname = "";
                ReportDocument crpt = Utility.GetReport("BHYT_25A_CT_MAU2", ref tieude, ref reportname);
                if (crpt == null)
                {
                    return;
                }
                frmPrintPreview frmPrintView =
                    new frmPrintPreview("BÁO CÁO DANH SÁCH ĐỀ NGHỊ THANH TOÁN CHI PHÍ KCB NGOẠI TRÚ", crpt, false, true);
                Utility.UpdateLogotoDatatable(ref m_dataCT);
                frmPrintView.mv_sReportFileName = Path.GetFileName(reportname);
                frmPrintView.mv_sReportCode     = "BHYT_25A_CT_MAU2";
                crpt.SetDataSource(m_dataCT);

                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
                Utility.SetParameterValue(crpt, "Telephone", globalVariables.Branch_Phone);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "TITLE",
                                          Utility.DoTrim(baocaO_TIEUDE1.TIEUDE));
                Utility.SetParameterValue(crpt, "sCondition",

                                          "Từ ngày: " + dtpFromDate.Value.ToString("dd/MM/yyyy") + " đến ngày " +
                                          dtpToDate.Value.ToString("dd/MM/yyyy"));
                Utility.SetParameterValue(crpt, "TongTien", ChuyenDoiSoThanhChu());
                Utility.SetParameterValue(crpt, "NTN", Utility.FormatDateTimeWithThanhPho(dtpNgayIn.Value));
                frmPrintView.crptViewer.ReportSource = crpt;
                if (view)
                {
                    frmPrintView.ShowDialog();
                }
                else
                {
                    crpt.PrintOptions.PaperSize        = PaperSize.PaperLetter;
                    crpt.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
                    crpt.PrintToPrinter(1, false, 1, 1);
                }
            }
        }
Ejemplo n.º 23
0
        private void PrintViewNew14a(bool view)
        {
            if (mdtReport != null)
            {
                if (mdtReport.Rows.Count <= 0 || mdtReport.Columns.Count <= 0)
                {
                    return;
                }
                string         tieude = "", reportname = "";
                ReportDocument crpt = Utility.GetReport("BHYT_14A_MOI", ref tieude, ref reportname);
                if (crpt == null)
                {
                    return;
                }
                crpt.SetDataSource(mdtReport);
                frmPrintPreview objForm = new frmPrintPreview(Utility.DoTrim(baocaO_TIEUDE1.TIEUDE), crpt, true, mdtReport.Rows.Count <= 0 ? false : true);
                Utility.UpdateLogotoDatatable(ref mdtReport);
                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode     = "BHYT_14A_MOI";
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "sBangChu", sMoneyByLetter.sMoneyToLetter(SumOfTotal(mdtReport)));
                Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(dtPrintDate.Value));
                Utility.SetParameterValue(crpt, "title", baocaO_TIEUDE1.TIEUDE);
                string Condition = string.Format("Từ ngày {0} đến {1} - Đối tượng : {2} - Nhóm :{3}", dtpFromDate.Text, dtpToDate.Text,
                                                 cboObject.SelectedIndex > 0
                                      ? Utility.sDbnull(cboObject.Text)
                                      : "Tất cả",
                                                 txtNhomBHYT.myCode != "-1"? txtNhomBHYT.myCode: "Tất cả");
                Utility.SetParameterValue(crpt, "sCondition", Condition);

                //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "            Lập biểu                                     Trưởng phòng giám định BHYT                                  Trưởng phòng KHTC                                                Giám đốc".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
                objForm.crptViewer.ReportSource = crpt;
                if (view)
                {
                    objForm.ShowDialog();
                }
                else
                {
                    crpt.PrintOptions.PaperSize        = PaperSize.PaperLetter;
                    crpt.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
                    crpt.PrintToPrinter(1, false, 1, 1);
                }
            }
        }
        private void cmdINPHIEU_Click(object sender, EventArgs e)
        {
            try
            {
                dtPatient = null;//SPs.GtvtBaocaoSluongXetnghiemTheodoituong(dtpFromDate.Value.Date, dtpToDate.Value.Date).GetDataSet().Tables[0];
                if (dtPatient.Rows.Count < 0)
                {
                    Utility.ShowMsg("Không có dữ liệu để in");
                }
                else
                {
                    string s = "";

                    if (dtpFromDate.Value.Equals(dtpToDate.Value))
                    {
                        s = string.Format("{0}{1}", s,
                                          string.Format("Ngày {0}", dtpFromDate.Value.ToString("dd/MM/yyyy")));
                    }
                    else
                    {
                        s = string.Format("{0}{1}", s,
                                          string.Format("Từ ngày {0} đến ngày {1}",
                                                        dtpFromDate.Value.ToString("dd/MM/yyyy"),
                                                        dtpToDate.Value.ToString("dd/MM/yyyy")));
                    }
                    Utility.UpdateLogotoDatatable(ref dtPatient);
                    Lis.BaoCao.GTVT.CRPT_GTVT_BAOCAO_SLUONG_XETNGHIEM_THEODOITUONG crpt = new Lis.BaoCao.GTVT.CRPT_GTVT_BAOCAO_SLUONG_XETNGHIEM_THEODOITUONG();
                    var objForm = new frmPrintPreview("In Báo Cáo", crpt, true, true);
                    crpt.SetDataSource(dtPatient);

                    crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
                    crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
                    crpt.SetParameterValue("sTitleReport", label7.Text);
                    crpt.SetParameterValue("sTuNgayDenNgay", s);
                    crpt.SetParameterValue("sCurrentDate", Utility.FormatDateTime(dtNgayInPhieu.Value));
                    objForm.crptViewer.ReportSource = crpt;
                    objForm.ShowDialog();
                    Utility.DefaultNow(this);
                }
            }
            catch (Exception ex)
            {
                Utility.ShowMsg(ex.ToString());
            }
        }
Ejemplo n.º 25
0
        public static void Inphieuxuatthuockhoa(int IDPhieuNhap, string sTitleReport, DateTime NgayIn)
        {
            DataTable m_dtReport = SPs.ThuocLaythongtininphieuXuatkhothuoc(IDPhieuNhap).GetDataSet().Tables[0];

            if (m_dtReport.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không tìm thấy thông tin ", "Thông báo", MessageBoxIcon.Warning);
                return;
            }
            string tieude = "", reportname = "";
            var    crpt = Utility.GetReport("CRPT_PHIEUXUAT_KHOLE_TOIKHOA", ref tieude, ref reportname);


            var objForm = new frmPrintPreview(sTitleReport, crpt, true, true);

            Utility.UpdateLogotoDatatable(ref m_dtReport);
            try
            {
                m_dtReport.AcceptChanges();
                crpt.SetDataSource(m_dtReport);
                //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) +
                //"".Replace("#$X$#",
                //           Strings.Chr(34) + "&Chr(13)&" +
                //           Strings.Chr(34)) + Strings.Chr(34);
                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode     = "CRPT_PHIEUXUAT_KHOLE_TOIKHOA";

                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
                Utility.SetParameterValue(crpt, "sTitleReport", sTitleReport);
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                Utility.SetParameterValue(crpt, "txtTrinhky", Utility.getTrinhky(objForm.mv_sReportFileName, globalVariables.SysDate));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                // Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                if (globalVariables.IsAdmin)
                {
                    Utility.ShowMsg(ex.ToString());
                }
            }
        }
Ejemplo n.º 26
0
        public static void InphieuThanhly(int IDPhieuNhap, string sTitleReport, DateTime NgayIn)
        {
            DataTable m_dtReport = SPs.ThuocLaythongtininphieuXuatkhothuoc(IDPhieuNhap).GetDataSet().Tables[0];

            if (m_dtReport.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không tìm thấy thông tin ", "Thông báo", MessageBoxIcon.Warning);
                return;
            }
            MoneyByLetter _moneyByLetter = new MoneyByLetter();
            string        tinhtong       = TinhTong(m_dtReport, TPhieuNhapxuatthuocChitiet.ThanhTienColumn.ColumnName);

            THU_VIEN_CHUNG.CreateXML(m_dtReport, "thuoc_bienban_thanhly");
            string tieude = "", reportname = "";
            var    crpt = Utility.GetReport("thuoc_bienban_thanhly", ref tieude, ref reportname);


            Utility.UpdateLogotoDatatable(ref m_dtReport);
            var objForm = new frmPrintPreview(sTitleReport, crpt, true, true);

            try
            {
                m_dtReport.AcceptChanges();
                crpt.SetDataSource(m_dtReport);
                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode     = "thuoc_bienban_thanhly";

                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
                Utility.SetParameterValue(crpt, "sMoneyLetter", _moneyByLetter.sMoneyToLetter(tinhtong));
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                Utility.SetParameterValue(crpt, "txtTrinhky", Utility.getTrinhky(objForm.mv_sReportFileName, globalVariables.SysDate));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
            }
            catch (Exception ex)
            {
                if (globalVariables.IsAdmin)
                {
                    Utility.ShowMsg(ex.ToString());
                }
            }
        }
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         string s = "";
         if (dtpFromDate.Value.Date == dtpToDate.Value.Date)
         {
             s = string.Format(" Ngày {0} tháng {1} năm {2}", dtCreatePrint.Value.Day, dtCreatePrint.Value.Month, dtCreatePrint.Value.Year);
         }
         else
         {
             s = string.Format("{0}{1}", s,
                               string.Format("Thời gian từ ngày {0} đến ngày {1}", dtpFromDate.Value.ToString("dd/MM/yyyy"),
                                             dtpToDate.Value.ToString("dd/MM/yyyy")));
         }
         string tieude = "", reportname = "";
         string sTitleReport;
         var    crpt = new ReportDocument();
         if (chkTongBNHoanTatXN.Checked)
         {
             crpt = Utility.GetReport("crpt_BaoCaoSoLuongBN_TestType", ref tieude, ref reportname);
         }
         else
         {
             crpt = Utility.GetReport("crpt_BaoCaoSoLuongBN_TestType", ref tieude, ref reportname);
         }
         var oForm = new frmPrintPreview("Báo cáo thống kê số lượng bệnh nhân", crpt, true, dt.Rows.Count <= 0 ? false : true);
         Utility.UpdateLogotoDatatable(ref dt);
         crpt.SetDataSource(dt);
         oForm.crptTrinhKyName = Path.GetFileName(reportname);
         crpt.SetParameterValue("TongBenhNhan", dt.Rows.Count);
         crpt.SetParameterValue("TestType_Name", cboTestType.Text.ToUpper());
         crpt.SetParameterValue("strFromDateToDate", s);
         crpt.SetParameterValue("ParentBranchName", ManagementUnit.gv_sParentBranchName);
         crpt.SetParameterValue("BranchName", ManagementUnit.gv_sBranchName);
         crpt.SetParameterValue("sCurrentDate", dtCreatePrint.Value);
         oForm.crptViewer.ReportSource = crpt;
         oForm.ShowDialog();
         oForm.Dispose();
     }
     catch (Exception ex)
     {
         Utility.ShowMsg(ex.Message);
     }
 }
Ejemplo n.º 28
0
        /// <summary>
        /// hàm thực hiện in báo cáo
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdPrint_Click(object sender, EventArgs e)
        {
            m_dtReport =
                SPs.NhtdBaocaoSluongPkhamGuilen(
                    chkByDate.Checked ? dtFromDate.Value : Convert.ToDateTime("01/01/1900"),
                    chkByDate.Checked ? dtToDate.Value : DateTime.Now,
                    Utility.Int32Dbnull(cboDoiTuong.SelectedValue, -1), Utility.Int32Dbnull(cboLoaiXN.SelectedValue, -1),
                    Utility.Int32Dbnull(cboKhoa.SelectedValue, -1), Utility.Int32Dbnull(cboHosStatus.SelectedValue, -1),
                    Utility.sDbnull(cboLoaiBaoCao.SelectedValue, ""), Utility.sDbnull(cboNguoiDung.SelectedValue, "")).
                GetDataSet().Tables[0];
            if (m_dtReport.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không tìm thấy bản ghi nào", "Thông báo");
                return;
            }
            string sTungayDenNgay = dtFromDate.Value.Date != dtToDate.Value.Date
                                      ? string.Format("{0} --- đến --- {1}", Getsday(dtFromDate.Value),
                                                      Getsday(dtToDate.Value))
                                      : Getsday(dtFromDate.Value);

            Utility.WaitNow(this);
            CRPT_BAOCAO_SLUONG_XETNGHIEM crpt = new CRPT_BAOCAO_SLUONG_XETNGHIEM();//=  GetReportDocument(cboReportType.SelectedIndex,cboObjectType.SelectedIndex);
            frmPrintPreview objForm           = new frmPrintPreview("THỐNG KÊ TỔNG HỢP SỐ LƯỢNG XÉT NGHIỆM GỬI", crpt, true, true);

            try
            {
                crpt.SetDataSource(m_dtReport);
                crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "        NGƯỜI LẬP                                       THỦ TRƯỞNG ĐƠN VỊ           ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
                crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
                crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
                //   crpt.SetParameterValue("ReportCondition", GetReportCondition());
                crpt.SetParameterValue("sCurrentDate", Utility.FormatDateTime(dtCreateDate.Value));
                crpt.SetParameterValue("sTitleReport", sTitleReport);
                crpt.SetParameterValue("sTuNgayDenNgay", sTungayDenNgay);
                objForm.crptViewer.ReportSource = crpt;

                objForm.ShowDialog();
                // Utility.DefaultNow(this);
                Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                Utility.DefaultNow(this);
            }
        }
Ejemplo n.º 29
0
        private void PrintChitiet(bool view)
        {
            if (m_dataCT != null)
            {
                if (m_dataCT.Rows.Count <= 0 || m_dataCT.Columns.Count <= 0)
                {
                    return;
                }
                string         tieude = "", reportname = "";
                ReportDocument crpt = Utility.GetReport("BHYT_05A_CT", ref tieude, ref reportname);
                if (crpt == null)
                {
                    return;
                }
                frmPrintPreview frmPrintView =
                    new frmPrintPreview("BÁO CÁO BHYT 05A CHI TIẾT", crpt, true, true);
                Utility.UpdateLogotoDatatable(ref m_dataCT);
                frmPrintView.mv_sReportFileName = Path.GetFileName(reportname);
                frmPrintView.mv_sReportCode     = "BHYT_05A_CT";
                crpt.SetDataSource(m_dataCT);
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
                //Utility.SetParameterValue(crpt,"Telephone", globalVariables.Branch_Phone);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "TIEUDE",
                                          Utility.DoTrim(baocaO_TIEUDE1.TIEUDE));
                Utility.SetParameterValue(crpt, "DATETIME", "Từ ngày: " + dtpFromDate.Value.ToString("dd/MM/yyyy") + " đến ngày: " + dtpToDate.Value.ToString("dd/MM/yyyy"));

                Utility.SetParameterValue(crpt, "sTONGTIEN", ChuyenDoiSoThanhChu());
                Utility.SetParameterValue(crpt, "NGAYIN", Utility.FormatDateTimeWithThanhPho(dtpNgayIn.Value));

                frmPrintView.crptViewer.ReportSource = crpt;
                if (view)
                {
                    frmPrintView.ShowDialog();
                }
                else
                {
                    crpt.PrintOptions.PaperSize        = PaperSize.PaperA4;
                    crpt.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
                    crpt.PrintToPrinter(1, false, 1, 1);
                }
            }
        }
        public void KYDONG_INPHIEU_DICHVU(DataTable m_dtReportPhieuThu, DateTime NgayInPhieu, string sTitleReport, string khogiay)
        {
            Utility.UpdateLogotoDatatable(ref m_dtReportPhieuThu);
            ReportDocument reportDocument = new ReportDocument();
            string         tieude = "", reportname = "";

            switch (khogiay)
            {
            case "A4":
                reportDocument = Utility.GetReport("thanhtoan_Bienlai_Dichvu_A4", ref tieude, ref reportname);
                break;

            case "A5":
                reportDocument = Utility.GetReport("thanhtoan_13", ref tieude, ref reportname);
                break;
            }

            if (reportDocument == null)
            {
                return;
            }
            var crpt = reportDocument;

            decimal tong = m_dtReportPhieuThu.AsEnumerable().Sum(c => c.Field <decimal>("TONG_BN"));
            var     objForm = new frmPrintPreview("", crpt, true, true);

            //try
            //{
            crpt.SetDataSource(m_dtReportPhieuThu);
            //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "                                                                      ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
            Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
            Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
            Utility.SetParameterValue(crpt, "Telephone", globalVariables.Branch_Phone);
            Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
            //  Utility.SetParameterValue(crpt,"DateTime", Utility.FormatDateTime(dtCreateDate.Value));
            Utility.SetParameterValue(crpt, "CurrentDate", Utility.FormatDateTime(NgayInPhieu));
            Utility.SetParameterValue(crpt, "sTitleReport", sTitleReport);
            Utility.SetParameterValue(crpt, "sMoneyCharacter",
                                      new MoneyByLetter().sMoneyToLetter(Utility.sDbnull(tong)));
            Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
            objForm.crptViewer.ReportSource = crpt;
            objForm.ShowDialog();
        }
Ejemplo n.º 31
0
        private void INPHIEU_XETNGHIEM(bool IsQuick, string sTitleReport, DateTime NgayIn)
        {
            string strPatient_ID = string.Empty;
            var DTPrint = new DataTable();
            string vTestTypeId = GetCheckTestType();
            string vTestID = GetcheckTestID();
            if (vTestTypeId == "-1")
            {
                Utility.ShowMsg("Chưa chọn loại xét nghiệm để in");
                return;
            }

            if (grdList.GetCheckedRows().Length > 0)
            {
                foreach (GridEXRow gridExRow in grdList.GetCheckedRows())
                {
                    strPatient_ID += "," + Utility.Int32Dbnull(gridExRow.Cells["Patient_ID"].Value, -1);
                }
                strPatient_ID = strPatient_ID.Remove(0, 1);
            }
            else
            {
                strPatient_ID = Utility.sDbnull(grdList.GetValue("Patient_ID"));
            }
            DTPrint =
                SPs.GtvtGetTestResultForPrintV2FromDateToDate(strPatient_ID, vTestTypeId, vTestID,
                                                              dtFromDate.Date.ToShortDateString(),
                                                              dtToDate.Date.ToShortDateString()).GetDataSet().Tables[0];
            if (DTPrint.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không tìm thấy bản ghi nào", "Thông báo");
                return;
            }
            ProcessData(ref DTPrint);
            if (SysPara.IsNormalResult == 1)
            {
                string normalLevel = Utility.Int32Dbnull(DTPrint.Rows[0]["Sex"], 1) == 1
                                         ? "Normal_Level"
                                         : "Normal_LevelW";
                ProcessNormalResult(ref DTPrint);
                //ProcessNormalResult(ref DTPrint, "Test_result", normalLevel, -1, 1, 0,
                //                                            "binhthuong", false);
                foreach (DataRow row in DTPrint.Rows)
                {
                    if (
                        (row["Test_result"].ToString().Trim().ToUpper().StartsWith("ÂM"))
                        || (row["Test_result"].ToString().Trim().ToUpper().Contains("AM"))
                        )
                    {
                        row["binhthuong"] = -1;
                    }
                    else if (
                        (row["Test_result"].ToString().Trim().ToUpper().StartsWith("DƯƠ"))
                        || (row["Test_result"].ToString().Trim().ToUpper().Contains("DUO"))
                        )
                    {
                        row["binhthuong"] = 1;
                    }
                }
            }
            try
            {
                reporttype = File.ReadAllText(filereporttype);
                if (chkA5.Checked)
                {
                    StrCode = reporttype;
                }
                else if (chkA4.Checked)
                {
                    StrCode = reporttype;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Loz" + ex, "Thông báo");
            }

            //Tạo list loại xét nghiệm được tick chọn
            //CrptBusiness.testTypeList.Clear();
            //foreach (var row in grdTestType.GetCheckedRows())
            //{
            //    var a = row.Cells["TestType_ID"].Value;
            //    CrptBusiness.testTypeList.Add(Utility.Int32Dbnull(row.Cells["TestType_ID"].Value));
            //}
            string tieude = "", reportname = "";
            var crpt = Utility.GetReport("LAOKHOA_crpt_DetailTestReport_TESTTYPE", ref tieude, ref reportname);
            var objForm = new frmPrintPreview(sTitleReport, crpt, true, DTPrint.Rows.Count <= 0 ? false : true);
            Utility.UpdateLogotoDatatable(ref DTPrint);
            try
            {

                DTPrint.AcceptChanges();
                crpt.SetDataSource(DTPrint);
                objForm.crptViewer.ReportSource = crpt;
                ////crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "  PHÒNG TIẾP ĐÓN   ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
                objForm.crptTrinhKyName = Path.GetFileName(reportname);
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());

                objForm.ShowDialog();
                // Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                if (globalVariables.IsAdmin)
                {
                    Utility.ShowMsg(ex.ToString());
                }
            }
            //StrCode = reporttype.Trim();
            //// neu rpt A4 hoac A5 ma chua khai bao thi lay me no cai mac dinh(.)
            //if (StrCode == "")
            //{
            //    crptBusiness.StrCode = rdoNoheader.Checked ? "LABNOHEADER" : "LABREPORT";
            //}
            //else
            //{
            //    crptBusiness.StrCode = StrCode;
            //}
            //crptBusiness.FormPreviewTitle = "In kết quả xét nghiệm";
            //crptBusiness.Print(IsQuick, printDocument.PrinterSettings.PrinterName);
        }
Ejemplo n.º 32
0
        public void Print(bool Quick,string printerName)
        {
            string path = "";// =SystemReports.GetPathReport(StrCode);
            try
            {
                if (Crpt == null && !string.IsNullOrEmpty(StrCode))
                {

                    ReportDocument crptDocument=new ReportDocument();
                    crptDocument.Load(path);
                    Crpt = crptDocument; //GetCrptFromAssembly(StrCode);
                   // Crpt = GetCrptFromAssembly(StrCode);
                }

                if (ValidData())
                {
                    bool hasSubReport = CheckHasSubReport(Crpt);
                    var oForm = new frmPrintPreview("Phiếu KQ Xét nghiệm", Crpt, true, ReportSourceTable.Rows.Count <= 0 ? false : true);
                    oForm.crptTrinhKyName = Path.GetFileName(path);
                    if (!hasSubReport)
                    {
                        Crpt.SetDataSource(ReportSourceTable);
                        SetReportParameter(Crpt);
                       // var oForm = new frmPrintPreview(FormPreviewTitle, Crpt, true, true);

                    if (SysPara.ParamaterReport != null)
                        {
                            if (SysPara.ParamaterReport == "THANHNHAN")
                            {
                                var patientId = Utility.Int32Dbnull(ReportSourceTable.Rows[0]["Patient_ID"]);
                                var dtAssignDoctor =
                                    new Select(TTestInfo.Columns.AssignId, LUser.Columns.UserName).From(TTestInfo.Schema.Name).InnerJoin
                                        (LUser.UserIdColumn, TTestInfo.AssignIdColumn).Where(TTestInfo.Columns.PatientId).IsEqualTo(patientId).And(TTestInfo.Columns.TestTypeId).In(testTypeList).ExecuteDataSet().Tables[0];

                                if (dtAssignDoctor.Rows.Count > 0)
                                {

                                    Crpt.SetParameterValue("sBacSyChiDinh", "BÁC SỸ CHỈ ĐỊNH");
                                    Crpt.SetParameterValue("sTenBacSyChiDinh", Utility.sDbnull(dtAssignDoctor.Rows[0]["User_Name"]));
                                }
                                //else
                                //{
                                //    Crpt.SetParameterValue("sBacSyChiDinh", "");
                                //    Crpt.SetParameterValue("sTenBacSyChiDinh", "");
                                //}

                                var sFullName =
                                    new Select(SysUser.Columns.SFullName).From(SysUser.Schema.Name).Where(SysUser.Columns.PkSuid)
                                        .IsEqualTo(globalVariables.UserName).ExecuteScalar();
                                if (!string.IsNullOrEmpty(Utility.sDbnull(sFullName)))
                                {
                                    Crpt.SetParameterValue("sTenUser", sFullName);
                                }
                                //else
                                //{
                                //    Crpt.SetParameterValue("sTenUser","");
                                //}
                            }
                        }

                        oForm.crptViewer.ReportSource = Crpt;
                        // FieldObject mv_oRptFieldObj = Crpt.ReportDefinition.ReportObjects["Field150181"] as FieldObject;
                        // Crpt.PrintToPrinter();
                        if (Quick)
                        {
                            //    mv_oNguoiKy = new VietBaIT.LABLink.Reports.Class.cls_SignInfor(mv_oRptFieldObj, "", Crpt.ToString(), Crpt.DataDefinition.FormulaFields["Formula_1"].Text);
                            //  mv_oNguoiKy = new cls_SignInfor(Crpt.ToString(), "", ReportSourceTable);
                            //  mv_oNguoiKy = newcls_SignInfor(string.IsNullOrEmpty(oForm.crptTrinhKyName) , Crpt.ToString(),oForm.crptTrinhKyName, "", "");
                            mv_oNguoiKy = new cls_SignInfor_new(string.IsNullOrEmpty(oForm.crptTrinhKyName) ? oForm.crptTrinhKyName : oForm.crptTrinhKyName, "");
                            //      mv_oNguoiKy = newcls_SignInfor(" ", "", Crpt, ReportSourceTable);
                            //chkPrint_CheckedChanged(chkPrint, New System.EventArgs)
                            if (mv_oNguoiKy._TonTai)
                            {
                                Crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) +
                                                                                      mv_oNguoiKy.mv_NOI_DUNG.Replace(
                                                                                          "&NHANVIEN",
                                                                                          globalVariables.UserName)
                                                                                          .Replace("\t",
                                                                                              Strings.Chr(34) +
                                                                                              "&Chr(13)&" +
                                                                                              Strings.Chr(34)) +
                                                                                      Strings.Chr(34);
                            }
                            else
                            {
                                Crpt.DataDefinition.FormulaFields["Formula_1"].Text = "";
                            }
                            Crpt.PrintOptions.PrinterName = printerName;
                            Crpt.PrintToPrinter(0, true, 0, 0);
                            Crpt.Dispose();
                            CleanTemporaryFolders();
                        }
                        else
                        {
                            oForm.ShowDialog();
                            oForm.Dispose();
                        }
                    }
                    else
                    {
                        //DataTable dt = new Select().From(TblTrinhky.Schema.Name).Where(TblTrinhky.Columns.ReportName).
                        //                            IsEqualTo(Crpt.GetClassName()).ExecuteDataSet().Tables[0];

                        string sql = string.Format("SELECT * \n"
                                                   + "FROM   Sys_Trinhky With (NOLOCK) \n"
                                                   + "WHERE  ReportName = N'{0}'", oForm.crptTrinhKyName);

                        var x = new InlineQuery().ExecuteAsCollection<SysTrinhkyCollection>(sql);

                        if (x.Count > 0)
                            Utility.GetDataRow(ReportParameterTable, colName, "Formula_1")[colValue] = Strings.Chr(34) +
                                                                                                       Utility.sDbnull(
                                                                                                           x[0]
                                                                                                               .ObjectContent) +
                                                                                                       Strings.Chr(34);

                        Crpt.SetDataSource(ReportSourceTable);
                        SetReportParameter(Crpt);
                        if (!ReportSourceTable.Columns.Contains("ParentBranchName"))
                            ReportSourceTable.Columns.Add("ParentBranchName");
                        if (!ReportSourceTable.Columns.Contains("BranchName"))
                            ReportSourceTable.Columns.Add("BranchName");

                        DataTable dtHematology = ReportSourceTable.Clone();
                        DataTable dtOther = ReportSourceTable.Clone();
                        DataTable dtImages = ReportSourceTable.Clone();
                           string sql2 = string.Format("SELECT Sys_Users.sFullName \n"
                                                    + "FROM   Sys_Users  WITH (NOLOCK)  \n"
                                                    + "WHERE  Sys_Users.PK_sUID = '{0}'", globalVariables.UserName);

                        var objuserName = new InlineQuery().ExecuteScalar<string>(sql2);

                        string sNguoiDung = objuserName == null ? "" : objuserName;
                        foreach (DataRow row in ReportSourceTable.Rows)
                        {
                            row["ParentBranchName"] = globalVariables.ParentBranch_Name;
                            row["BranchName"] = globalVariables.Branch_Name;
                            row["Nguoidung"] = sNguoiDung;

                            if (row["isHematology"].ToString() == "1")
                            {
                                if (row["Data_Sequence"].ToString().Contains("-"))
                                {
                                    string pvSImgPath = row["Test_Result"].ToString();
                                    if (File.Exists(pvSImgPath))
                                    {
                                        //row["BarcodeImg"] = Utility.bytGetImage(pvSImgPath);
                                        var bitmap = new Bitmap(pvSImgPath);
                                        Invert(ref bitmap);
                                        row["BarcodeImg"] = Utility.ConvertImageToByteArray(bitmap, ImageFormat.Tiff);
                                        dtImages.ImportRow(row);
                                    }
                                }
                                else dtHematology.ImportRow(row);
                            }
                            else dtOther.ImportRow(row);
                        }

                        // đẹt me lam rieng cho noi tiet to su bo no(.)

                        // cho cai kho A5
                        if (StrCode == "A5")
                        {

                            Crpt.Subreports["NoiTiet_A5_General_crpt_DetailTestReport_ALL_New_Sub_Hematology_Images.rpt"
                                ].SetDataSource(dtImages);
                            Crpt.Subreports["NoiTiet_A5_General_crpt_DetailTestReport_ALL_New_Sub_Hematology.rpt"]
                                .SetDataSource(dtHematology);
                            Crpt.Subreports["NoiTiet_A5_General_crpt_DetailTestReport_ALL_New_Sub_Other.rpt"]
                                .SetDataSource(dtOther);
                            SetReportParameter(
                                Crpt.Subreports["NoiTiet_A5_General_crpt_DetailTestReport_ALL_New_Sub_Other.rpt"]);
                            SetReportParameter(
                                Crpt.Subreports["NoiTiet_A5_General_crpt_DetailTestReport_ALL_New_Sub_Hematology.rpt"]);
                            //Crpt.SetParameterValue("PrintDate", printDateTime, Crpt.Subreports["NoiTiet_A5_General_crpt_DetailTestReport_ALL_New_Sub_Hematology.rpt"].Name);
                            //Crpt.SetParameterValue("PrintDate", printDateTime, Crpt.Subreports["NoiTiet_A5_General_crpt_DetailTestReport_ALL_New_Sub_Other.rpt"].Name);

                            SetReportParameter(Crpt);
                        }
                            // cho cai kho A4
                        else if (StrCode == "A4")
                        {
                            SetReportParameter(
                                Crpt.Subreports["NoiTiet_A4_General_crpt_DetailTestReport_ALL_New_Sub_Other.rpt"]);
                            SetReportParameter(
                                Crpt.Subreports["NoiTiet_A4_General_crpt_DetailTestReport_ALL_New_Sub_Hematology.rpt"]);

                            Crpt.Subreports["NoiTiet_A4_General_crpt_DetailTestReport_ALL_New_Sub_Hematology_Images.rpt"
                                ].SetDataSource(dtImages);
                            Crpt.Subreports["NoiTiet_A4_General_crpt_DetailTestReport_ALL_New_Sub_Hematology.rpt"]
                                .SetDataSource(dtHematology);
                            Crpt.Subreports["NoiTiet_A4_General_crpt_DetailTestReport_ALL_New_Sub_Other.rpt"]
                                .SetDataSource(dtOther);
                            SetReportParameter(Crpt);
                            //  Crpt.SetParameterValue("Nguoidung", sNguoiDung);
                        }
                            //neu deo khai bao A4 hay A5 thi mac dinh lay cai nay nhung pai dung cai bao cao ko an cut no chay dc.
                        else if (StrCode == "LABREPORT")
                        {
                            SetReportParameter(
                                Crpt.Subreports["NoiTiet_A4_General_crpt_DetailTestReport_ALL_New_Sub_Other.rpt"]);
                            SetReportParameter(
                                Crpt.Subreports["NoiTiet_A4_General_crpt_DetailTestReport_ALL_New_Sub_Hematology.rpt"]);
                            Crpt.Subreports["NoiTiet_A4_General_crpt_DetailTestReport_ALL_New_Sub_Hematology_Images.rpt"
                                ].SetDataSource(dtImages);
                            Crpt.Subreports["NoiTiet_A4_General_crpt_DetailTestReport_ALL_New_Sub_Hematology.rpt"]
                                .SetDataSource(dtHematology);
                            Crpt.Subreports["NoiTiet_A4_General_crpt_DetailTestReport_ALL_New_Sub_Other.rpt"]
                                .SetDataSource(dtOther);
                            SetReportParameter(Crpt);
                        }
                      //  if (Quick) Crpt.PrintToPrinter(0, false, 0, 0);
                        if (Quick)
                        {
                            //    mv_oNguoiKy = new VietBaIT.LABLink.Reports.Class.cls_SignInfor(mv_oRptFieldObj, "", Crpt.ToString(), Crpt.DataDefinition.FormulaFields["Formula_1"].Text);
                            //  mv_oNguoiKy = new cls_SignInfor(Crpt.ToString(), "", ReportSourceTable);
                            //  mv_oNguoiKy = newcls_SignInfor(string.IsNullOrEmpty(oForm.crptTrinhKyName) , Crpt.ToString(),oForm.crptTrinhKyName, "", "");
                            mv_oNguoiKy =
                                new cls_SignInfor_new(
                                    string.IsNullOrEmpty(oForm.crptTrinhKyName)
                                        ? oForm.crptTrinhKyName
                                        : oForm.crptTrinhKyName, "");
                            //      mv_oNguoiKy = newcls_SignInfor(" ", "", Crpt, ReportSourceTable);
                            //chkPrint_CheckedChanged(chkPrint, New System.EventArgs)
                            if (mv_oNguoiKy._TonTai)
                            {
                                Crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) +
                                                                                      mv_oNguoiKy.mv_NOI_DUNG.Replace(
                                                                                          "&NHANVIEN",
                                                                                          globalVariables.UserName)
                                                                                          .Replace("\t",
                                                                                              Strings.Chr(34) +
                                                                                              "&Chr(13)&" +
                                                                                              Strings.Chr(34)) +
                                                                                      Strings.Chr(34);
                            }
                            else
                            {
                                Crpt.DataDefinition.FormulaFields["Formula_1"].Text = "";
                            }

                            Crpt.PrintOptions.PrinterName = printerName;
                            Crpt.PrintToPrinter(0, true, 0, 0);
                            Crpt.Dispose();
                            CleanTemporaryFolders();
                        }
                        else
                        {
                          //  var oForm = newfrmPrintPreview("Phiếu KQ Xét nghiệm", Crpt, true, ReportSourceTable.Rows.Count <= 0 ? false : true);
                         //   oForm.crptTrinhKyName = Path.GetFileName(path);

                            oForm.ShowDialog();
                            oForm.Dispose();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ShowMsg(ex.Message);
            }
        }
Ejemplo n.º 33
0
        private void INPHIEU_XETNGHIEM(bool IsQuick, string sTitleReport, DateTime NgayIn)
        {
            string strPatient_ID = string.Empty;
            var DTPrint = new DataTable();
            string vTestTypeId; //= GetCheckTestType();
            string vTestID;//= GetcheckTestID();
            string Test_ID = "-1";
            string TestType = "-1";
            foreach (GridEXRow gridExRow in grdTestType.GetCheckedRows())
            {
                TestType += "," + Utility.sDbnull(gridExRow.Cells[TTestTypeList.Columns.TestTypeId].Value, "-1");
                Test_ID += "," + Utility.sDbnull(gridExRow.Cells[TTestInfo.Columns.TestId].Value, "-1");
            }
            vTestTypeId = TestType;
            vTestID = Test_ID;
            if (vTestTypeId == "-1")
            {
                Utility.ShowMsg("Chưa chọn loại xét nghiệm để in");
                return;
            }


            strPatient_ID = Utility.sDbnull(grdTestType.GetValue("Patient_ID"));

            DTPrint =
                SPs.GtvtGetTestResultForPrintV2FromDateToDate(strPatient_ID, vTestTypeId, vTestID, dtFromDate.ToShortDateString(),
                                                              dtToDate.ToShortDateString()).GetDataSet().Tables[0];
            if (DTPrint.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không tìm thấy bản ghi nào", "Thông báo");
                return;
            }
            ProcessData(ref DTPrint);
            if (SysPara.IsNormalResult == 1)
            {
                string normalLevel = Utility.Int32Dbnull(DTPrint.Rows[0]["Sex"], 1) == 1
                                         ? "Normal_Level"
                                         : "Normal_LevelW";
                ProcessNormalResult(ref DTPrint);
                //ProcessNormalResult(ref DTPrint, "Test_result", normalLevel, -1, 1, 0,
                //                                            "binhthuong", false);
                foreach (DataRow row in DTPrint.Rows)
                {
                    if (
                        (row["Test_result"].ToString().Trim().ToUpper().StartsWith("ÂM"))
                        || (row["Test_result"].ToString().Trim().ToUpper().Contains("AM"))
                        )
                    {
                        row["binhthuong"] = -1;
                    }
                    else if (
                        (row["Test_result"].ToString().Trim().ToUpper().StartsWith("DƯƠ"))
                        || (row["Test_result"].ToString().Trim().ToUpper().Contains("DUO"))
                        )
                    {
                        row["binhthuong"] = 1;
                    }
                }
            }
            //try
            //{
            //    reporttype = File.ReadAllText(filereporttype);
            //    if (chkA5.Checked)
            //    {
            //        StrCode = reporttype;
            //    }
            //    else if (chkA4.Checked)
            //    {
            //        StrCode = reporttype;
            //    }
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show("Loz" + ex, "Thông báo");
            //}

            string tieude = "", reportname = "";
            var crpt = Utility.GetReport("crpt_InPhieuKetQuaXetNghiem", ref tieude, ref reportname);
            var objForm = new frmPrintPreview(sTitleReport, crpt, true, DTPrint.Rows.Count <= 0 ? false : true);
            Utility.UpdateLogotoDatatable(ref DTPrint);
            try
            {
                DTPrint.AcceptChanges();
                crpt.SetDataSource(DTPrint);
                objForm.crptViewer.ReportSource = crpt;
                ////crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "  PHÒNG TIẾP ĐÓN   ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
                objForm.crptTrinhKyName = Path.GetFileName(reportname);
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                //Utility.SetParameterValue(crpt, "sCurrentDate", dtpDatePrint(NgayIn));
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                if (IsQuick)
                {
                    objForm.ShowDialog();
                    // Utility.DefaultNow(this);
                }
                else
                {
                    objForm.addTrinhKy_OnFormLoad();
                    crpt.PrintOptions.PrinterName = printDocument.PrinterSettings.PrinterName;
                    crpt.PrintToPrinter(0, true, 0, 0);
                    crpt.Dispose();
                    CleanTemporaryFolders();
                }
            }
            catch (Exception ex)
            {
                if (globalVariables.IsAdmin)
                {
                    Utility.ShowMsg(ex.ToString());
                }
            }

        }
        private void ReportDepartmentVnio(DataTable m_dsReport)
        {
            //ds_dailyDetailTestReport.dtDailyDetailTestReportDataTable DT = new ds_dailyDetailTestReport.dtDailyDetailTestReportDataTable();
            string sTungayDenNgay = Getsday(Convert.ToDateTime(dtpFromDate.Text)) + " --- đến --- " +
                                    Getsday(Convert.ToDateTime(dtpTodate.Text));

            if (!InvaliData(_dsReport)) return;
            var crpt = new crpt_DailyTestReportDepartment();
            var objForm = new frmPrintPreview("", crpt, true, true);
            try
            {
                crpt.SetDataSource(m_dsReport);
                //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) +
                //                                                      "    Nhân viên                                                                   "
                //                                                          .Replace("#$X$#",
                //                                                                   Strings.Chr(34) + "&Chr(13)&" +
                //                                                                   Strings.Chr(34)) + Strings.Chr(34);
                crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
                crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
                //crpt.SetParameterValue("ShowGroup", "1");
                crpt.SetParameterValue("sTungayDenNgay", sTungayDenNgay);
                // crpt.SetParameterValue("TotalTest", intGetTotalTest( DT));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
                Utility.DefaultNow(this);
            }
            catch (Exception ex)
            {
                Utility.DefaultNow(this);
            }
        }
Ejemplo n.º 35
0
        private void InPhieuChiDinh(bool IsQuick, string sTitleReport, DateTime NgayIn)
        {
            int strPatient_ID = -1;
            var DTPrint = new DataTable();
            string vTestTypeId = GetCheckTestType();
            string vTestID = GetcheckTestID();
            if (vTestTypeId == "-1")
            {
                Utility.ShowMsg("Chưa chọn loại xét nghiệm để in");
                return;
            }

            //if (grdList.GetCheckedRows().Length > 0)
            //{
            //    foreach (GridEXRow gridExRow in grdList.GetCheckedRows())
            //    {
            //        strPatient_ID += "," + Utility.Int32Dbnull(gridExRow.Cells["Patient_ID"].Value, -1);
            //    }
            //    strPatient_ID = strPatient_ID.Remove(0, 1);
            //}
            //else
            {
                strPatient_ID = Utility.Int32Dbnull(grdList.GetValue("Patient_ID"));
            }
            DTPrint =
                SPs.InPhieuChiDinhXetNghiem(strPatient_ID, vTestTypeId, vTestID).GetDataSet().Tables[0];
             if (DTPrint.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không tìm thấy bản ghi nào", "Thông báo");
                return;
            }
            string tieude = "", reportname = "";
            var crpt = Utility.GetReport("crpt_InPhieuChiDinhXetNghiem", ref tieude, ref reportname);
            var objForm = new frmPrintPreview(sTitleReport, crpt, true, DTPrint.Rows.Count <= 0 ? false : true);
            Utility.UpdateLogotoDatatable(ref DTPrint);
            Utility.AddColumToDataTable(ref DTPrint, "BarcodeImg", typeof(byte[]));
            foreach (DataRow dr in DTPrint.Rows)
            {
                dr["BarcodeImg"] =
                    Utility.GenerateBarCode(
                        BarcodeInfo.CreateNewBarcode(Utility.sDbnull(dr["Barcode"], "0000000000")));
            }
          try
            {
                DTPrint.AcceptChanges();
                crpt.SetDataSource(DTPrint);
                objForm.crptViewer.ReportSource = crpt;
                objForm.crptTrinhKyName = Path.GetFileName(reportname);
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
                Utility.SetParameterValue(crpt, "sTitleReport", sTitleReport);
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                if (!IsQuick)
                {
                   
                    objForm.ShowDialog();
                    // Utility.DefaultNow(this);
                }
                else
                {
                    objForm.addTrinhKy_OnFormLoad();
                    crpt.PrintOptions.PrinterName = printDocument.PrinterSettings.PrinterName;
                    crpt.PrintToPrinter(0, true, 0, 0);
                    crpt.Dispose();
                    CleanTemporaryFolders();
                }
            }
            catch (Exception ex)
            {
                
                    Utility.ShowMsg(ex.ToString());
              
            }
       
        }
Ejemplo n.º 36
0
 private void cmdINPHIEU_Click(object sender, EventArgs e)
 {
     try
     {
         string s = "";
         if (dtpFromDate.Value.Date == dtpToDate.Value.Date)
         {
             s = string.Format("{0}Ngày {1}", s, dtpFromDate.Value.ToString("dd/MM/yyyy"));
         }
         else
         {
             s = string.Format("{0}{1}", s,
                               string.Format("Từ ngày {0} đến ngày {1}", dtpFromDate.Value.ToString("dd/MM/yyyy"),
                                             dtpToDate.Value.ToString("dd/MM/yyyy")));
         }
         var crpt = new VD_crpt_DailyParamTestReport();
         var oForm = new frmPrintPreview("In Báo cáo lưu", crpt, true, true);
         crpt.SetDataSource(dt);
         crpt.DataDefinition.FormulaFields["Formula_1"].Text = "";
         //crpt.SetParameterValue("sTenKhoa", sTenKhoa);
         crpt.SetParameterValue("TongSoBenhNhan", dt.Rows.Count);
         crpt.SetParameterValue("sFromDateToDate", s);
         crpt.SetParameterValue("ParentBranchName", lablinkhelper.Utilities.gv_sParentBranchName );
         crpt.SetParameterValue("BranchName", Utilities.gv_sBranchName);
         //crpt.SetParameterValue("Address", ManagementUnit.gv_sAddress);
         //crpt.SetParameterValue("sPhone", ManagementUnit.gv_sPhone);
         crpt.SetParameterValue("sPrintDate", dtCreatePrint.Value.ToString("dd/MM/yyyy"));
         oForm.crptViewer.ReportSource = crpt;
         oForm.ShowDialog();
         oForm.Dispose();
     }
     catch (Exception ex)
     {
         Utility.ShowMsg(ex.Message);
     }
 }