public static void Baocaohuychot(DataTable m_dtReport, string kieuthuoc_vt, string sTitleReport,  string dieukienbaocao, bool theonhom)
        {
            string tieude = "", reportname = "", reportcode = "thuoc_baocao_huychot_theonhom";
              ReportDocument crpt = null;
              if (kieuthuoc_vt .Contains("THUOC"))
              {
              if (theonhom)
              {
                  reportcode = "thuoc_baocao_huychot_theonhom";
              }
              else
              {
                  reportcode = "thuoc_baocao_huychot";
              }
              }
              else//VTTH
              {
              if (theonhom)
              {
                  reportcode = "vt_baocao_huychot_theonhom";
              }
              else
              {
                  reportcode = "vt_baocao_huychot";
              }
              }
              crpt = Utility.GetReport(reportcode, 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);
              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);

              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, "dieukienbaocao", dieukienbaocao);
              Utility.SetParameterValue(crpt, "sTitleReport", tieude);
              Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
              Utility.SetParameterValue(crpt, "txttrinhky","");
              objForm.crptViewer.ReportSource = crpt;
              objForm.ShowDialog();
              // Utility.DefaultNow(this);
              }
              catch (Exception ex)
              {
              Utility.CatchException(ex);
              }
        }
        public static void Inphieunhapvien(DataTable m_dtReport, string sTitleReport, DateTime NgayIn)
        {
            string tieude = "", reportname = "";
            var crpt = Utility.GetReport("noitru_phieunhapvien", ref tieude, ref reportname);
            if (crpt == null) return;
            THU_VIEN_CHUNG.CreateXML(m_dtReport, "noitru_phieunhapvien.xml");
            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.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode = "noitru_phieunhapvien";
                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.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
            }
            catch (Exception ex)
            {
                if (globalVariables.IsAdmin)
                {
                    Utility.ShowMsg(ex.ToString());
                }
            }
        }
Exemple #3
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());
                }
            }
        }
Exemple #4
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());
                }
            }
        }
Exemple #5
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 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";

               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.crptViewer.ReportSource = crpt;
               objForm.ShowDialog();
               }
               catch (Exception ex)
               {
               if (globalVariables.IsAdmin)
               {
                   Utility.ShowMsg(ex.ToString());
               }
               }
        }
Exemple #7
0
        public static void InBanCamKetPhauThuat(DataTable mDtReport, string sTitleReport, DateTime ngayIn)
        {
            string         tieude = "", reportname = "";
            ReportDocument crpt = Utility.GetReport("noitru_giaycamketPT_A5", ref tieude, ref reportname);

            if (crpt == null)
            {
                return;
            }
            THU_VIEN_CHUNG.CreateXML(mDtReport, "noitru_giaycamketPT_A5.xml");
            var moneyByLetter = new MoneyByLetter();
            var objForm       = new frmPrintPreview(sTitleReport, crpt, true, mDtReport.Rows.Count > 0);

            // string tinhtong = TinhTong(m_dtReport);
            Utility.UpdateLogotoDatatable(ref mDtReport);
            try
            {
                crpt.SetDataSource(mDtReport);


                objForm.mv_sReportFileName = Path.GetFileName(reportname);
                objForm.mv_sReportCode     = "noitru_giaycamketPT_A5";
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "CurrentDate", Utility.FormatDateTimeWithThanhPho(ngayIn));
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
                objForm.crptViewer.ReportSource = crpt;
                objForm.ShowDialog();
            }
            catch (Exception ex)
            {
                if (globalVariables.IsAdmin)
                {
                    Utility.ShowMsg(ex.ToString());
                }
            }
        }
Exemple #8
0
        public static void Thethuoctutruc(DataTable m_dtReport, string kieuthuoc_vt, string sTitleReport, DateTime NgayIn, string FromDateToDate, string tenkho)
        {
            string tieude = "", reportname = "";
              var crpt = Utility.GetReport(kieuthuoc_vt == "THUOC" ? "thuoc_thethuoc_tutruc" : "vt_thevt_tutruc", 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);
              try
              {

              m_dtReport.AcceptChanges();
              crpt.SetDataSource(m_dtReport);
              objForm.crptViewer.ReportSource = crpt;
              objForm.mv_sReportFileName = Path.GetFileName(reportname);
              objForm.mv_sReportCode = kieuthuoc_vt == "THUOC" ? "thuoc_thethuoc_tutruc" : "vt_thevt_tutruc";
              //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,"BranchName", globalVariables.Branch_Name);
              Utility.SetParameterValue(crpt, "FromDateToDate", FromDateToDate);
              Utility.SetParameterValue(crpt, "Department_Name", globalVariables.KhoaDuoc);
              Utility.SetParameterValue(crpt, "tenkho", tenkho);
              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());
              }
              }
        }
Exemple #9
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());
              }
              }
        }
Exemple #10
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());
              }
              }
        }
Exemple #11
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());
              }
              }
        }
        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());
               }
               }
        }
        public static void BaocaotinhinhsudungVacxin(DataTable m_dtReport, string kieuthuoc_vt, string sTitleReport, string _tondau, string _toncuoi, DateTime NgayIn, string FromDateToDate, string tenkho, bool theonhom)
        {
            string tieude = "", reportname = "", reportcode = "vacxin_baocao_tinhinhsudung_theonhom";
              ReportDocument crpt = null;

              if (theonhom)
              {
              reportcode = "vacxin_baocao_tinhinhsudung_theonhom";
              }
              else
              {
              reportcode = "vacxin_baocao_tinhinhsudung";
              }
              crpt = Utility.GetReport(reportcode, 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);
              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);
              Utility.SetParameterValue(crpt, "Tondau", _tondau);
              Utility.SetParameterValue(crpt, "Toncuoi", _toncuoi);
              Utility.SetParameterValue(crpt, "FromDateToDate", FromDateToDate);
              Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
              Utility.SetParameterValue(crpt, "sTitleReport", tieude);
              Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
              objForm.crptViewer.ReportSource = crpt;
              objForm.ShowDialog();
              }
              catch (Exception ex)
              {
              Utility.CatchException(ex);
              }
        }
        public static void BaocaoPhanungnangSautiemchung(DataTable m_dtReport, DateTime NgayIn, string FromDateToDate, bool theonhom)
        {
            string tieude = "", reportname = "", reportcode = "vacxin_baocao_phanungnang_sautiemchung";
              ReportDocument crpt = null;

              if (theonhom)
              {
              reportcode = "vacxin_baocao_phanungnang_sautiemchung_theonhom";
              }
              else
              {
              reportcode = "vacxin_baocao_phanungnang_sautiemchung";
              }
              crpt = Utility.GetReport(reportcode, 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);
              objForm.mv_sReportFileName = Path.GetFileName(reportname);
              objForm.mv_sReportCode = reportcode;
              Utility.UpdateLogotoDatatable(ref m_dtReport);
              try
              {
              if (theonhom)
                  m_dtReport.DefaultView.Sort = "stt_hthi_loaithuoc,ten_benhnhan,tenthuoc_bietduoc";
              else
                  m_dtReport.DefaultView.Sort = "ten_benhnhan,tenthuoc_bietduoc";
              m_dtReport.AcceptChanges();
              crpt.SetDataSource(m_dtReport.DefaultView);
              Utility.SetParameterValue(crpt, "FromDateToDate", FromDateToDate);
              Utility.SetParameterValue(crpt, "ten_donvi", globalVariables.Branch_Name);
              Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
              Utility.SetParameterValue(crpt, "sTitleReport", tieude);
              Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition());
              objForm.crptViewer.ReportSource = crpt;
              objForm.ShowDialog();
              }
              catch (Exception ex)
              {
              Utility.CatchException(ex);
              }
        }
        /// <summary>
        ///  hàm thực hiện vie báo cáo xuất nhập tồn kho lẻ
        /// </summary>
        /// <param name="m_dtReport"></param>
        /// <param name="sTitleReport"></param>
        /// <param name="NgayIn"></param>
        /// <param name="FromDateToDate"></param>
        /// <param name="tenkho"></param>
        public static void BaocaoNhapxuattonKhole(DataTable m_dtReport,string kieuthuoc_vt, string sTitleReport, DateTime NgayIn, string FromDateToDate, string tenkho,bool Nhomthuoc)
        {
            string tieude = "", reportname = "", reportcode="";
              ReportDocument crpt = null;
              if (kieuthuoc_vt.Contains("THUOC"))
              {
              if (Nhomthuoc)
              {
                  reportcode = "thuoc_baocao_nhapxuattonkhole_theonhom";
                  crpt = Utility.GetReport("thuoc_baocao_nhapxuattonkhole_theonhom", ref tieude, ref reportname);
              }
              else
              {
                  reportcode = "thuoc_baocao_nhapxuattonkhole";
                  crpt = Utility.GetReport("thuoc_baocao_nhapxuattonkhole", ref tieude, ref reportname);
              }
              }
              else
              {
              if (Nhomthuoc)
              {
                  reportcode = "vt_baocao_nhapxuattonkhole_theonhom";
                  crpt = Utility.GetReport("vt_baocao_nhapxuattonkhole_theonhom", ref tieude, ref reportname);
              }
              else
              {
                  reportcode = "vt_baocao_nhapxuattonkhole";
                  crpt = Utility.GetReport("vt_baocao_nhapxuattonkhole", 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);
              Utility.UpdateLogotoDatatable(ref m_dtReport);
              try
              {

              m_dtReport.AcceptChanges();
              crpt.SetDataSource(m_dtReport);

              objForm.mv_sReportFileName = Path.GetFileName(reportname);
              objForm.mv_sReportCode = reportcode;
              //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,"BranchName", globalVariables.Branch_Name);
              Utility.SetParameterValue(crpt,"FromDateToDate", FromDateToDate);
              Utility.SetParameterValue(crpt,"Department_Name", globalVariables.KhoaDuoc);
              Utility.SetParameterValue(crpt,"tenkho", tenkho);
              Utility.SetParameterValue(crpt,"sCurrentDate", Utility.FormatDateTimeWithThanhPho(NgayIn));
              Utility.SetParameterValue(crpt,"sTitleReport", tieude);
              Utility.SetParameterValue(crpt,"BottomCondition", THU_VIEN_CHUNG.BottomCondition());
              objForm.crptViewer.ReportSource = crpt;
              objForm.ShowDialog();
              // Utility.DefaultNow(this);
              }
              catch (Exception ex)
              {
              Utility.CatchException(ex);
              }
        }
Exemple #16
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());
              }
              }
        }
Exemple #17
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)
            {
            }
        }
Exemple #18
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;
               }
        }
Exemple #20
0
        public static void BaocaoNhapxuattonKhochanTheonhom(DataTable m_dtReport, string sTitleReport, DateTime NgayIn, string FromDateToDate, string tenkho)
        {
            string tieude = "", reportname = "";
              var crpt = Utility.GetReport("CRPT_BAOCAO_SLUONG_NHAPXUAT_TON_KHOCHAN_NHOM_LOAI", 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
              {

              m_dtReport.AcceptChanges();
              crpt.SetDataSource(m_dtReport);
              objForm.crptViewer.ReportSource = crpt;
              objForm.mv_sReportFileName = Path.GetFileName(reportname);
              objForm.mv_sReportCode = "CRPT_BAOCAO_SLUONG_NHAPXUAT_TON_KHOCHAN_NHOM_LOAI";
              //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,"BranchName", globalVariables.Branch_Name);
              Utility.SetParameterValue(crpt,"FromDateToDate", FromDateToDate);
              Utility.SetParameterValue(crpt,"Department_Name", globalVariables.KhoaDuoc);
              Utility.SetParameterValue(crpt,"tenkho", tenkho);
              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());
              }
              }
        }
Exemple #21
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)
            {
            }
        }
Exemple #22
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);
            }
        }