Пример #1
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);
            //}
        }
Пример #2
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);
                }
            }
        }
        /// <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);
            //}
        }
        /// <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);
            //}
        }
Пример #5
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());
                }
            }
        }
Пример #6
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());
                }
            }
        }
Пример #7
0
        public static void InphieuXuatkho_2lien(int IDPhieuNhap, string sTitleReport, DateTime NgayIn)
        {
            try
            {
                DataTable dataTable = SPs.ThuocLaydulieuinphieuchuyenkho2lien(IDPhieuNhap).GetDataSet().Tables[0];

                if (dataTable.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(dataTable, "THANHTIEN_XUAT");
                THU_VIEN_CHUNG.CreateXML(dataTable, "thuoc_phieu_xuatkho_2lien.xml");
                string tieude = "", reportname = "", reportCode = "";
                reportCode = THU_VIEN_CHUNG.Laygiatrithamsohethong("THUOC_INPHIEUXUATKHO_2LIEN", "0", false) == "1"
                                ? "thuoc_phieu_xuatkho_2lien"
                                : "thuoc_phieu_xuatkho_1lien";
                var crpt = Utility.GetReport(reportCode, ref tieude, ref reportname);
                if (crpt != null)
                {
                    frmPrintPreview objForm = new frmPrintPreview(sTitleReport, crpt, true, true);
                    Utility.UpdateLogotoDatatable(ref dataTable);
                    crpt.SetDataSource(dataTable);
                    objForm.mv_sReportFileName = Path.GetFileName(reportname);
                    objForm.mv_sReportCode     = reportCode;
                    Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                    Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                    Utility.SetParameterValue(crpt, "sTitleReport", sTitleReport);
                    Utility.SetParameterValue(crpt, "sMoneyLetter", _moneyByLetter.sMoneyToLetter(tinhtong));
                    Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTime(globalVariables.SysDate));
                    Utility.SetParameterValue(crpt, "txtTrinhky", Utility.getTrinhky(objForm.mv_sReportFileName, globalVariables.SysDate));
                    objForm.crptViewer.ReportSource = crpt;
                    objForm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi khi in báo cáo InphieuXuatkho_2lien()-->\n" + ex.Message);
                return;
            }
        }
        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);
               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.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());

               objForm.ShowDialog();
               // Utility.DefaultNow(this);
               }
               catch (Exception ex)
               {
               if (globalVariables.IsAdmin)
               {
                   Utility.ShowMsg(ex.ToString());
               }
               }
        }
        /// <summary>
        /// hàm thực hiên viecj in báo cáo doanh thu tiền khám chữa bệnh viện phí
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdInPhieuXN_Click(object sender, EventArgs e)
        {
            _mabschidinh = "-1";
            _idThuoc     = -1;
            // Lấy Id Bác sỹ
            if (!string.IsNullOrEmpty(cboBacSyChiDinh.Text))
            {
                var query = (from chk in cboBacSyChiDinh.CheckedValues.AsEnumerable()
                             let x = Utility.sDbnull(chk)
                                     select x).ToArray();
                if (query.Count() > 0)
                {
                    _mabschidinh = string.Join(",", query);
                }
            }

            //Truyền dữ liệu vào datatable
            DataTable m_dtReport = BAOCAO_THUOC.ThuocBaocaoTinhhinhkedonthuocTheobacsy(Utility.Int32Dbnull(cboStock.SelectedValue, -1), Utility.Int32Dbnull(cboDoiTuong.SelectedValue, -1),
                                                                                       _mabschidinh, _idThuoc, chkByDate.Checked ? dtFromDate.Value : Convert.ToDateTime("01/01/1900"), chkByDate.Checked ? dtToDate.Value : globalVariables.SysDate, Utility.Int16Dbnull(cboTrangthai.SelectedValue, -1));

            if (m_dtReport == null)
            {
                return;
            }
            THU_VIEN_CHUNG.CreateXML(m_dtReport, "thuoc_baocaokedon_theobacsy.xml");
            //Kiểm tra dữ liệu
            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;
            }
            //Truyền tổng tiền vào text và chuyển qua tiền bằng chữ
            Janus.Windows.GridEX.GridEXColumn gridExColumnTong = grdList.RootTable.Columns["thanh_tien"];
            decimal tong =
                Utility.DecimaltoDbnull(grdList.GetTotal(gridExColumnTong, Janus.Windows.GridEX.AggregateFunction.Sum));


            m_dtReport.AcceptChanges();
            Utility.UpdateLogotoDatatable(ref m_dtReport);
            //Truyền dữ liệu vào datagrid-view
            Utility.SetDataSourceForDataGridEx(grdList, m_dtReport, false, true, "1=1", "");
            //Lấy chuỗi condition truyền vào biến ?FromDateToDate trên crpt
            string Condition = string.Format("Từ ngày {0} đến {1}- Đối tượng {2} - Thuộc kho :{3} - Bác sỹ: {4}", dtFromDate.Text, dtToDate.Text,
                                             cboDoiTuong.SelectedIndex > 0
                                                 ? Utility.sDbnull(cboDoiTuong.SelectedValue)
                                                 : "Tất cả",
                                             cboStock.SelectedIndex > 0
                                                 ? Utility.sDbnull(cboStock.SelectedValue)
                                                 : "Tất cả",
                                             string.IsNullOrEmpty(cboBacSyChiDinh.Text) ? "Tất cả" : cboBacSyChiDinh.Text);

            //Lấy tên người tạo báo cáo và gọi crpt
            string StaffName = globalVariables.gv_strTenNhanvien;
            string tieude = "", reportname = "";
            var    crpt = Utility.GetReport("thuoc_baocaokedon_theobacsy", ref tieude, ref reportname);

            if (crpt == null)
            {
                return;
            }
            if (string.IsNullOrEmpty(globalVariables.gv_strTenNhanvien))
            {
                StaffName = globalVariables.UserName;
            }
            try
            {
                frmPrintPreview objForm = new frmPrintPreview(baocaO_TIEUDE1.TIEUDE, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);
                crpt.SetDataSource(m_dtReport);

                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode     = "thuoc_baocaokedon_theobacsy";
                Utility.SetParameterValue(crpt, "StaffName", StaffName);
                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", baocaO_TIEUDE1.TIEUDE);
                Utility.SetParameterValue(crpt, "TienBangChu", _moneyByLetter.sMoneyToLetter(tong.ToString()));
                Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(dtNgayInPhieu.Value));
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                Utility.SetParameterValue(crpt, "Department_Name", globalVariables.KhoaDuoc);
                Utility.SetParameterValue(crpt, "txtTrinhky", Utility.getTrinhky(objForm.mv_sReportFileName, globalVariables.SysDate));
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
            }
            catch (Exception exception)
            {
            }
        }
Пример #10
0
        void cmdIn_Click(object sender, EventArgs e)
        {
            try
            {
                if (objLuotkham==null)
                {
                    Utility.ShowMsg("Bạn cần chọn bệnh nhân in phiếu tạm ứng");
                    return;
                }
                if (grdTamung.GetDataRows().Count() <= 0)
                {
                    Utility.ShowMsg("Bạn cần chọn phiếu tạm ứng muốn in");
                    return;
                }
                if (!Utility.isValidGrid(grdTamung))
                {

                    grdTamung.MoveFirst();

                }
                DataTable m_dtReport = noitru_TamungHoanung.NoitruInphieutamung(Utility.Int64Dbnull(Utility.GetValueFromGridColumn(grdTamung, NoitruTamung.Columns.Id), -1));
                THU_VIEN_CHUNG.CreateXML(m_dtReport, "noitru_phieutamung.xml");
                if (m_dtReport.Rows.Count <= 0)
                {
                    Utility.ShowMsg("Không tìm thấy dữ liệu", "Thông báo", MessageBoxIcon.Warning);
                    return;
                }
                string tieude = "", reportname = "";
                var crpt = Utility.GetReport("noitru_phieutamung", ref tieude, ref reportname);
                if (crpt == null) return;

                MoneyByLetter _moneyByLetter = new MoneyByLetter();
                var objForm = new frmPrintPreview(tieude, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);
                Utility.UpdateLogotoDatatable(ref m_dtReport);

                crpt.SetDataSource(m_dtReport);

                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode = "noitru_phieutamung";
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
                Utility.SetParameterValue(crpt, "TelePhone", globalVariables.Branch_Phone);
                Utility.SetParameterValue(crpt, "sMoneyLetter", _moneyByLetter.sMoneyToLetter(Utility.Int32Dbnull(m_dtReport.Compute("SUM(so_tien)", "1=1"), 0).ToString()));
                Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(DateTime.Now));
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                objForm.crptViewer.ReportSource = crpt;

                if (Utility.isPrintPreview(PropertyLib._MayInProperties.TenMayInBienlai, PropertyLib._MayInProperties.PreviewPhieuTamung))
                {
                    objForm.SetDefaultPrinter(PropertyLib._MayInProperties.TenMayInBienlai, 0);
                    objForm.ShowDialog();
                }
                else
                {
                    objForm.addTrinhKy_OnFormLoad();
                    crpt.PrintOptions.PrinterName = PropertyLib._MayInProperties.TenMayInBienlai;
                    crpt.PrintToPrinter(objForm.getPrintNumber, false, 0, 0);
                }

            }
            catch (Exception)
            {
            }
        }
Пример #11
0
        public void INPHOI_BHYT(DataTable mDtReportPhieuThu, DateTime ngayIn, KcbLuotkham objPatientExam)
        {
            Utility.UpdateLogotoDatatable(ref mDtReportPhieuThu);
            THU_VIEN_CHUNG.NoiTru_Sapxepthutuin(ref mDtReportPhieuThu, true);
            mDtReportPhieuThu.DefaultView.Sort = "stt_in,stt_hthi_dichvu,stt_hthi_chitiet,stt_in_thuoc,ten_chitietdichvu";
            mDtReportPhieuThu.AcceptChanges();

            string tieude = "", reportname = "";
            var    crpt = Utility.GetReport("BHYT_InPhoi_02", ref tieude, ref reportname);

            // VMS.HISLink.Report.Report.BHYT_InPhoi crpt = new VMS.HISLink.Report.Report.BHYT_InPhoi();
            // tieude = "BẢNG KÊ CHI PHÍ KHÁM BỆNH, CHỮA BỆNH NGOẠI TRÚ";
            //reportname = "BHYT_InPhoi.RPT".ToUpper();
            if (crpt == null)
            {
                return;
            }
            var objForm = new frmPrintPreview(tieude, crpt, true, true);

            objForm.NGAY = _ngayinphieu;
            try
            {
                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode     = "BHYT_InPhoi_02";
                crpt.SetDataSource(mDtReportPhieuThu.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, "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, "sMoneyCharacter_Thanhtien",
                                          sMoneyByLetter.sMoneyToLetter(
                                              SumOfTotal_BH(mDtReportPhieuThu, "TT_KHONG_PHUTHU").ToString(CultureInfo.InvariantCulture)));
                Utility.SetParameterValue(crpt, "sMoneyCharacter_Thanhtien_BH",
                                          sMoneyByLetter.sMoneyToLetter(
                                              SumOfTotal_BH(mDtReportPhieuThu, "TT_BHYT").ToString(CultureInfo.InvariantCulture)));
                Utility.SetParameterValue(crpt, "sMoneyCharacter_Thanhtien_BN",
                                          sMoneyByLetter.sMoneyToLetter(
                                              SumOfTotal_BH(mDtReportPhieuThu, "TT_BN").ToString(CultureInfo.InvariantCulture)));
                Utility.SetParameterValue(crpt, "sMoneyCharacter_Thanhtien_Khac",
                                          sMoneyByLetter.sMoneyToLetter(
                                              SumOfTotal_BH(mDtReportPhieuThu, "TT_PHUTHU").ToString(CultureInfo.InvariantCulture)));
                Utility.SetParameterValue(crpt, "txtTrinhky", Utility.getTrinhky(objForm.mv_sReportFileName, _ngayinphieu));
                objForm.crptViewer.ReportSource = crpt;


                if (Utility.isPrintPreview(PropertyLib._MayInProperties.TenMayInBienlai, PropertyLib._MayInProperties.PreviewInPhoiBHYT))
                {
                    objForm.SetDefaultPrinter(PropertyLib._MayInProperties.TenMayInBienlai, 0);
                    if (objForm.ShowDialog() == DialogResult.OK)
                    {
                        //Tự động khóa BN để kết thúc
                        new Update(KcbLuotkham.Schema)
                        .Set(KcbLuotkham.Columns.NgayKetthuc).EqualTo(globalVariables.SysDate)
                        .Set(KcbLuotkham.Columns.NguoiKetthuc).EqualTo(globalVariables.UserName)
                        .Set(KcbLuotkham.Columns.Locked).EqualTo(1)
                        .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(objPatientExam.MaLuotkham)
                        .And(KcbLuotkham.Columns.IdBenhnhan).IsEqualTo(objPatientExam.IdBenhnhan).Execute();
                    }
                }
                else
                {
                    //Tự động khóa BN để kết thúc
                    new Update(KcbLuotkham.Schema)
                    .Set(KcbLuotkham.Columns.NgayKetthuc).EqualTo(globalVariables.SysDate)
                    .Set(KcbLuotkham.Columns.NguoiKetthuc).EqualTo(globalVariables.UserName)
                    .Set(KcbLuotkham.Columns.Locked).EqualTo(1)
                    .Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(objPatientExam.MaLuotkham)
                    .And(KcbLuotkham.Columns.IdBenhnhan).IsEqualTo(objPatientExam.IdBenhnhan).Execute();
                    objForm.addTrinhKy_OnFormLoad();
                    crpt.PrintOptions.PrinterName = PropertyLib._MayInProperties.TenMayInBienlai;
                    crpt.PrintToPrinter(1, false, 0, 0);
                }
            }
            catch (Exception ex)
            {
                Utility.CatchException(ex);
            }
            finally
            {
                Utility.FreeMemory(crpt);
            }
        }
Пример #12
0
        public static void Baocaothuochethan(DataTable m_dtReport, string sTitleReport, DateTime NgayIn, string FromDateToDate)
        {
            MoneyByLetter _moneyByLetter = new MoneyByLetter();
               string tieude="", reportname = "";
              ReportDocument crpt = Utility.GetReport("thuoc_baocao_thuochethan" ,ref tieude,ref reportname);
              if (crpt == null) return;
              var objForm = new frmPrintPreview(sTitleReport, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);
              string tinhtong = TinhTong(m_dtReport, "thanhtien");
              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_baocao_thuochethan";
              objForm.crptViewer.ReportSource = crpt;

              Utility.SetParameterValue(crpt,"ParentBranchName", globalVariables.ParentBranch_Name);
              Utility.SetParameterValue(crpt,"BranchName", globalVariables.Branch_Name);
              Utility.SetParameterValue(crpt,"FromDateToDate", FromDateToDate);
              Utility.SetParameterValue(crpt,"KhoaPhong", globalVariables.KhoaDuoc);
              Utility.SetParameterValue(crpt,"sMoneyLetter", _moneyByLetter.sMoneyToLetter(tinhtong));
              Utility.SetParameterValue(crpt,"TongSoTien", tinhtong);

              Utility.SetParameterValue(crpt,"sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
              Utility.SetParameterValue(crpt,"sTitleReport", sTitleReport);
              Utility.SetParameterValue(crpt,"BottomCondition", THU_VIEN_CHUNG.BottomCondition());
              objForm.crptViewer.ReportSource = crpt;
              objForm.ShowDialog();
              // Utility.DefaultNow(this);
              }
              catch (Exception ex)
              {
              if (globalVariables.IsAdmin)
              {
                  Utility.ShowMsg(ex.ToString());
              }
              }
        }
Пример #13
0
        public static void BaocaoNhapxuattonTheoquy(DataTable m_dtReport, string kieuthuoc_vt, string sTitleReport, string _tondau,string _toncuoi,DateTime NgayIn, string FromDateToDate, string tenkho, bool theonhom)
        {
            string tieude = "", reportname = "", reportcode = "thuoc_baocao_nhapxuatton_theoquy_theonhom";
              ReportDocument crpt = null;
              if (kieuthuoc_vt == "THUOC")
              {
              if (theonhom)
              {
                  reportcode = "thuoc_baocao_nhapxuatton_theoquy_theonhom";
                  crpt = Utility.GetReport("thuoc_baocao_nhapxuatton_theoquy_theonhom", ref tieude, ref reportname);
              }
              else
              {
                  reportcode = "thuoc_baocao_nhapxuatton_theoquy";
                  crpt = Utility.GetReport("thuoc_baocao_nhapxuatton_theoquy", ref tieude, ref reportname);
              }
              }
              else//VTTH
              {
              if (theonhom)
              {
                  reportcode = "vt_baocao_nhapxuatton_theoquy_theonhom";
                  crpt = Utility.GetReport("vt_baocao_nhapxuatton_theoquy_theonhom", ref tieude, ref reportname);
              }
              else
              {
                  reportcode = "vt_baocao_nhapxuatton_theoquy";
                  crpt = Utility.GetReport("vt_baocao_nhapxuatton_theoquy", ref tieude, ref reportname);
              }
              }
              if (crpt == null) return;

              MoneyByLetter _moneyByLetter = new MoneyByLetter();
              string tinhtong = TinhTong(m_dtReport, "TT_TONCUOI");
              // VNS.HIS.UI.BaoCao.PhieuBaoCao.CRPT_BAOCAO_CHITIET_NHAPKHO crpt = new CRPT_BAOCAO_CHITIET_NHAPKHO();
              var objForm = new frmPrintPreview(sTitleReport, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);
              objForm.mv_sReportFileName = Path.GetFileName(reportname);
              objForm.mv_sReportCode = reportcode;
              Utility.UpdateLogotoDatatable(ref m_dtReport);
              try
              {
              if (theonhom)
                  m_dtReport.DefaultView.Sort = "stt_hthi_nhom,tenbietduoc";
              else
                  m_dtReport.DefaultView.Sort = "tenbietduoc";
              m_dtReport.AcceptChanges();
              crpt.SetDataSource(m_dtReport.DefaultView);
              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);
              Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
              Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
              Utility.SetParameterValue(crpt, "Phone", globalVariables.Branch_Phone);

              Utility.SetParameterValue(crpt,"ParentBranchName", globalVariables.ParentBranch_Name);
              Utility.SetParameterValue(crpt, "Tondau", _tondau);
              Utility.SetParameterValue(crpt, "Toncuoi", _toncuoi);
              Utility.SetParameterValue(crpt, "FromDateToDate", FromDateToDate);
              Utility.SetParameterValue(crpt, "Department_Name", globalVariables.KhoaDuoc);
              Utility.SetParameterValue(crpt, "tenkho", tenkho);
              Utility.SetParameterValue(crpt, "thanhtien_bangchu", _moneyByLetter.sMoneyToLetter(tinhtong.ToString()));
              Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
              Utility.SetParameterValue(crpt, "sTitleReport", sTitleReport);
              Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());

              objForm.ShowDialog();
              // Utility.DefaultNow(this);
              }
              catch (Exception ex)
              {
              if (globalVariables.IsAdmin)
              {
                  Utility.ShowMsg(ex.ToString());
              }
              }
        }
Пример #14
0
        public static void BaocaoNhapkhoChitiet(DataTable m_dtReport,string tenbaocao, string sTitleReport, DateTime NgayIn, string FromDateToDate)
        {
            string tieude = "", reportname = "";
            var crpt = Utility.GetReport(tenbaocao, ref tieude, ref reportname);
            if (crpt == null) return;

            MoneyByLetter _moneyByLetter = new MoneyByLetter();
               // VNS.HIS.UI.BaoCao.PhieuBaoCao.CRPT_BAOCAO_CHITIET_NHAPKHO crpt = new CRPT_BAOCAO_CHITIET_NHAPKHO();
            var objForm = new frmPrintPreview(sTitleReport, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);
            string tinhtong = TinhTong(m_dtReport);
            Utility.UpdateLogotoDatatable(ref m_dtReport);
            try
            {

                crpt.SetDataSource(m_dtReport);
                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.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode = tenbaocao;
                Utility.SetParameterValue(crpt,"ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt,"BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt,"FromDateToDate", FromDateToDate);
                Utility.SetParameterValue(crpt,"sMoneyLetter", _moneyByLetter.sMoneyToLetter(tinhtong));
               //  frmPrintPreview objForm = new frmPrintPreview("", crpt, true, strPatientCode == null ? false : true);
                //  Utility.SetParameterValue(crpt,"TongTien", Total.ToString());
                //Utility.SetParameterValue(crpt,"characterMoney", MoneyByLetter.sMoneyToLetter(Total.ToString()));
                //Utility.SetParameterValue(crpt,"TongTien","10000");
                //Utility.SetParameterValue(crpt,"Staff_Name", BusinessHelper.GetNameByUserName(globalVariables.UserName));
                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());
                }
            }
        }
        public static void InphieuXuatkho_2lien(int IDPhieuNhap, string sTitleReport, DateTime NgayIn)
        {
            try
               {
               DataTable dataTable = SPs.ThuocLaydulieuinphieuchuyenkho2lien(IDPhieuNhap).GetDataSet().Tables[0];

               if (dataTable.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(dataTable, "THANHTIEN_XUAT");
               THU_VIEN_CHUNG.CreateXML(dataTable, "thuoc_phieu_xuatkho_2lien.xml");
               string tieude = "", reportname = "", reportCode = "";
               reportCode=THU_VIEN_CHUNG.Laygiatrithamsohethong("THUOC_INPHIEUXUATKHO _2LIEN", "0", false) == "1" ? "thuoc_phieu_xuatkho_2lien" : "thuoc_phieu_xuatkho_1lien";
               var crpt = Utility.GetReport(reportCode, ref tieude, ref reportname);
               if (crpt != null)
               {

                   frmPrintPreview objForm = new frmPrintPreview(sTitleReport, crpt, true, true);
                   Utility.UpdateLogotoDatatable(ref dataTable);
                   crpt.SetDataSource(dataTable);
                   objForm.mv_sReportFileName = Path.GetFileName(reportname);
                   objForm.mv_sReportCode = reportCode;
                  Utility.SetParameterValue(crpt,"BranchName", globalVariables.Branch_Name);
                  Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                  Utility.SetParameterValue(crpt, "sTitleReport", sTitleReport);
                  Utility.SetParameterValue(crpt, "sMoneyLetter", _moneyByLetter.sMoneyToLetter(tinhtong));
                  Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTime(globalVariables.SysDate));
                  objForm.ShowDialog();
               }
               }
               catch (Exception ex)
               {
               Utility.ShowMsg("Lỗi khi in báo cáo InphieuXuatkho_2lien()-->\n"+ex.Message);
               return;
               }
        }
Пример #16
0
        public static void baocao_nhapthuoctheo_nhacungcap(DataTable m_dtReport,string tenbaocao, string sTitleReport, DateTime NgayIn, string FromDateToDate)
        {
            MoneyByLetter _moneyByLetter = new MoneyByLetter();
              string tieude = "", reportname = "";
              var crpt = Utility.GetReport(tenbaocao, ref tieude, ref reportname);
              if (crpt == null) return;

            //  VNS.HIS.UI.BaoCao.Reports.CRPT_PHIEU_BIENBAN_BANGIAO_HOADON crpt = new CRPT_PHIEU_BIENBAN_BANGIAO_HOADON();
              var objForm = new frmPrintPreview(sTitleReport, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);
              string tinhtong = TinhTong(m_dtReport,"thanhtien");
              Utility.UpdateLogotoDatatable(ref m_dtReport);
              try
              {

              m_dtReport.AcceptChanges();
              crpt.SetDataSource(m_dtReport);
              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.mv_sReportFileName = Path.GetFileName(reportname);
              objForm.mv_sReportCode = tenbaocao;
              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", FromDateToDate);
              Utility.SetParameterValue(crpt,"Department_Name", globalVariables.KhoaDuoc);
              Utility.SetParameterValue(crpt,"sMoneyLetter", _moneyByLetter.sMoneyToLetter(tinhtong));
              Utility.SetParameterValue(crpt,"TongSoTien", tinhtong);

              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());
              }
              }
        }
        public static void InphieuHuythuoc(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_huythuoc");
               string tieude = "", reportname = "";
               var crpt = Utility.GetReport("thuoc_bienban_huythuoc", 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_huythuoc";
               objForm.crptViewer.ReportSource = crpt;
               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());
               objForm.ShowDialog();
               }
               catch (Exception ex)
               {
               if (globalVariables.IsAdmin)
               {
                   Utility.ShowMsg(ex.ToString());
               }
               }
        }
Пример #18
0
        public static void BaocaohuythuocChitiet(DataTable m_dtReport,string tenbaocao, string sTitleReport, DateTime NgayIn, string FromDateToDate)
        {
            string tieude = "", reportname = "";
              var crpt = Utility.GetReport(tenbaocao, ref tieude, ref reportname);
              if (crpt == null) return;

              MoneyByLetter _moneyByLetter = new MoneyByLetter();
              var objForm = new frmPrintPreview(sTitleReport, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);
              string tinhtong = TinhTong(m_dtReport);
              Utility.UpdateLogotoDatatable(ref m_dtReport);
              try
              {

              crpt.SetDataSource(m_dtReport);
              objForm.crptViewer.ReportSource = crpt;

              objForm.mv_sReportFileName = Path.GetFileName(reportname);
              objForm.mv_sReportCode = tenbaocao;
              Utility.SetParameterValue(crpt,"ParentBranchName", globalVariables.ParentBranch_Name);
              Utility.SetParameterValue(crpt,"BranchName", globalVariables.Branch_Name);
              Utility.SetParameterValue(crpt,"FromDateToDate", FromDateToDate);
              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());
              objForm.ShowDialog();
              // Utility.DefaultNow(this);
              }
              catch (Exception ex)
              {
              if (globalVariables.IsAdmin)
              {
                  Utility.ShowMsg(ex.ToString());
              }
              }
        }
Пример #19
0
        void cmdIn_Click(object sender, EventArgs e)
        {
            try
            {
                if (objLuotkham == null)
                {
                    Utility.ShowMsg("Bạn cần chọn bệnh nhân in phiếu tạm ứng");
                    return;
                }
                if (grdTamung.GetDataRows().Count() <= 0)
                {
                    Utility.ShowMsg("Bạn cần chọn phiếu tạm ứng muốn in");
                    return;
                }
                if (!Utility.isValidGrid(grdTamung))
                {
                    grdTamung.MoveFirst();
                }
                DataTable m_dtReport = noitru_TamungHoanung.NoitruInphieutamung(Utility.Int64Dbnull(Utility.GetValueFromGridColumn(grdTamung, NoitruTamung.Columns.Id), -1));
                THU_VIEN_CHUNG.CreateXML(m_dtReport, "noitru_phieutamung.xml");
                if (m_dtReport.Rows.Count <= 0)
                {
                    Utility.ShowMsg("Không tìm thấy dữ liệu", "Thông báo", MessageBoxIcon.Warning);
                    return;
                }
                string tieude = "", reportname = "";
                var    crpt = Utility.GetReport("noitru_phieutamung", ref tieude, ref reportname);
                if (crpt == null)
                {
                    return;
                }

                MoneyByLetter _moneyByLetter = new MoneyByLetter();
                var           objForm        = new frmPrintPreview(tieude, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true);
                Utility.UpdateLogotoDatatable(ref m_dtReport);

                crpt.SetDataSource(m_dtReport);


                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode     = "noitru_phieutamung";
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
                Utility.SetParameterValue(crpt, "TelePhone", globalVariables.Branch_Phone);
                Utility.SetParameterValue(crpt, "sMoneyLetter", _moneyByLetter.sMoneyToLetter(Utility.Int32Dbnull(m_dtReport.Compute("SUM(so_tien)", "1=1"), 0).ToString()));
                Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(DateTime.Now));
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                objForm.crptViewer.ReportSource = crpt;

                if (Utility.isPrintPreview(PropertyLib._MayInProperties.TenMayInBienlai, PropertyLib._MayInProperties.PreviewPhieuTamung))
                {
                    objForm.SetDefaultPrinter(PropertyLib._MayInProperties.TenMayInBienlai, 0);
                    objForm.ShowDialog();
                }
                else
                {
                    objForm.addTrinhKy_OnFormLoad();
                    crpt.PrintOptions.PrinterName = PropertyLib._MayInProperties.TenMayInBienlai;
                    crpt.PrintToPrinter(objForm.getPrintNumber, false, 0, 0);
                }
            }
            catch (Exception)
            {
            }
        }
Пример #20
0
        private void InphieuDv()
        {
            foreach (GridEXRow GridEXRow in grdTestInfo.GetCheckedRows())
            {
                xmen += "," + Utility.sDbnull(GridEXRow.Cells["id_chidinh"].Value, -1);
            }
            idDichvu = xmen.Remove(0, 1);
            int patient_id = Utility.Int32Dbnull(grdTestInfo.GetValue("id_benhnhan"));
            // KcbChidinhcl objAssignInfo = KcbChidinhcl.FetchByID(v_AssignId);
            DataTable dt = SPs.DLayThongTinBNChiDinhDV(idDichvu, patient_id).GetDataSet().Tables[0];

            if (dt == null || dt.Rows.Count <= 0)
            {
                Utility.ShowMsg("Không có dữ liệu in. Mời bạn kiểm tra lại");
                return;
            }
            //THU_VIEN_CHUNG.CreateXML(dt, "Thamkham_InphieuCLS.XML");
            Utility.UpdateLogotoDatatable(ref dt);
            //Utility.CreateBarcodeData(ref dt, v_AssignCode);

            idDichvu = "";
            string KhoGiay = "A5";
            bool inchung = false;
            string tieude = "", reportname = "";
            MoneyByLetter _moneyByLetter = new MoneyByLetter();
            var tinhtong = Utility.sDbnull(TinhTong(dt, KcbChidinhclsChitiet.DonGiaColumn.ColumnName));
            var smstinh = dt.Compute("SUM(TT_PHUTHU)","");
            string tongcong = Utility.sDbnull(TinhTong(dt, "tongcong"));
            string thanhtien = Utility.sDbnull(TinhTong(dt, "thanhtien"));
              //  int tongcong = Utility.Int16Dbnull(tinhtong )+ Utility.Int16Dbnull(smstinh);
            var crpt = Utility.GetReport("thanhtoan_Bienlai_Dichvu_A5", ref tieude, ref reportname);
            var objForm = new frmPrintPreview("IN PHIẾU THANH TOAN", crpt, true, true);
            try
            {
                //Utility.AddColumToDataTable(ref dt,"TinhTong",typeof(string));
                //   foreach (DataRow  drRow in dt.Rows)
                //   {
                //       drRow["tinhtong"] = tinhtong;
                //   }
                //   dt.AcceptChanges();
                crpt.SetDataSource(dt);
                //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "    Nhân viên        Bác sĩ chỉ định     ".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, "Telephone", globalVariables.Branch_Phone);
                Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
                Utility.SetParameterValue(crpt, "CurrentDate", Utility.FormatDateTimeWithLocation(globalVariables.SysDate, globalVariables.gv_strDiadiem));
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                Utility.SetParameterValue(crpt, "tinhtong", tinhtong);
                Utility.SetParameterValue(crpt, "tongcong", tongcong);
                Utility.SetParameterValue(crpt, "thanhtien", thanhtien);

                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                Utility.SetParameterValue(crpt, "sMoneyCharacter", _moneyByLetter.sMoneyToLetter(Utility.sDbnull(tinhtong)));
                objForm.crptViewer.ReportSource = crpt;
                objForm.SetDefaultPrinter(PropertyLib._MayInProperties.TenMayInBienlai, 0);
                objForm.ShowDialog();

                objForm.Dispose();
                //  mayin = PropertyLib._MayInProperties.TenMayInBienlai;
                //}
                //else
                //{
                //    objForm.addTrinhKy_OnFormLoad();
                //    crpt.PrintOptions.PrinterName = PropertyLib._MayInProperties.TenMayInBienlai;
                //    //mayin = PropertyLib._MayInProperties.TenMayInBienlai;
                //    crpt.PrintToPrinter(1, false, 0, 0);
                //}
            }
            catch (Exception ex)
            {
                Utility.DefaultNow(this);
            }
        }