private void sbChiTietBaoCao_Click(object sender, EventArgs e)
        {
            BaoCaoNhapHang bc = new BaoCaoNhapHang();

            DataTable dt = gcChiTietBaoCao.DataSource as DataTable;
            if (dt != null && dt.Rows.Count > 0)
            {
                bc.ChiTietBaoCao = gcChiTietBaoCao.DataSource as DataTable;
                bc.ThoiGian = ((DateTime)deThoiGian.EditValue).ToString("MM/dd/yyyy");
                XRBaoCaoNhapHang BCTonKho = new XRBaoCaoNhapHang(bc);
                try
                {
                    BCTonKho.CreateDocument();
                }
                catch (Exception ex)
                {

                }
                ReportPrintTool printTool = new ReportPrintTool(BCTonKho);
                printTool.ShowPreviewDialog();
            }
            else
            {
                MessageBox.Show("Danh Sách Báo Cáo Trống",
                   "Thông Báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            }
        }
Ejemplo n.º 2
0
 private void barkodYazdir()
 {
     int x = 1;
     etiketler.Clear();
     foreach (string item in listboxLabel.Items)
     {
         Etiket s = new Etiket();
         s.ID = x;
         s.Barkod = item;
         etiketler.Add(s);
         x++;
     }
     if (MessageBox.Show(string.Format("{0} adet barkod bulundu. Yazdırılacak emin misiniz ?", etiketler.Count), "Yazdırma", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
     {
         rptBarkod Rapor = new rptBarkod();
         Rapor.DataSource = etiketler;
         Rapor.PageWidth = (int)spWidth.Value;
         Rapor.PageHeight = (int)spHeight.Value;
         ReportPrintTool reportPrintTool = new ReportPrintTool(Rapor);
         reportPrintTool.ShowPreviewDialog();
     }
     else
     {
         return;
     }
 }
        private void simpleButton2_Click(object sender, EventArgs e)
        {
            BaoCaoBangHang bc = new BaoCaoBangHang();
            DataTable dt = gcKetQua.DataSource as DataTable;
            if (dt != null && dt.Rows.Count > 0)
            {
                bc.Data = gcKetQua.DataSource as DataTable;
                bc.MaNhanVien = this.teMaNhanVien.Text;
                bc.TenNhanVien = this.teNhanVien.Text;
                bc.TuNgay = this.dateTuNgay.Text;
                bc.DenNgay = this.dateDienNgay.Text;

                XRLapBaoCaoBanHang BCTonKho = new XRLapBaoCaoBanHang(bc);
                try
                {
                    BCTonKho.CreateDocument();
                }
                catch (Exception ex)
                {

                }
                ReportPrintTool printTool = new ReportPrintTool(BCTonKho);
                printTool.ShowPreviewDialog();
            }
            else
            {
                MessageBox.Show("Danh Sách Báo Cáo Trống",
                   "Thông Báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            }
        }
Ejemplo n.º 4
0
        private void btnListeYazdir_Click(object sender, EventArgs e)
        {
            if (gvListe.FocusedRowHandle < 0) return;

              ReportPrintTool pt1 = new ReportPrintTool(
            InitReport(InitData())
            );
              pt1.ShowPreviewDialog();
        }
Ejemplo n.º 5
0
        public override void ExecuteReport()
        {
            base.ExecuteReport();

            var sh = cbShop.Properties.Items.GetCheckedValues();
            var tbShop = new DataTable();
            tbShop.Columns.Add("Id", typeof(string));
            sh.ForEach(x => tbShop.Rows.Add(x));

            var sp = cbSupplier.Properties.Items.GetCheckedValues();
            var tbSuppl = new DataTable();
            tbSuppl.Columns.Add("Id", typeof(string));
            sp.ForEach(x => tbSuppl.Rows.Add(x));

            var sg = cbGroup.Properties.Items.GetCheckedValues();
            var tbGp = new DataTable();
            tbGp.Columns.Add("Id", typeof(string));
            sg.ForEach(x => tbGp.Rows.Add(x));

            string suppl = string.Join(", ", sp);
            string group = string.Join(", ", sg);

            try
            {
                Parameter.Connection.Open();
                using (
                    var command = new SqlCommand("rep_sel_OrederByShop", Parameter.Connection)
                                      {CommandType = CommandType.StoredProcedure, CommandTimeout = 60000})
                {
                    command.Parameters.AddWithValue("@dateBeg", dateBeg.DateTime.Date);
                    command.Parameters.AddWithValue("@dateEnd", dateEnd.DateTime.Date);
                    command.Parameters.AddWithValue("@ShopCodes", tbShop);

                    command.Parameters.AddWithValue("@Suppliers", tbSuppl);
                    command.Parameters.AddWithValue("@GoodGroups", tbGp);

                    var rep = new XtraReport1() {DataAdapter = new SqlDataAdapter(command)};
                    rep.Parameters["pDate"].Value = string.Format("Период: {0} по {1}", dateBeg.DateTime.Date.ToShortDateString(), dateEnd.DateTime.Date.ToShortDateString());

                    rep.Parameters["pGroup"].Value = string.Format("Товарная группа: {0}", string.IsNullOrEmpty(group) ? "Все" : group);
                    rep.Parameters["pSuppl"].Value = string.Format("Поставщик: {0}", string.IsNullOrEmpty(suppl) ? "Все" : suppl);

                    var reportPrintTool = new ReportPrintTool(rep) {AutoShowParametersPanel = false};
                    reportPrintTool.ShowPreviewDialog();
                }
            }
            finally
            {
                Parameter.Connection.Close();
            }

            //MessageBox.Show("ExecuteReport " + table.Rows.Count.ToString());
        }
Ejemplo n.º 6
0
    private void btnPreview_Click(object sender, EventArgs e)
    {
      Properties.Settings.Default.PrintFontName = (string)this.fontEdit1.EditValue;
      Properties.Settings.Default.PrintFontSize = this.spinFontSize.Value;
      Properties.Settings.Default.PrintSortByName = this.rbSortByNumber.Checked;
      Properties.Settings.Default.Save();

      using (var font = new Font(this.fontEdit1.Text, (float)this.spinFontSize.Value))
      using (var report = new ChannelListReport(this.channelList, this.subListIndex, this.rbSortByName.Checked, font))
      using (ReportPrintTool printTool = new ReportPrintTool(report))
      {
        printTool.ShowPreviewDialog();
        printTool.ShowPreview(UserLookAndFeel.Default);
      }
    }
Ejemplo n.º 7
0
        private void navBarKisilerListesi_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            SiteDBEntities2 db   = new SiteDBEntities2();
            XtraReport1     rpt  = new XtraReport1();
            var             list = db.S_KisilerListesi().ToList();

            rpt.DataSource = list;
            using (ReportPrintTool printTool = new ReportPrintTool(rpt))
            {
                // Invoke the Print Preview form modally,
                // and load the report document into it.
                printTool.ShowPreviewDialog();
                Cursor.Current = Cursors.Default;
                // Invoke the Print Preview form
                // with the specified look and feel setting.
                //printTool.ShowPreviewDialog(UserLookAndFeel.Default);
            }
        }
Ejemplo n.º 8
0
        private void ticariFaturaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Kayit edilmis olmali
            var view = afbGridView;

            if (!view.IsDataRow(view.FocusedRowHandle))
            {
                return;
            }

            int      AFBid = (int)view.GetFocusedRowCellValue(colAFBIDb);
            FaturaXR rpr   = new FaturaXR(AFBid, antetToolStripComboBox.Text, Program.USR);

            using (ReportPrintTool printTool = new ReportPrintTool(rpr))
            {
                printTool.PrintingSystem.SetCommandVisibility(PrintingSystemCommand.Watermark, CommandVisibility.None);
                printTool.ShowPreviewDialog();
            }
        }
Ejemplo n.º 9
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            ReportPrintTool pt = new ReportPrintTool(new MiniReport());

            // Get the Print Tool's printing system.
            PrintingSystemBase ps = pt.PrintingSystem;

            // Show a report's Print Preview.
            pt.ShowPreviewDialog();

            // Zoom the print preview, so that it fits the entire page.
            ps.ExecCommand(PrintingSystemCommand.ViewWholePage);

            // Invoke the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { true });

            // Hide the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { false });
        }
        private void btnPrintList_Click(object sender, EventArgs e)
        {
            frmRpt_VietnameseCustomer aPage1 = new frmRpt_VietnameseCustomer(aListAllCustomer, aListNewCustomer, aListOldCustomer);
            aPage1.DefaultPrinterSettingsUsing.UseLandscape = true;
            aPage1.DefaultPrinterSettingsUsing.UsePaperKind = false;

            aPage1.PrintingSystem.PageSettings.Landscape = true;
            aPage1.PrintingSystem.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A4Rotated;

            ReportPrintTool tool = new ReportPrintTool(aPage1);
            aPage1.AssignPrintTool(tool);

            tool.PreviewForm.PrintingSystem.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A4Rotated;
            tool.PreviewForm.PrintingSystem.PageSettings.Landscape = true;

            tool.PreviewRibbonForm.PrintingSystem.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A4Rotated;
            tool.PreviewRibbonForm.PrintingSystem.PageSettings.Landscape = true;
            tool.ShowPreviewDialog();
        }
Ejemplo n.º 11
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            ReportPrintTool pt = new ReportPrintTool(new MiniReport());

            // Get the Print Tool's printing system.
            PrintingSystemBase ps = pt.PrintingSystem;

            // Show a report's Print Preview.
            pt.ShowPreviewDialog();

            // Zoom the print preview, so that it fits the entire page.
            ps.ExecCommand(PrintingSystemCommand.ViewWholePage);

            // Invoke the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { true });

            // Hide the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { false });
        }
Ejemplo n.º 12
0
        private void toolStripButtonQuery_Click(object sender, EventArgs e)
        {
            bool querySupported = true;

            if (mGroupsId.Length > 0)
            {
                updateQueryParam();
                if (!m_NormalChecked && m_GroupChecked)
                {
                    querySupported = checkQueryRange();
                }
                if (querySupported)
                {
                    BackgroundWorker worker = new BackgroundWorker();
                    worker.WorkerSupportsCancellation = true;
                    //CheckLoading为窗体显示过程中需要处理算法的方法
                    worker.DoWork += new DoWorkEventHandler(CheckLoading);
                    worker.RunWorkerAsync();

                    //显示进度窗体
                    FrmLoading f = new FrmLoading(worker);
                    f.ShowDialog(this);
                    //queryPersonAndPerview();

                    XtraReportPerson reportPerson = new XtraReportPerson(m_Title);
                    reportPerson.DataSource = reportInfoList;
                    ReportPrintTool printTool = new ReportPrintTool(reportPerson);
                    //printTool.ShowRibbonPreview();
                    //printTool.ShowRibbonPreviewDialog(UserLookAndFeel.Default);
                    //printTool.ShowPreview();
                    printTool.ShowPreviewDialog(UserLookAndFeel.Default);
                }
                else
                {
                    MessageBox.Show("异常出厂人员按群查询时间较长,因此不支持人员信息群中的顶层和第二层多选查询!", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("未选择群,请重新选择!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Ejemplo n.º 13
0
 private void bunifuButton2_Click(object sender, EventArgs e)
 {
     if ((dgv_ct.DataSource as DataTable).Rows.Count > 0)
     {
         DateTime date = DateTime.Now;
         inBaoCao inHD = new inBaoCao("BÁO CÁO KHO",
                                      (Application.OpenForms[1] as frmGui).NV.TenNV1,
                                      date,
                                      "");
         GridControl control = new GridControl();
         control.DataSource = (dgv_ct.DataSource as DataTable);
         inHD.GridControl   = control;
         ReportPrintTool printTool = new ReportPrintTool(inHD);
         printTool.ShowPreviewDialog();
     }
     else
     {
         MessageBox.Show("Chưa có thông tin");
     }
 }
Ejemplo n.º 14
0
        private void BtnPrint_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            object      volumnValue = this.searchDonVi.Properties.View.GetFocusedRowCellValue("InOrOut");
            VanBanNoiBo vanBanNoiBo = new VanBanNoiBo();

            grvExport.BestFitColumns();
            //if (radioChonNoiBanHanh.SelectedIndex == 0)
            //{
            //    report1.labelthongke = "THỐNG KÊ VĂN BẢN NỘI BỘ NHẬN ĐƯỢC";
            //}
            //if (radioChonNoiBanHanh.SelectedIndex == 1)
            //{
            vanBanNoiBo.labelthongke = "THỐNG KÊ VĂN BẢN NGOÀI NGÀNH NHẬN ĐƯỢC";
            //}
            vanBanNoiBo.labeltungay = "Từ ngày " + DateTuNgay.DateTime.ToShortDateString() + " đến ngày " + DateDenNgay.DateTime.ToShortDateString();
            vanBanNoiBo.GridControl = grcExport;
            ReportPrintTool printTool = new ReportPrintTool(vanBanNoiBo);

            printTool.ShowPreviewDialog();
        }
Ejemplo n.º 15
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            maLop = gvLop.GetRowCellValue(gvLop.FocusedRowHandle, "MALOP").ToString().Trim();
            maMH  = gvMonHoc.GetRowCellValue(gvMonHoc.FocusedRowHandle, "MAMH").ToString().Trim();
            lan   = Int32.Parse(cmbLan.SelectedItem.ToString());

            string sql = "EXEC SP_KTBangDiemNULL '" + maMH + "', " + lan + ", '" + maLop + "'";

            if (Program.ExecSqlNonQuery(sql) == 0)
            {
                rptXemBangDiem rpt = new rptXemBangDiem(maMH, lan, maLop);
                rpt.lblTenLop.Text = txtTenLop.Text;
                rpt.lblMonHoc.Text = txtMonHoc.Text;
                rpt.lblLanThi.Text = lan.ToString();

                ReportPrintTool print = new ReportPrintTool(rpt);
                print.ShowPreviewDialog();
                grcHienThi.Visible = false;
            }
        }
Ejemplo n.º 16
0
        private void btn_Print_Click(object sender, EventArgs e)
        {
            if (dtp_From.Value > dtp_To.Value)
            {
                ErrorHandler.ShowError(lbl_Err_Summary, new string[] { "OxA001" });
                return;
            }

            xrp_RegisterExam xrp_RegisterExam = new xrp_RegisterExam(cmb_Brand.SelectedValue.ToString()
                                                                     , dtp_From.Value.ToShortDateString()
                                                                     , dtp_To.Value.ToShortDateString());

            xrp_RegisterExam.lbl_BrandNumber.Text = cmb_Brand.SelectedValue.ToString().Substring(2, 1);
            xrp_RegisterExam.lbl_DateFrom.Text    = dtp_From.Value.ToString("dd-MM-yyyy");
            xrp_RegisterExam.lbl_DateTo.Text      = dtp_To.Value.ToString("dd-MM-yyyy");

            ReportPrintTool tool = new ReportPrintTool(xrp_RegisterExam);

            tool.ShowPreviewDialog();
        }
        void ImprimerCarte()
        {
            int    rowHandle = gridView1.FocusedRowHandle;
            String id        = gridView1.GetRowCellValue(rowHandle, "id").ToString();
            String noms      = gridView1.GetRowCellValue(rowHandle, "noms").ToString();

            try
            {
                rpt_Carteclient rpt = new rpt_Carteclient();
                rpt.DataSource = ALLProjetctdll.Classes.clsGlossiaireMYSQL.GetInstance().get_Report_X("vrapportclient", "id", id);
                using (ReportPrintTool printTool = new ReportPrintTool(rpt))
                {
                    printTool.ShowPreviewDialog();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "ERREUR", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 18
0
        private void btnIn_Click(object sender, EventArgs e)
        {
            if (String.Equals(comboBox1.Text.ToString(), "QLDSV_CNTT"))
            {
                tenkhoa = "Công nghệ thông tin";
            }
            else
            {
                tenkhoa = "Viễn thông";
            }
            XtraReportInPhieuDiem rpt = new XtraReportInPhieuDiem(masv);

            rpt.xrLabelLop.Text   = "Lớp : " + tenlop;
            rpt.xrLabelHoTen.Text = "Họ tên : " + comboBox3.Text.ToString();
            rpt.xrLabelKhoa.Text  = "Khoa : " + tenkhoa;
            rpt.xrLabelMaSV.Text  = "Mã sinh viên : " + masv;
            ReportPrintTool print = new ReportPrintTool(rpt);

            print.ShowPreviewDialog();
        }
Ejemplo n.º 19
0
        private void btnMayIn_Click(object sender, EventArgs e)
        {
            string malop = txtLop.Text.Trim();

            if (malop.Length < 5)
            {
                MessageBox.Show("Mã lớp phải nhiều hơn 5 kí tự ", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            string nienkhoa = cmbNienKhoa.SelectedValue.ToString();
            string hocky    = cmbHocKy.SelectedItem.ToString();


            INDSDHP xpr = new INDSDHP(malop, nienkhoa, Int32.Parse(hocky));

            xpr.xrLabel3.Text = "Lớp : " + malop + " Học kỳ " + hocky + " Niên khóa : " + nienkhoa + "  ";
            ReportPrintTool print = new ReportPrintTool(xpr);

            print.ShowPreviewDialog();
        }
Ejemplo n.º 20
0
        private void button1_Click(object sender, EventArgs e)
        {
            String quyen;

            if (Program.mGroup == "CONGTY")
            {
                quyen = "F";
            }
            else
            {
                quyen = "C";
            }
            string loai1 = comboBox1.Text;
            String loai  = comboBox1.Text.Substring(0, 1);
            String bd    = dateTimePicker1.Text;
            String kt    = dateTimePicker2.Text;

            if (bd.CompareTo(kt) > 0)
            {
                MessageBox.Show("Ngày kết thúc không được nhỏ hơn ngày bắt đầu", string.Empty, MessageBoxButtons.OK);
                return;
            }
            Report_SP_BANGKEVATTU rp = new Report_SP_BANGKEVATTU(quyen, loai, bd, kt);

            dateTimePicker2.CustomFormat = dateTimePicker1.CustomFormat = "dd/MM/yyyy";
            String bd1 = dateTimePicker1.Text;
            String kt1 = dateTimePicker2.Text;

            if (Program.mGroup == "CONGTY")
            {
                rp.lblTieuDe.Text = "BẢNG KÊ CHI TIẾT SỐ LƯỢNG - TRỊ GIÁ PHIẾU " + loai1.ToUpper() + " CỦA 2 CHI NHÁNH " + "TỪ NGÀY " + bd1 + " ĐẾN NGÀY: " + kt1;
            }
            else
            {
                rp.lblTieuDe.Text = "BẢNG KÊ CHI TIẾT SỐ LƯỢNG - TRỊ GIÁ PHIẾU " + loai1.ToUpper() + " " + "TỪ NGÀY " + bd1 + " ĐẾN NGÀY: " + kt1;
            }
            ReportPrintTool print = new ReportPrintTool(rp);

            print.ShowPreviewDialog();
            Close();
        }
Ejemplo n.º 21
0
        public Header()
        {
            OnNavigateToHomeCommand = new DelegateCommand(() => NavigationService.Navigate("DashboardView", null, this),
                                                          () => { return(!(NavigationService.Current is BeautySmileCRM.Views.DashboardView)); });

            OnCreateNewCustomerCommand = new DelegateCommand(() => NavigationService.Navigate("ClientPageView", null, this),
                                                             () => { return(CurrentUser != null && CurrentUser.HasPrivilege(Privilege.CreateCustomer)); });

            OnNavigateToCustomersCommand = new DelegateCommand(() => NavigationService.Navigate("ClientView", null, this),
                                                               () => { return(CurrentUser != null && CurrentUser.HasPrivilege(Privilege.ViewCustomer)); });

            OnNavigateToAppointmentsCommand = new DelegateCommand(() => NavigationService.Navigate("VisitHistoryView", null, this),
                                                                  () => { return(CurrentUser != null && CurrentUser.HasPrivilege(Privilege.ViewAppointment)); });

            OnNavigateToFinancialTransactionsCommand = new DelegateCommand(() => NavigationService.Navigate("FinancialView", null, this),
                                                                           () => { return(CurrentUser != null && CurrentUser.HasPrivilege(Privilege.ViewFinancialTransaction)); });

            OnNavigateToAdministrationCommand = new DelegateCommand(() => NavigationService.Navigate("AdministrationView", null, this),
                                                                    () => { return(CurrentUser != null && CurrentUser.HasPrivilege(Privilege.ViewUser)); });

            OnNavigateToStaffCommand = new DelegateCommand(() => NavigationService.Navigate("StaffView", null, this),
                                                           () => { return(CurrentUser != null && CurrentUser.HasPrivilege(Privilege.VIewStaff)); });

            OnNavigateToDiscountsCommand = new DelegateCommand(() => NavigationService.Navigate("DiscountView", null, this),
                                                               () => { return(CurrentUser != null && CurrentUser.HasPrivilege(Privilege.ViewConfiguration)); });

            OnNavigateToServicesCommand = new DelegateCommand(() => NavigationService.Navigate("ServiceView", null, this),
                                                              () => { return(CurrentUser != null && CurrentUser.HasPrivilege(Privilege.ViewService)); });

            OnNavigateToQuestionnaireCommand = new DelegateCommand(() =>
            {
                var rep = new Reports.Views.ClientQuestionnaireView();
                var ds  = new List <object>();
                ds.Add(new Reports.ViewModels.ClientQuestionnaireViewModel());
                rep.DataSource = ds;
                rep.CreateDocument();

                var printTool = new ReportPrintTool(rep);
                printTool.ShowPreviewDialog();
            });
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Xtra_HoatDongNhanVien rpt;

            if (rbHangNhap.Checked)
            {
                rpt = new Xtra_HoatDongNhanVien(1, txtNgayBD.Value, txtNgayKT.Value, int.Parse(cmbNV.Text.Trim()));
            }
            else
            {
                rpt = new Xtra_HoatDongNhanVien(0, txtNgayBD.Value, txtNgayKT.Value, int.Parse(cmbNV.Text.Trim()));
            }

            // rpt.lbMaNV.Text = cmbNV.Text;
            // rpt.lbHoTen.Text = txtHoTen.Text;
            /// rpt.lbMaCN.Text = cmbChiNhanh.Text;

            ReportPrintTool report = new ReportPrintTool(rpt);

            report.ShowPreviewDialog();
        }
Ejemplo n.º 23
0
        private void printTekToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int frtID = (int)mtbktGridView.GetFocusedRowCellValue(colFRTID);

            if (turRadioGroup.SelectedIndex == 0)
            {
                tMax14ReportClassLibrary.MtbktXR rpr = new tMax14ReportClassLibrary.MtbktXR(frtID, dateEdit1.DateTime);
                using (ReportPrintTool printTool = new ReportPrintTool(rpr))
                {
                    printTool.ShowPreviewDialog();
                }
            }
            else
            {
                tMax14ReportClassLibrary.Mtbkt_BaBsXR rpr = new tMax14ReportClassLibrary.Mtbkt_BaBsXR(frtID, dateEdit1.DateTime);
                using (ReportPrintTool printTool = new ReportPrintTool(rpr))
                {
                    printTool.ShowPreviewDialog();
                }
            }
        }
Ejemplo n.º 24
0
 private void pictureBox2_Click(object sender, EventArgs e)
 {
     if (txtdate2.Text == "" || cb1.Text == "")
     {
         MessageBox.Show("Replissez bien les deux champs!!");
     }
     else
     {
         try
         {
             rapportBusiness j = new rapportBusiness();
             j.DataSource = StormSoft.classe.glossaire.GetInstance().sortieOperationBusDate(txtdate2.Text, cb1.Text);
             ReportPrintTool printTool = new ReportPrintTool(j);
             printTool.ShowPreviewDialog();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
Ejemplo n.º 25
0
 private void pictureBox3_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == "")
     {
         MessageBox.Show("Remplissez Id du client ");
     }
     else
     {
         try
         {
             rapportbusinessGerant j = new rapportbusinessGerant();
             j.DataSource = StormSoft.classe.glossaire.GetInstance().sortieOperationBusID(textBox1.Text, users);
             ReportPrintTool printTool = new ReportPrintTool(j);
             printTool.ShowPreviewDialog();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
Ejemplo n.º 26
0
        private void simpleReport_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            IReportDataV2 reportData = View.ObjectSpace.FindObject <ReportDataV2>(new BinaryOperator("DisplayName", "Pilot Report"));

            DevExpress.XtraReports.UI.XtraReport report = ReportDataProvider.ReportsStorage.LoadReport(reportData);
            IObjectSpace    objectSpace = Application.CreateObjectSpace(typeof(rb_Pilot));
            List <rb_Pilot> list        = new List <rb_Pilot>();

            list.Add(objectSpace.FindObject <rb_Pilot>(new BinaryOperator("Id", $"{(View.SelectedObjects[0] as rb_Pilot)?.Id ?? 0}")));
            report.DataSource = list;
            ReportsModuleV2.FindReportsModule(Application.Modules).ReportsDataSourceHelper.SetupBeforePrint(report);
            using (ReportPrintTool printTool = new ReportPrintTool(report)) {
                // Invoke the Print Preview form modally,
                // and load the report document into it.
                printTool.ShowPreviewDialog();

                // Invoke the Print Preview form
                // with the specified look and feel setting.
                //printTool.ShowPreviewDialog(UserLookAndFeel.Default);
            }
        }
 private void simpleButton12_Click(object sender, EventArgs e)
 {
     if (txtdate1.Text == "" || txtdate2.Text == "")
     {
         MessageBox.Show("Entrez les date svp !!!");
     }
     else
     {
         try
         {
             RapprtMessagerie be = new RapprtMessagerie();
             be.DataSource = clreport.GetInstance().get_Report_Trier("viewRapportMessagerie", "DateEnvoie", DateTime.Parse(txtdate1.Text.Trim()), DateTime.Parse(txtdate2.Text.Trim()));
             using (ReportPrintTool printTool = new ReportPrintTool(be))
             {
                 printTool.ShowPreviewDialog();
             }
         }
         catch (Exception ex)
         { MessageBox.Show(ex.Message); }
     }
 }
 private void simpleButton17_Click(object sender, EventArgs e)
 {
     if (txtcomboAnneeAffect.Text == "")
     {
         MessageBox.Show("Selectionnez l'année svp !!!");
     }
     else
     {
         try
         {
             RapportAffectationListe rpt = new RapportAffectationListe();
             rpt.DataSource = clreport.GetInstance().RapportTrie("liste_affectation", "codeanne", txtcomboAnneeAffect.Text, "NomEns");
             using (ReportPrintTool printTool = new ReportPrintTool(rpt))
             {
                 printTool.ShowPreviewDialog();
             }
         }
         catch (Exception ex)
         { MessageBox.Show(ex.Message); }
     }
 }
        private void BtnPrint_Click(object sender, EventArgs e)
        {
            maLop = txtMalop.Text;
            maMH  = txtMaMH.Text;
            lan   = short.Parse(cmbLanThi.SelectedValue.ToString());

            if (Program.conn.State == ConnectionState.Closed)
            {
                Program.conn.Open();
            }
            String check = "SP_DSThiHetMon";

            Program.sqlcmd             = Program.conn.CreateCommand();
            Program.sqlcmd.CommandType = CommandType.StoredProcedure;
            Program.sqlcmd.CommandText = check;
            Program.sqlcmd.Parameters.Add("@MALOP", SqlDbType.NChar).Value  = txtMalop.Text;
            Program.sqlcmd.Parameters.Add("@MAMH", SqlDbType.NChar).Value   = txtMaMH.Text;
            Program.sqlcmd.Parameters.Add("@LAN", SqlDbType.SmallInt).Value = short.Parse(cmbLanThi.SelectedValue.ToString());
            Program.sqlcmd.Parameters.Add("@Ret", SqlDbType.Int).Direction  = ParameterDirection.ReturnValue;
            Program.sqlcmd.ExecuteNonQuery();
            String ret = Program.sqlcmd.Parameters["@Ret"].Value.ToString();

            Program.conn.Close();
            if (ret == "1")
            {
                MessageBox.Show("Lớp, môn học, lần thi này đã có điểm!\nVui lòng chọn môn chưa thi!", "Thông báo", MessageBoxButtons.OK);
                cmbTenMH.Focus();
                return;
            }

            XtraReport1 rpt = new XtraReport1(maLop, maMH, lan);

            rpt.lblLop.Text     = cmbTenLop.SelectedValue.ToString();
            rpt.lblMonHoc.Text  = cmbTenMH.SelectedValue.ToString();
            rpt.lblNgayThi.Text = dtNgayThi.Text;

            ReportPrintTool print = new ReportPrintTool(rpt);

            print.ShowPreviewDialog();
        }
        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            var rowHandle = gridView_CuocGoi.FocusedRowHandle;
            // Get the value for the given column - convert to the type you're expecting
            string IDBenhNhan = gridView_CuocGoi.GetRowCellValue(rowHandle, "IDBenhNhan").ToString();
            string IDCTBenhNhan = gridView_CuocGoi.GetRowCellValue(rowHandle, "IDCTBenhNhan").ToString();
            //LoadList
            List<CTBenhNhanComplaint> listComplaint = qlND.GetDSCTBenhNhanComplaintByIDCTBenhNhan(IDCTBenhNhan);
            List<CTBenhNhanMRIImage> listMRIImage = qlND.GetDSCTBenhNhanMRIImageByIDCTBenhNhan(IDCTBenhNhan);
            List<CTBenhNhanCondition> listCondition = qlND.GetDSCTBenhNhanConditionByIDCTBenhNhan(IDCTBenhNhan);
            List<CTBenhNhanConditionDicsJoint> listConditionDicsJoint = qlND.GetDSCTBenhNhanConditionDicsJointByIDCTBenhNhan(IDCTBenhNhan);
            List<CTBenhNhanConditionVertebral> listConditionVertebral = qlND.GetDSCTBenhNhanConditionVertebralByIDCTBenhNhan(IDCTBenhNhan);
            List<CTBenhNhanExcercise> listExcercise = qlND.GetDSCTBenhNhanExcerciseByIDCTBenhNhan(IDCTBenhNhan);
            List<CTBenhNhanSnapShot> listSnapShot = qlND.GetDSCTBenhNhanSnapShotByIDCTBenhNhan(IDCTBenhNhan);
            CTBenhNhan cTBenhNhan = qlND.GetCTBenhNhanByIDCTBenhNhan(IDCTBenhNhan).SingleOrDefault();
            BenhNhan benhNhan = qlND.GetBenhNhanByID(IDBenhNhan);
            List<sp_GetDSExcerciseByIDCTBNResult> listEx = qlND.GetDSExcerciseByIDCTBN(IDCTBenhNhan);

            rptPatientMedical rptAll = new rptPatientMedical();

            //rptAll.parThangNam.Value = string.Format("DANH SÁCH CUỘC GỌI TỪ KHÁCH HÀNG THÁNG {0}/{1}", thang, nam);
            //rptAll.parThangNam.Visible = false;

            //rptAll.DataSource = list;
            //BindToBand
            DetailReportBand cTBenhNhanComplaint = rptAll.Bands["DetailReport_Complant"] as DetailReportBand;
            if (listComplaint.Count > 0)
            {
                cTBenhNhanComplaint.DataSource = listComplaint;
            }
            else
            {
                cTBenhNhanComplaint.Visible = false;
            }

            DetailReportBand cTBenhNhanMRIImage = rptAll.Bands["DetailReport_MRI"] as DetailReportBand;
            if (listMRIImage.Count > 0)
            {
                cTBenhNhanMRIImage.DataSource = listMRIImage;
            }
            else
            {
                cTBenhNhanMRIImage.Visible = false;
            }

            DetailReportBand cTBenhNhanDicsJoint = rptAll.Bands["DetailReport_DiscAndJoint"] as DetailReportBand;
            if (listConditionDicsJoint.Count > 0)
            {
                cTBenhNhanDicsJoint.DataSource = listConditionDicsJoint;
            }
            else
            {
                cTBenhNhanDicsJoint.Visible = false;
            }

            //List<CTBenhNhanCondition> listCondition = qlND.GetDSCTBenhNhanConditionByIDCTBenhNhan(lblCTBenhNhan.Text);
            ////DetailReportBand cTBenhNhanAnkle = rptAll.Bands["DetailReport_Ankle"] as DetailReportBand;
            ////cTBenhNhanAnkle.DataSource = cTBenhNhanConditions;
            //List<CTBenhNhanCondition> listCondition = new List<CTBenhNhanCondition>();
            //listCondition.Add(cTBenhNhanConditions);
            DetailReportBand DetailReport_Ankle = rptAll.Bands["DetailReport_Ankle"] as DetailReportBand;
            DetailReportBand DetailReport_Elbow = rptAll.Bands["DetailReport_Elbow"] as DetailReportBand;
            DetailReportBand DetailReport_Foot = rptAll.Bands["DetailReport_Foot"] as DetailReportBand;
            DetailReportBand DetailReport_Hip = rptAll.Bands["DetailReport_Hip"] as DetailReportBand;
            DetailReportBand DetailReport_Knee = rptAll.Bands["DetailReport_Knee"] as DetailReportBand;
            DetailReportBand DetailReport_Posture = rptAll.Bands["DetailReport_Posture"] as DetailReportBand;
            DetailReportBand DetailReport_Sacroiliac = rptAll.Bands["DetailReport_Sacroiliac"] as DetailReportBand;
            DetailReportBand DetailReport_Scoliosis = rptAll.Bands["DetailReport_Scoliosis"] as DetailReportBand;
            DetailReportBand DetailReport_Shoulder = rptAll.Bands["DetailReport_Shoulder"] as DetailReportBand;
            DetailReportBand DetailReport_Wrist = rptAll.Bands["DetailReport_Wrist"] as DetailReportBand;
            if (listCondition.Count > 0)
            {
                if ((bool)listCondition[0].Ankle)
                {
                    DetailReport_Ankle.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Ankle.Visible = false;
                }

                if ((bool)listCondition[0].Elbow)
                {
                    DetailReport_Elbow.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Elbow.Visible = false;
                }

                if ((bool)listCondition[0].FootPlantar || (bool)listCondition[0].FootPronation || (bool)listCondition[0].FootSupination)
                {
                    DetailReport_Foot.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Foot.Visible = false;
                }

                if ((bool)listCondition[0].Hip)
                {
                    DetailReport_Hip.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Hip.Visible = false;
                }

                if ((bool)listCondition[0].KneeACL || (bool)listCondition[0].KneeDegeneration || (bool)listCondition[0].KneeMCL || (bool)listCondition[0].KneeMeniscus)
                {
                    DetailReport_Knee.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Knee.Visible = false;
                }

                if ((bool)listCondition[0].PostureHyperLordosis || (bool)listCondition[0].PostureKyphosis)
                {
                    DetailReport_Posture.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Posture.Visible = false;
                }

                if ((bool)listCondition[0].SacroiliacDegeneration || (bool)listCondition[0].SacroiliacInbalance || (bool)listCondition[0].SacroiliacInflammation || (bool)listCondition[0].SacroiliacNormail)
                {
                    DetailReport_Sacroiliac.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Sacroiliac.Visible = false;
                }

                if ((bool)listCondition[0].ScoliosisCervico || (bool)listCondition[0].ScoliosisCervival || (bool)listCondition[0].ScoliosisLumbar || (bool)listCondition[0].ScoliosisThoracic || (bool)listCondition[0].ScoliosisThoracolumbar)
                {
                    DetailReport_Scoliosis.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Scoliosis.Visible = false;
                }

                if ((bool)listCondition[0].ShoulderACJoint || (bool)listCondition[0].ShoulderAdhesive || (bool)listCondition[0].ShoulderBursitis || (bool)listCondition[0].ShoulderImpingement || (bool)listCondition[0].ShoulderRotator)
                {
                    DetailReport_Shoulder.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Shoulder.Visible = false;
                }

                if ((bool)listCondition[0].Wrist)
                {
                    DetailReport_Wrist.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Wrist.Visible = false;
                }
            }
            else
            {
                DetailReport_Ankle.Visible = false;
                DetailReport_Elbow.Visible = false;
                DetailReport_Foot.Visible = false;
                DetailReport_Hip.Visible = false;
                DetailReport_Knee.Visible = false;
                DetailReport_Posture.Visible = false;
                DetailReport_Sacroiliac.Visible = false;
                DetailReport_Scoliosis.Visible = false;
                DetailReport_Shoulder.Visible = false;
                DetailReport_Wrist.Visible = false;
            }
            DetailReportBand cTBenhNhanVertebral = rptAll.Bands["DetailReport_Vertebral"] as DetailReportBand;
            if (listConditionVertebral.Count > 0)
            {
                cTBenhNhanVertebral.DataSource = listConditionVertebral;
            }
            else
            {
                cTBenhNhanVertebral.Visible = false;
            }

            DetailReportBand cTBenhNhanSnap = rptAll.Bands["DetailReport_Snap"] as DetailReportBand;
            if (listSnapShot.Count > 0)
            {
                cTBenhNhanSnap.DataSource = listSnapShot;
            }
            else
            {
                cTBenhNhanSnap.Visible = false;
            }

            DetailReportBand DetailReport_Excercises = rptAll.Bands["DetailReport_Excercises"] as DetailReportBand;
            if (listEx.Count > 0)
            {
                DetailReport_Excercises.DataSource = listEx;
            }
            else
            {
                DetailReport_Excercises.Visible = false;
            }

            if (cTBenhNhan.Comment.Trim().Length > 0)
            {
                rptAll.parComment.Value = cTBenhNhan.Comment.ToString();
                rptAll.parComment.Visible = false;
            }
            else
            {
                DetailReportBand DetailReport_Comment = rptAll.Bands["DetailReport_Comment"] as DetailReportBand;
                DetailReport_Comment.Visible = false;
                rptAll.parComment.Value = cTBenhNhan.Comment.ToString();
                rptAll.parComment.Visible = false;
            }

            string phone = ConfigurationManager.AppSettings["Phone"].ToString();
            string address = ConfigurationManager.AppSettings["Address"].ToString();
            rptAll.parPhone.Value = phone;
            rptAll.parPhone.Visible = false;
            rptAll.parDiaChi.Value = address;
            rptAll.parDiaChi.Visible = false;

            rptAll.parComment.Value = cTBenhNhan.Comment.ToString();
            rptAll.parComment.Visible = false;
            rptAll.parDate.Value = cTBenhNhan.NgayKham.ToString();
            rptAll.parDate.Visible = false;
            rptAll.parFileNumber.Value = benhNhan.ID.ToString();
            rptAll.parFileNumber.Visible = false;
            rptAll.parName.Value = benhNhan.TenBN.ToString();
            rptAll.parName.Visible = false;
            rptAll.parTreamentFor.Value = cTBenhNhan.TreatmentTimeFor.ToString();
            rptAll.parTreamentFor.Visible = false;
            rptAll.parTreamentTime.Value = cTBenhNhan.TreatmentTime.ToString();
            rptAll.parTreamentTime.Visible = false;
            rptAll.parTreamentTotal.Value = cTBenhNhan.TreatmentTimeFor.ToString();
            rptAll.parTreamentTotal.Visible = false;

            ReportPrintTool tool = new ReportPrintTool(rptAll);
            //tool.PreviewForm.Shown += new EventHandler(PreviewForm_Shown);
            tool.ShowPreviewDialog();
        }
Ejemplo n.º 31
0
        private void buttonPrint_Click(object sender, EventArgs e)
        {
            bool resultValidateForm = validateForm();
            if (!resultValidateForm)
            {
                return;
            }
            fRMMain.showWaitingForm("กำลังทำการเปิดหน้าปริ้น");
            ReportPrintTool pt = new ReportPrintTool(new MiniReport());

            // Get the Print Tool's printing system.
            PrintingSystemBase ps = pt.PrintingSystem;

            fRMMain.showWaitingForm("กำลังทำการเปิดหน้าปริ้น");
            // Show a report's Print Preview.
            pt.ShowPreviewDialog();

            // Zoom the print preview, so that it fits the entire page.
            ps.ExecCommand(PrintingSystemCommand.ViewWholePage);

            // Invoke the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { true });

            // Hide the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { false });
        }
Ejemplo n.º 32
0
        private void bttPrint_Click(object sender, EventArgs e)
        {
            string pathname = "";
            string filePath = "";
            int _countCheckbox = 0;
            DataTable GeneralInfo = new DataTable();
            DataTable GridTableCheckbox = new DataTable();

            GridTableCheckbox = ((DataTable)gridControlInvoiceList.DataSource);

            XtraReport1 report1 = new XtraReport1();
            report1.CreateDocument();

            for (int i = 0; i < GridTableCheckbox.Rows.Count; i++)
            {
                if ((bool)(GridTableCheckbox.Rows[i]["checkbox"]) == true)
                {
                    GeneralInfo = BusinessLogicBridge.DataStore.getGeneralConfig();
                    filePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                    filePath = filePath + @"\" + GeneralInfo.Rows[0]["path_all_document"].ToString();

                    pathname = DXWindowsApplication2.MainForm.CombinePaths(Environment.GetFolderPath(Environment.SpecialFolder.Personal), GeneralInfo.Rows[0]["path_all_document"].ToString(), "Invoice", GridTableCheckbox.Rows[i].Table.Rows[0]["inv_trans_number"].ToString() + ".pdf");

                    PrintDocuments.invoice PrintInvoice = new DXWindowsApplication2.PrintDocuments.invoice();

                    PrintInvoice.loopGenDataRow(GridTableCheckbox.Rows[i]["inv_trans_id"].To<int>());

                    //PrintInvoice.ExportToPdf(pathname);

                    PrintInvoice.CreateDocument();

                    report1.Pages.AddRange(PrintInvoice.Pages);

                    BusinessLogicBridge.DataStore.setInvoicePrint(GridTableCheckbox.Rows[i]["inv_trans_id"].To<int>());
                    _countCheckbox++;
                }
            }

            if (_countCheckbox <= 0)
            {
                MessageBox.Show("Please select item ...");
                return;
            }

            report1.PrintingSystem.ContinuousPageNumbering = true;

            // Create a Print Tool and show the Print Preview form.
            ReportPrintTool printTool = new ReportPrintTool(report1);
            printTool.ShowPreviewDialog();

            initLoadGridInvoice();
        }
        private void sbIn_Click(object sender, EventArgs e)
        {
            DataTable dt3 = gcSanPhamTrongHoaDon.DataSource as DataTable;
            if (dt3 == null || dt3.Rows.Count == 0)
            {
                MessageBox.Show("Hóa Đơn Này Không Có Sản Phẩm",
                                                       "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                DataTable dt = gcDanhSachHoaDonDatHang.DataSource as DataTable;
                if (dt != null && dt.Rows.Count > 0)
                {
                    int selectrow = gvDanhSachhoaDonDatHang.GetSelectedRows()[0];
                    if (selectrow != -1)
                    {
                        HoaDonNhapHang hd = new HoaDonNhapHang();
                        hd.DanhSachSanPham = gcSanPhamTrongHoaDon.DataSource as DataTable;
                        hd.NgayGiaoHang = deNgayThanhToan.DateTime.ToString();
                        hd.NgayLap = deNgayThanhToan.DateTime.ToString();
                        hd.NhaCungCap = dt.Rows[selectrow].ItemArray[2].ToString();
                        hd.TenNhanVien = dt.Rows[selectrow].ItemArray[3].ToString();
                        hd.TongTien = tongtien;
                        XRLapHoaDonThanhToanNhapHang BanInHoaDonNhapHang = new XRLapHoaDonThanhToanNhapHang(hd);
                        try
                        {
                            BanInHoaDonNhapHang.CreateDocument();
                        }
                        catch (Exception ex)
                        {

                        }
                        ReportPrintTool printTool = new ReportPrintTool(BanInHoaDonNhapHang);
                        printTool.ShowPreviewDialog();
                    }
                }
            }
        }
        private void btnSavePrint_Click(object sender, System.EventArgs e)
        {
            try
            {
                //if (CheckValidatePatient())
                //{
                //    BenhNhan bn = GetInfBenhNhan();
                //    qlND.InsertBenhNhan(bn);

                CTBenhNhan ctbn = GetInfCTBenhNhan();
                qlND.InsertCTBenhNhan(ctbn);

                List<CTBenhNhanComplaint> listComplaint = GetInfCTBenhNhanComplaint();

                List<CTBenhNhanConditionDicsJoint> listDiscJoint = GetInfCTBenhNhanConditionDicsJoint();

                CTBenhNhanCondition cTBenhNhanConditions = GetInfCTBenhNhanCondition();

                List<CTBenhNhanConditionVertebral> listCTBenhNhanConditionVertebral = GetInfCTBenhNhanConditionVertebral();

                List<CTBenhNhanExcercise> ListCTBenhNhanExcercises = GetInfCTBenhNhanExcercise();
                qlND.InsertListCTBenhNhanExcercise(ListCTBenhNhanExcercises);

                List<CTBenhNhanMRIImage> listCTBenhNhanMRIImage = GetInfCTBenhNhanMRIImage();

                List<CTBenhNhanSnapShot> listCTBenhNhanSnapShot = GetInfCTBenhNhanSnapShot();

                //PrintPatient(txtFileNumberPatient.Text, lblCTBenhNhan.Text);
                //Print
                rptPatientMedical rptAll = new rptPatientMedical();

                //rptAll.parThangNam.Value = string.Format("DANH SÁCH CUỘC GỌI TỪ KHÁCH HÀNG THÁNG {0}/{1}", thang, nam);
                //rptAll.parThangNam.Visible = false;

                //rptAll.DataSource = list;
                //BindToBand
                DetailReportBand cTBenhNhanComplaint = rptAll.Bands["DetailReport_Complant"] as DetailReportBand;
                if (listComplaint.Count > 0)
                {
                    cTBenhNhanComplaint.DataSource = listComplaint;
                }
                else
                {
                    cTBenhNhanComplaint.Visible = false;
                }

                DetailReportBand cTBenhNhanMRIImage = rptAll.Bands["DetailReport_MRI"] as DetailReportBand;
                if (listCTBenhNhanMRIImage.Count > 0)
                {
                    cTBenhNhanMRIImage.DataSource = listCTBenhNhanMRIImage;
                }
                else
                {
                    cTBenhNhanMRIImage.Visible = false;
                }

                DetailReportBand cTBenhNhanDicsJoint = rptAll.Bands["DetailReport_DiscAndJoint"] as DetailReportBand;
                if (listDiscJoint.Count > 0)
                {
                    cTBenhNhanDicsJoint.DataSource = listDiscJoint;
                }
                else
                {
                    cTBenhNhanDicsJoint.Visible = false;
                }

                //List<CTBenhNhanCondition> listCondition = qlND.GetDSCTBenhNhanConditionByIDCTBenhNhan(lblCTBenhNhan.Text);
                ////DetailReportBand cTBenhNhanAnkle = rptAll.Bands["DetailReport_Ankle"] as DetailReportBand;
                ////cTBenhNhanAnkle.DataSource = cTBenhNhanConditions;
                List<CTBenhNhanCondition> listCondition = new List<CTBenhNhanCondition>();
                listCondition.Add(cTBenhNhanConditions);

                DetailReportBand DetailReport_Ankle = rptAll.Bands["DetailReport_Ankle"] as DetailReportBand;
                if ((bool)listCondition[0].Ankle)
                {
                    DetailReport_Ankle.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Ankle.Visible = false;
                }

                DetailReportBand DetailReport_Elbow = rptAll.Bands["DetailReport_Elbow"] as DetailReportBand;
                if ((bool)listCondition[0].Elbow)
                {
                    DetailReport_Elbow.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Elbow.Visible = false;
                }

                DetailReportBand DetailReport_Foot = rptAll.Bands["DetailReport_Foot"] as DetailReportBand;
                if ((bool)listCondition[0].FootPlantar || (bool)listCondition[0].FootPronation || (bool)listCondition[0].FootSupination)
                {
                    DetailReport_Foot.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Foot.Visible = false;
                }

                DetailReportBand DetailReport_Hip = rptAll.Bands["DetailReport_Hip"] as DetailReportBand;
                if ((bool)listCondition[0].Hip)
                {
                    DetailReport_Hip.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Hip.Visible = false;
                }

                DetailReportBand DetailReport_Knee = rptAll.Bands["DetailReport_Knee"] as DetailReportBand;
                if ((bool)listCondition[0].KneeACL || (bool)listCondition[0].KneeDegeneration || (bool)listCondition[0].KneeMCL || (bool)listCondition[0].KneeMeniscus)
                {
                    DetailReport_Knee.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Knee.Visible = false;
                }

                DetailReportBand DetailReport_Posture = rptAll.Bands["DetailReport_Posture"] as DetailReportBand;
                if ((bool)listCondition[0].PostureHyperLordosis || (bool)listCondition[0].PostureKyphosis)
                {
                    DetailReport_Posture.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Posture.Visible = false;
                }

                DetailReportBand DetailReport_Sacroiliac = rptAll.Bands["DetailReport_Sacroiliac"] as DetailReportBand;
                if ((bool)listCondition[0].SacroiliacDegeneration || (bool)listCondition[0].SacroiliacInbalance || (bool)listCondition[0].SacroiliacInflammation || (bool)listCondition[0].SacroiliacNormail)
                {
                    DetailReport_Sacroiliac.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Sacroiliac.Visible = false;
                }

                DetailReportBand DetailReport_Scoliosis = rptAll.Bands["DetailReport_Scoliosis"] as DetailReportBand;
                if ((bool)listCondition[0].ScoliosisCervico || (bool)listCondition[0].ScoliosisCervival || (bool)listCondition[0].ScoliosisLumbar || (bool)listCondition[0].ScoliosisThoracic || (bool)listCondition[0].ScoliosisThoracolumbar)
                {
                    DetailReport_Scoliosis.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Scoliosis.Visible = false;
                }

                DetailReportBand DetailReport_Shoulder = rptAll.Bands["DetailReport_Shoulder"] as DetailReportBand;
                if ((bool)listCondition[0].ShoulderACJoint || (bool)listCondition[0].ShoulderAdhesive || (bool)listCondition[0].ShoulderBursitis || (bool)listCondition[0].ShoulderImpingement || (bool)listCondition[0].ShoulderRotator)
                {
                    DetailReport_Shoulder.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Shoulder.Visible = false;
                }

                DetailReportBand DetailReport_Wrist = rptAll.Bands["DetailReport_Wrist"] as DetailReportBand;
                if ((bool)listCondition[0].Wrist)
                {
                    DetailReport_Wrist.DataSource = listCondition;
                }
                else
                {
                    DetailReport_Wrist.Visible = false;
                }

                DetailReportBand cTBenhNhanVertebral = rptAll.Bands["DetailReport_Vertebral"] as DetailReportBand;
                if (listCTBenhNhanConditionVertebral.Count > 0)
                {
                    cTBenhNhanVertebral.DataSource = listCTBenhNhanConditionVertebral;
                }
                else
                {
                    cTBenhNhanVertebral.Visible = false;
                }

                DetailReportBand cTBenhNhanSnap = rptAll.Bands["DetailReport_Snap"] as DetailReportBand;
                if (listCTBenhNhanSnapShot.Count > 0)
                {
                    cTBenhNhanSnap.DataSource = listCTBenhNhanSnapShot;
                }
                else
                {
                    cTBenhNhanSnap.Visible = false;
                }

                List<sp_GetDSExcerciseByIDCTBNResult> listEx2 = qlND.GetDSExcerciseByIDCTBN(lblCTBenhNhan.Text);
                DetailReportBand DetailReport_Excercises = rptAll.Bands["DetailReport_Excercises"] as DetailReportBand;
                if (listEx2.Count > 0)
                {
                    DetailReport_Excercises.DataSource = listEx2;
                }
                else
                {
                    DetailReport_Excercises.Visible = false;
                }

                if (ctbn.Comment.Trim().Length > 0)
                {
                    rptAll.parComment.Value = ctbn.Comment.ToString();
                    rptAll.parComment.Visible = false;
                }
                else
                {
                    DetailReportBand DetailReport_Comment = rptAll.Bands["DetailReport_Comment"] as DetailReportBand;
                    DetailReport_Comment.Visible = false;
                    rptAll.parComment.Value = ctbn.Comment.ToString();
                    rptAll.parComment.Visible = false;
                }

                string phone = ConfigurationManager.AppSettings["Phone"].ToString();
                string address = ConfigurationManager.AppSettings["Address"].ToString();
                rptAll.parPhone.Value = phone;
                rptAll.parPhone.Visible = false;
                rptAll.parDiaChi.Value = address;
                rptAll.parDiaChi.Visible = false;

                rptAll.parDate.Value = ctbn.NgayKham.ToString();
                rptAll.parDate.Visible = false;
                rptAll.parFileNumber.Value = txtFileNumberPatient.Text;
                rptAll.parFileNumber.Visible = false;
                rptAll.parName.Value = txtNamePatient.Text;
                rptAll.parName.Visible = false;
                rptAll.parTreamentFor.Value = ctbn.TreatmentTimeFor.ToString();
                rptAll.parTreamentFor.Visible = false;
                rptAll.parTreamentTime.Value = ctbn.TreatmentTime.ToString();
                rptAll.parTreamentTime.Visible = false;
                rptAll.parTreamentTotal.Value = ctbn.TreatmentTimeTotal.ToString();
                rptAll.parTreamentTotal.Visible = false;

                ReportPrintTool tool = new ReportPrintTool(rptAll);
                //tool.PreviewForm.Shown += new EventHandler(PreviewForm_Shown);
                tool.ShowPreviewDialog();
                //insert

                qlND.InsertListCTBenhNhanMRIImage(listCTBenhNhanMRIImage);
                qlND.InsertListCTBenhNhanSnapShot(listCTBenhNhanSnapShot);
                qlND.InsertListCTBenhNhanConditionVertebral(listCTBenhNhanConditionVertebral);
                qlND.InsertCTBenhNhanCondition(cTBenhNhanConditions);
                qlND.InsertListCTBenhNhanConditionDicsJoint(listDiscJoint);
                qlND.InsertListCTBenhNhanComplaint(listComplaint);
                //
                ClearDataWhenSaveDone();
                //}
            }
            catch (Exception)
            {
                MessageBox.Show("Save error");
            }
        }
Ejemplo n.º 35
0
        private void CreateBooklet()
        {
            // Create the 1st report and generate its document.
            //XtraReport1 report1 = new XtraReport1();
            //report1.CreateDocument();

            // Preserve original page numbers on all pages.
               // report1.PrintingSystem.ContinuousPageNumbering = false;

            PrintDocuments.contract report1 = new DXWindowsApplication2.PrintDocuments.contract();

            // Create a booklet.
            int centerPageIndex = Convert.ToInt32((report1.Pages.Count - 1) / 2);
            for (int i = 0; i < centerPageIndex; i++)
            {
                report1.Pages.Insert(i * 2 + 1, report1.Pages[report1.Pages.Count - 1]);
            }

            // Create a Print Tool and show the Print Preview form.
            ReportPrintTool printTool = new ReportPrintTool(report1);
            printTool.ShowPreviewDialog();
        }
Ejemplo n.º 36
0
        public void Set_Export()
        {
            try
            {
                if (string.IsNullOrWhiteSpace(txtNUM_COTI.Text))
                    throw new ArgumentException(_Message.MsgSelectCO);
                var split = deFEC_REGI.DateTime.ToLongDateString().Split(',');
                var oc = new xrQuote();
                var odoc = new BESVTC_COTI()
                {
                    COD_COTI = Convert.ToInt32(txtNUM_COTI.Text),
                    ALF_EJEC_COME = lueCOD_EJEC_COME.Text,
                    ALF_NOMB = beALF_NOMB.Text,
                    ALF_DIRE = txtALF_DIRE_FISC.Text,
                    ALF_PROY = lueCOD_PROY.Text,
                    NUM_SUBT = Convert.ToDecimal(txtNUM_SUBT.EditValue),
                    ALF_FECH_LARG = "Lima, " + split[1],
                    ALF_ATEN=txtALF_ATEN.Text
                };

                oc.bdsDocument.DataSource = odoc;
                var olst = (List<BESVTD_COTI>)gdvArticles.DataSource;
                var i = 1;
                olst.ForEach(item =>
                {
                    item.NUM_LINE = i;
                    i += 1;
                });
                oc.bdsDocumentLines.DataSource = olst;

                var SIMB = (BESVMC_MONE)lueCOD_MONE.GetSelectedDataRow();
                var tfs = (SIMB.ALF_MONE_SIMB == "USD") ? "{0:$ #,##0.00}" : "{0:c2}";

                oc.tlcNUM_PREC_UNIT.DataBindings["Text"].FormatString = tfs;
                oc.tlcNUM_IMPO.DataBindings["Text"].FormatString = tfs;
                oc.lblNUM_SUBT.DataBindings["Text"].FormatString = tfs;
                var ALF_COND_COME = mmoALF_COND_COME.Text;
                if (string.IsNullOrWhiteSpace(ALF_COND_COME))
                {
                    ALF_COND_COME = "1.- Los precios no incluyen IGV." + Environment.NewLine +
                                    "2.- Los precios están expresados en " + ((SIMB.ALF_MONE_SIMB == "USD") ? "Dolares Americanos." : "Nuevos Soles.") + Environment.NewLine +
                                    "3.- El pago debera ser en " + ((SIMB.ALF_MONE_SIMB == "USD") ? "Dolares Americanos." : "Nuevos Soles.") + Environment.NewLine +
                                    "4.- Entrega de la Mercancía: Dependiendo disponibilidad." + Environment.NewLine +
                                    "5.- Forma de pago: Crédito a 30 días entregado el producto." + Environment.NewLine +
                                    "6.- Vigencia de la cotización: 30 días naturales a partir de la fecha de esta cotización." + Environment.NewLine +
                                    "7.- Garantía de un año contra defectos de fabricación.";
                }
                oc.lblCOND_COME.Text = ALF_COND_COME;
                using (var printTool = new ReportPrintTool(oc))
                {
                    printTool.ShowPreviewDialog();
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message,
                                    _Message.MsgInsCaption,
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
            }
        }
        private void sbChiTietBaoCao_Click(object sender, EventArgs e)
        {
            BaoCaoTonKho bc = new BaoCaoTonKho();
            DataTable dt = gcDanhSachBaoCao.DataSource as DataTable;
            if (dt != null && dt.Rows.Count > 0)
            {
                bc.DanhSachSanPham = gcChiTietBaoCao.DataSource as DataTable;
                bc.ThoiGian = thoigianbaocao;
                XRBaoCaoTonKho BCTonKho = new XRBaoCaoTonKho(bc);
                try
                {
                    BCTonKho.CreateDocument();
                }
                catch (Exception ex)
                {

                }
                ReportPrintTool printTool = new ReportPrintTool(BCTonKho);
                printTool.ShowPreviewDialog();
            }
            else
            {
                MessageBox.Show("Danh Sách Báo Cáo Trống",
                   "Thông Báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            }
        }
Ejemplo n.º 38
0
        private void btnSavePrint_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (CheckValidatePatient())
                {
                    BenhNhan bn = GetInfBenhNhan();
                    qlND.InsertBenhNhan(bn);

                    CTBenhNhan ctbn = GetInfCTBenhNhan();
                    qlND.InsertCTBenhNhan(ctbn);

                    List<CTBenhNhanComplaint> listComplaint = GetInfCTBenhNhanComplaint();
                    qlND.InsertListCTBenhNhanComplaint(listComplaint);

                    List<CTBenhNhanConditionDicsJoint> listDiscJoint = GetInfCTBenhNhanConditionDicsJoint();
                    qlND.InsertListCTBenhNhanConditionDicsJoint(listDiscJoint);

                    CTBenhNhanCondition cTBenhNhanConditions = GetInfCTBenhNhanCondition();
                    qlND.InsertCTBenhNhanCondition(cTBenhNhanConditions);

                    List<CTBenhNhanConditionVertebral> listCTBenhNhanConditionVertebral = GetInfCTBenhNhanConditionVertebral();
                    qlND.InsertListCTBenhNhanConditionVertebral(listCTBenhNhanConditionVertebral);

                    List<CTBenhNhanExcercise> ListCTBenhNhanExcercises = GetInfCTBenhNhanExcercise();
                    qlND.InsertListCTBenhNhanExcercise(ListCTBenhNhanExcercises);

                    List<CTBenhNhanMRIImage> listCTBenhNhanMRIImage = GetInfCTBenhNhanMRIImage();
                    qlND.InsertListCTBenhNhanMRIImage(listCTBenhNhanMRIImage);

                    List<CTBenhNhanSnapShot> listCTBenhNhanSnapShot = GetInfCTBenhNhanSnapShot();
                    qlND.InsertListCTBenhNhanSnapShot(listCTBenhNhanSnapShot);

                    //PrintPatient(txtFileNumberPatient.Text, lblCTBenhNhan.Text);
                    //Print
                    rptPatientMedical rptAll = new rptPatientMedical();

                    //rptAll.parThangNam.Value = string.Format("DANH SÁCH CUỘC GỌI TỪ KHÁCH HÀNG THÁNG {0}/{1}", thang, nam);
                    //rptAll.parThangNam.Visible = false;

                    //rptAll.DataSource = list;
                    //BindToBand
                    DetailReportBand cTBenhNhanComplaint = rptAll.Bands["DetailReport_Complant"] as DetailReportBand;
                    cTBenhNhanComplaint.DataSource = listComplaint;
                    DetailReportBand cTBenhNhanMRIImage = rptAll.Bands["DetailReport_MRI"] as DetailReportBand;
                    cTBenhNhanMRIImage.DataSource = listCTBenhNhanMRIImage;
                    DetailReportBand cTBenhNhanDicsJoint = rptAll.Bands["DetailReport_DiscAndJoint"] as DetailReportBand;
                    cTBenhNhanDicsJoint.DataSource = listDiscJoint;

                    //List<CTBenhNhanCondition> listCondition = qlND.GetDSCTBenhNhanConditionByIDCTBenhNhan(lblCTBenhNhan.Text);
                    ////DetailReportBand cTBenhNhanAnkle = rptAll.Bands["DetailReport_Ankle"] as DetailReportBand;
                    ////cTBenhNhanAnkle.DataSource = cTBenhNhanConditions;
                    List<CTBenhNhanCondition> listCondition = new List<CTBenhNhanCondition>();
                    listCondition.Add(cTBenhNhanConditions);
                    DetailReportBand DetailReport_Ankle = rptAll.Bands["DetailReport_Ankle"] as DetailReportBand;
                    DetailReport_Ankle.DataSource = listCondition;
                    DetailReportBand DetailReport_Elbow = rptAll.Bands["DetailReport_Elbow"] as DetailReportBand;
                    DetailReport_Elbow.DataSource = listCondition;
                    DetailReportBand DetailReport_Foot = rptAll.Bands["DetailReport_Foot"] as DetailReportBand;
                    DetailReport_Foot.DataSource = listCondition;
                    DetailReportBand DetailReport_Hip = rptAll.Bands["DetailReport_Hip"] as DetailReportBand;
                    DetailReport_Hip.DataSource = listCondition;
                    DetailReportBand DetailReport_Knee = rptAll.Bands["DetailReport_Knee"] as DetailReportBand;
                    DetailReport_Knee.DataSource = listCondition;
                    DetailReportBand DetailReport_Posture = rptAll.Bands["DetailReport_Posture"] as DetailReportBand;
                    DetailReport_Posture.DataSource = listCondition;
                    DetailReportBand DetailReport_Sacroiliac = rptAll.Bands["DetailReport_Sacroiliac"] as DetailReportBand;
                    DetailReport_Sacroiliac.DataSource = listCondition;
                    DetailReportBand DetailReport_Scoliosis = rptAll.Bands["DetailReport_Scoliosis"] as DetailReportBand;
                    DetailReport_Scoliosis.DataSource = listCondition;
                    DetailReportBand DetailReport_Shoulder = rptAll.Bands["DetailReport_Shoulder"] as DetailReportBand;
                    DetailReport_Shoulder.DataSource = listCondition;
                    DetailReportBand DetailReport_Wrist = rptAll.Bands["DetailReport_Wrist"] as DetailReportBand;
                    DetailReport_Wrist.DataSource = listCondition;

                    DetailReportBand cTBenhNhanVertebral = rptAll.Bands["DetailReport_Vertebral"] as DetailReportBand;
                    cTBenhNhanVertebral.DataSource = listCTBenhNhanConditionVertebral;
                    DetailReportBand cTBenhNhanSnap = rptAll.Bands["DetailReport_Snap"] as DetailReportBand;
                    cTBenhNhanSnap.DataSource = listCTBenhNhanSnapShot;

                    List<sp_GetDSExcerciseByIDCTBNResult> listEx2 = qlND.GetDSExcerciseByIDCTBN(lblCTBenhNhan.Text);
                    DetailReportBand DetailReport_Excercises = rptAll.Bands["DetailReport_Excercises"] as DetailReportBand;
                    DetailReport_Excercises.DataSource = listEx2;

                    rptAll.parComment.Value = ctbn.Comment.ToString();
                    rptAll.parComment.Visible = false;
                    rptAll.parDate.Value = ctbn.NgayKham.ToString();
                    rptAll.parDate.Visible = false;
                    rptAll.parFileNumber.Value = bn.ID.ToString();
                    rptAll.parFileNumber.Visible = false;
                    rptAll.parName.Value = bn.TenBN.ToString();
                    rptAll.parName.Visible = false;
                    rptAll.parTreamentFor.Value = ctbn.TreatmentTimeFor.ToString();
                    rptAll.parTreamentFor.Visible = false;
                    rptAll.parTreamentTime.Value = ctbn.TreatmentTime.ToString();
                    rptAll.parTreamentTime.Visible = false;
                    rptAll.parTreamentTotal.Value = ctbn.TreatmentTimeFor.ToString();
                    rptAll.parTreamentTotal.Visible = false;

                    ReportPrintTool tool = new ReportPrintTool(rptAll);
                    //tool.PreviewForm.Shown += new EventHandler(PreviewForm_Shown);
                    tool.ShowPreviewDialog();
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Save error");
            }
        }
        private void sbIn_Click(object sender, EventArgs e)
        {
            DataTable dt3 = gcSanPhamTrongHoaDon.DataSource as DataTable;
            if (dt3 == null || dt3.Rows.Count == 0)
            {
                XtraMessageBox.Show("Hóa Đơn Này Không Có Sản Phẩm",
                                                       "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                HoaDonDatHang hd = new HoaDonDatHang();
                hd.DanhSachSanPham = gcSanPhamTrongHoaDon.DataSource as DataTable;
                hd.NgayGiaoHang = deNgayGiaoHang.DateTime.ToString();
                hd.NgayLap = deNgayDatHang.DateTime.ToString();
                hd.NhaCungCap = cbeNhaCungCap.Text;
                hd.TenNhanVien = TenNhanVienLap;
                hd.TongTien = tongtien;
                XRLapHoaDonDatHang BanInHoaDonDatHang = new XRLapHoaDonDatHang(hd);
                try
                {
                    BanInHoaDonDatHang.CreateDocument();
                }
                catch (Exception ex)
                {

                }
                ReportPrintTool printTool = new ReportPrintTool(BanInHoaDonDatHang);
                printTool.ShowPreviewDialog();
            }
        }
Ejemplo n.º 40
0
        private void simpleButton_Xuat_Click(object sender, EventArgs e)
        {
            switch (comboBoxEdit_LoaiBaoCao.SelectedIndex)
            {
                #region Báo cáo tăng giảm tài sản cố định

                case 0:
                    if (dateEdit_TuNgay.DateTime.Date > DateTime.Today.Date)
                    {
                        XtraMessageBox.Show("Ngày từ không được lớn hơn ngày hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dateEdit_TuNgay.Focus();
                        return;
                    }
                    if (dateEdit_DenNgay.DateTime.Date > DateTime.Today.Date)
                    {
                        XtraMessageBox.Show("Ngày đến không được lớn hơn ngày hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dateEdit_DenNgay.Focus();
                        return;
                    }
                    if (dateEdit_TuNgay.DateTime.Date > dateEdit_DenNgay.DateTime.Date)
                    {
                        XtraMessageBox.Show("Ngày từ không được lớn hơn ngày đến", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dateEdit_TuNgay.Focus();
                        return;
                    }
                    if (checkEdit_XuatBaoCao.Checked)
                    {
                        IsDesign = false;
                    }
                    else if (checkEdit_ThietKe.Checked)
                    {
                        IsDesign = true;
                    }

                    ShowAndHide(false);
                    labelControl_Status.Text = "Đang tạo report, vui lòng chờ trong giây lát...";

                    _ThreadReport = new System.Threading.Thread(() =>
                    {
                        DevExpress.UserSkins.BonusSkins.Register();
                        Application.EnableVisualStyles();
                        UserLookAndFeel.Default.SetSkinStyle(TSCD.Global.local_setting.ApplicationSkinName);
                        DevExpress.Skins.SkinManager.EnableFormSkins();

                        DateTime From = dateEdit_TuNgay.DateTime.Date, To = dateEdit_DenNgay.DateTime.Date;
                        List<TK_TangGiam_TheoLoaiTS> Data = GetData_BaoCaoTangGiamTaiSanCoDinh(From, To);

                        TSCD_GUI.ReportTSCD.XtraReport_BaoCaoTangGiamTSCD _XtraReport_BaoCaoTangGiamTSCD = new ReportTSCD.XtraReport_BaoCaoTangGiamTSCD(Data, From, To);
                        if (IsDesign)
                        {
                            ReportDesignTool designTool = new ReportDesignTool(_XtraReport_BaoCaoTangGiamTSCD);

                            ReportCompeleted();

                            designTool.ShowDesignerDialog();

                            ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                        else
                        {
                            ReportPrintTool printTool = new ReportPrintTool(_XtraReport_BaoCaoTangGiamTSCD);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            ReportCompeleted();

                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                    });
                    _ThreadReport.SetApartmentState(ApartmentState.STA);
                    _ThreadReport.Start();
                    break;

                #endregion

                #region Sổ tài sản cố định

                case 1:
                    if (dateEdit_Nam.DateTime.Year > DateTime.Today.Year)
                    {
                        XtraMessageBox.Show("Năm lớn hơn năm hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    List<Guid> ListLoaiTaiSan = ucComboBoxLoaiTS_LoaiTaiSan.list_loaitaisan;
                    if (Object.Equals(ListLoaiTaiSan, null))
                    {
                        XtraMessageBox.Show("Chưa chọn loại tài sản cần thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    if (!(ListLoaiTaiSan.Count > 0))
                    {
                        XtraMessageBox.Show("Chưa chọn loại tài sản cần thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    List<Guid> ListCoSo = CheckedComboBoxEditHelper.getCheckedValueArray(checkedComboBoxEdit_ChonCoSo);
                    if (!checkEdit_ChuaCoViTri.Checked)
                    {
                        if (Object.Equals(ListCoSo, null))
                        {
                            XtraMessageBox.Show("Chưa chọn cơ sở cần thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        if (!(ListCoSo.Count > 0))
                        {
                            XtraMessageBox.Show("Chưa chọn cơ sở cần thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                    }
                    if (checkEdit_XuatBaoCao.Checked)
                    {
                        IsDesign = false;
                    }
                    else if (checkEdit_ThietKe.Checked)
                    {
                        IsDesign = true;
                    }

                    ShowAndHide(false);
                    labelControl_Status.Text = "Đang tạo report, vui lòng chờ trong giây lát...";

                    _ThreadReport = new System.Threading.Thread(() =>
                    {
                        DevExpress.UserSkins.BonusSkins.Register();
                        Application.EnableVisualStyles();
                        UserLookAndFeel.Default.SetSkinStyle(TSCD.Global.local_setting.ApplicationSkinName);
                        DevExpress.Skins.SkinManager.EnableFormSkins();

                        Object Data = GetData_SoTaiSanCoDinh(ListLoaiTaiSan, ListCoSo, dateEdit_Nam.DateTime.Year, checkEdit_ChuaCoViTri.Checked);

                        TSCD_GUI.ReportTSCD.XtraReport_SoTaiSanCoDinh _XtraReport_SoTaiSanCoDinh = new ReportTSCD.XtraReport_SoTaiSanCoDinh(Data, dateEdit_Nam.DateTime.Year);
                        if (IsDesign)
                        {
                            ReportDesignTool designTool = new ReportDesignTool(_XtraReport_SoTaiSanCoDinh);

                            ReportCompeleted();

                            designTool.ShowDesignerDialog();

                            ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                        else
                        {
                            ReportPrintTool printTool = new ReportPrintTool(_XtraReport_SoTaiSanCoDinh);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            ReportCompeleted();

                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                    });
                    _ThreadReport.SetApartmentState(ApartmentState.STA);
                    _ThreadReport.Start();
                    break;

                #endregion

                #region Sổ chi tiết tài sản cố định

                case 2:
                    if (dateEdit_Nam.DateTime.Year > DateTime.Today.Year)
                    {
                        XtraMessageBox.Show("Năm lớn hơn năm hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    else if (Object.Equals(ucComboBoxDonVi_ChonDonVi.DonVi, null))
                    {
                        XtraMessageBox.Show("Chưa chọn đơn vị", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    else if (Object.Equals(ucComboBoxDonVi_ChonDonVi.DonVi.id, Guid.Empty))
                    {
                        XtraMessageBox.Show("Chưa chọn đơn vị", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    if (checkEdit_XuatBaoCao.Checked)
                    {
                        IsDesign = false;
                    }
                    else if (checkEdit_ThietKe.Checked)
                    {
                        IsDesign = true;
                    }

                    ShowAndHide(false);
                    labelControl_Status.Text = "Đang tạo report, vui lòng chờ trong giây lát...";

                    _ThreadReport = new System.Threading.Thread(() =>
                    {
                        DevExpress.UserSkins.BonusSkins.Register();
                        Application.EnableVisualStyles();
                        UserLookAndFeel.Default.SetSkinStyle(TSCD.Global.local_setting.ApplicationSkinName);
                        DevExpress.Skins.SkinManager.EnableFormSkins();

                        var DonViSelected = ucComboBoxDonVi_ChonDonVi.DonVi;
                        Object Data = null;
                        String strTenDonVi = "";
                        if (!Object.Equals(DonViSelected, null))
                        {
                            strTenDonVi = DonViSelected.ten;
                            Data = GetData_SoChiTietTaiSanCoDinh(DonViSelected.id, dateEdit_Nam.DateTime.Year);
                        }

                        TSCD_GUI.ReportTSCD.XtraReport_SoChiTietTaiSanCoDinh _XtraReport_SoChiTietTaiSanCoDinh = new ReportTSCD.XtraReport_SoChiTietTaiSanCoDinh(Data, dateEdit_Nam.DateTime.Year, strTenDonVi);
                        if (IsDesign)
                        {
                            ReportDesignTool designTool = new ReportDesignTool(_XtraReport_SoChiTietTaiSanCoDinh);

                            ReportCompeleted();

                            designTool.ShowDesignerDialog();

                            ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                        else
                        {
                            ReportPrintTool printTool = new ReportPrintTool(_XtraReport_SoChiTietTaiSanCoDinh);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            ReportCompeleted();

                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                    });
                    _ThreadReport.SetApartmentState(ApartmentState.STA);
                    _ThreadReport.Start();
                    break;

                #endregion

                #region Sổ theo dõi tài sản cố định tại nơi sử dụng

                case 3:
                    if (Object.Equals(ucComboBoxDonVi_ChonDonVi.DonVi, null))
                    {
                        XtraMessageBox.Show("Chưa chọn đơn vị", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    else if (Object.Equals(ucComboBoxDonVi_ChonDonVi.DonVi.id, Guid.Empty))
                    {
                        XtraMessageBox.Show("Chưa chọn đơn vị", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    if (checkEdit_XuatBaoCao.Checked)
                    {
                        IsDesign = false;
                    }
                    else if (checkEdit_ThietKe.Checked)
                    {
                        IsDesign = true;
                    }

                    ShowAndHide(false);
                    labelControl_Status.Text = "Đang tạo report, vui lòng chờ trong giây lát...";

                    _ThreadReport = new System.Threading.Thread(() =>
                    {
                        DevExpress.UserSkins.BonusSkins.Register();
                        Application.EnableVisualStyles();
                        UserLookAndFeel.Default.SetSkinStyle(TSCD.Global.local_setting.ApplicationSkinName);
                        DevExpress.Skins.SkinManager.EnableFormSkins();

                        var DonViSelected = ucComboBoxDonVi_ChonDonVi.DonVi;
                        Object Data = null;
                        String strTenDonVi = "";
                        if (!Object.Equals(DonViSelected, null))
                        {
                            strTenDonVi = DonViSelected.ten;
                            Data = GetData_SoTheoDoiTaiSanCoDinhTaiNoiSuDung(DonViSelected.id);
                        }

                        TSCD_GUI.ReportTSCD.XtraReport_SoTheoDoiTSCDTaiNoiSuDung _XtraReport_SoTheoDoiTSCDTaiNoiSuDung = new ReportTSCD.XtraReport_SoTheoDoiTSCDTaiNoiSuDung(Data, strTenDonVi);
                        if (IsDesign)
                        {
                            ReportDesignTool designTool = new ReportDesignTool(_XtraReport_SoTheoDoiTSCDTaiNoiSuDung);

                            ReportCompeleted();

                            designTool.ShowDesignerDialog();

                            ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                        else
                        {
                            ReportPrintTool printTool = new ReportPrintTool(_XtraReport_SoTheoDoiTSCDTaiNoiSuDung);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            ReportCompeleted();

                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                    });
                    _ThreadReport.SetApartmentState(ApartmentState.STA);
                    _ThreadReport.Start();
                    break;

                #endregion

                case 4:
                    XtraMessageBox.Show("Chức năng này chưa có", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    break;
                default:
                    break;
            }
        }
Ejemplo n.º 41
0
        private void simpleButtonPrint_Click(object sender, EventArgs e)
        {
            string pathname = "";
            string filePath = "";
            DataTable GeneralInfo = new DataTable();
            DataTable GridTableCheckbox = new DataTable();

            GridTableCheckbox = ((DataTable)gridControlReciept.DataSource);

            XtraReport1 report1 = new XtraReport1();
            report1.CreateDocument();

            for (int i = 0; i < GridTableCheckbox.Rows.Count; i++)
            {
                if ((bool)(GridTableCheckbox.Rows[i]["checkbox"]) == true)
                {

                    if (GridTableCheckbox.Rows[i]["rec_trans_type"].To<bool>()==true)
                    {
                        PrintDocuments.reciept_manual PrintReciept = new DXWindowsApplication2.PrintDocuments.reciept_manual();

                        GeneralInfo = BusinessLogicBridge.DataStore.getGeneralConfig();
                        filePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                        filePath = filePath + @"\" + GeneralInfo.Rows[0]["path_all_document"].ToString();

                        pathname = DXWindowsApplication2.MainForm.CombinePaths(filePath, "Reciept", GridTableCheckbox.Rows[i].Table.Rows[0]["rec_trans_number"].ToString() + ".pdf");

                        PrintReciept.loopGenDataRow(GridTableCheckbox.Rows[i]["rec_trans_id"].To<int>());
                        PrintReciept.CreateDocument();
                        //PrintReciept.ExportToPdf(pathname);
                        //PrintReciept.ShowPreview();

                        report1.Pages.AddRange(PrintReciept.Pages);

                    }else{

                        if (GridTableCheckbox.Rows[i]["rec_trans_category"].To<int>() == 1)
                        {
                            PrintDocuments.reciept_booking PrintReciept = new DXWindowsApplication2.PrintDocuments.reciept_booking();

                            GeneralInfo = BusinessLogicBridge.DataStore.getGeneralConfig();
                            filePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                            filePath = filePath + @"\" + GeneralInfo.Rows[0]["path_all_document"].ToString();

                            pathname = DXWindowsApplication2.MainForm.CombinePaths(filePath, "Reciept", GridTableCheckbox.Rows[i].Table.Rows[0]["rec_trans_number"].ToString() + ".pdf");
                            PrintReciept.loopGenDataRow(GridTableCheckbox.Rows[i]["rec_trans_id"].To<int>());
                            PrintReciept.CreateDocument();
                            //PrintReciept.ExportToPdf(pathname);
                            //PrintReciept.ShowPreview();
                            report1.Pages.AddRange(PrintReciept.Pages);

                        }
                        else if (GridTableCheckbox.Rows[i]["rec_trans_category"].To<int>() == 2)
                        {
                            PrintDocuments.reciept_checkin PrintReciept = new DXWindowsApplication2.PrintDocuments.reciept_checkin();

                            GeneralInfo = BusinessLogicBridge.DataStore.getGeneralConfig();
                            filePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                            filePath = filePath + @"\" + GeneralInfo.Rows[0]["path_all_document"].ToString();

                            pathname = DXWindowsApplication2.MainForm.CombinePaths(filePath, "Reciept", GridTableCheckbox.Rows[i].Table.Rows[0]["rec_trans_number"].ToString() + ".pdf");

                            PrintReciept.loopGenDataRow(GridTableCheckbox.Rows[i]["rec_trans_id"].To<int>());
                            PrintReciept.CreateDocument();
                            //PrintReciept.ExportToPdf(pathname);
                            //PrintReciept.ShowPreview();
                            report1.Pages.AddRange(PrintReciept.Pages);

                        }
                        else{
                            PrintDocuments.reciept PrintReciept = new DXWindowsApplication2.PrintDocuments.reciept();
                            GeneralInfo = BusinessLogicBridge.DataStore.getGeneralConfig();
                            filePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                            filePath = filePath + @"\" + GeneralInfo.Rows[0]["path_all_document"].ToString();

                            pathname = DXWindowsApplication2.MainForm.CombinePaths(filePath, "Reciept", GridTableCheckbox.Rows[i].Table.Rows[0]["rec_trans_number"].ToString() + ".pdf");

                            PrintReciept.loopGenDataRow(GridTableCheckbox.Rows[i]["rec_trans_id"].To<int>());
                            PrintReciept.CreateDocument();
                            //PrintReciept.ExportToPdf(pathname);
                            //PrintReciept.ShowPreview();

                            report1.Pages.AddRange(PrintReciept.Pages);
                        }
                    }

                    BusinessLogicBridge.DataStore.setRecieptPrint(GridTableCheckbox.Rows[i]["rec_trans_id"].To<int>());
                }
            }

            report1.PrintingSystem.ContinuousPageNumbering = true;

            // Create a Print Tool and show the Print Preview form.
            ReportPrintTool printTool = new ReportPrintTool(report1);
            printTool.ShowPreviewDialog();

            LoadListReciept();
        }
        public void PrintPatient(string IDBenhNhan, string IDCTBenhNhan)
        {
            //var rowHandle = gridView_CuocGoi.FocusedRowHandle;
            //// Get the value for the given column - convert to the type you're expecting
            //string IDBenhNhan = gridView_CuocGoi.GetRowCellValue(rowHandle, "IDBenhNhan").ToString();
            //string IDCTBenhNhan = gridView_CuocGoi.GetRowCellValue(rowHandle, "IDCTBenhNhan").ToString();
            //LoadList
            List<CTBenhNhanComplaint> listComplaint = qlND.GetDSCTBenhNhanComplaintByIDCTBenhNhan(IDCTBenhNhan);
            List<CTBenhNhanMRIImage> listMRIImage = qlND.GetDSCTBenhNhanMRIImageByIDCTBenhNhan(IDCTBenhNhan);
            List<CTBenhNhanCondition> listCondition = qlND.GetDSCTBenhNhanConditionByIDCTBenhNhan(IDCTBenhNhan);
            List<CTBenhNhanConditionDicsJoint> listConditionDicsJoint = qlND.GetDSCTBenhNhanConditionDicsJointByIDCTBenhNhan(IDCTBenhNhan);
            List<CTBenhNhanConditionVertebral> listConditionVertebral = qlND.GetDSCTBenhNhanConditionVertebralByIDCTBenhNhan(IDCTBenhNhan);
            List<CTBenhNhanExcercise> listExcercise = qlND.GetDSCTBenhNhanExcerciseByIDCTBenhNhan(IDCTBenhNhan);
            List<CTBenhNhanSnapShot> listSnapShot = qlND.GetDSCTBenhNhanSnapShotByIDCTBenhNhan(IDCTBenhNhan);
            CTBenhNhan cTBenhNhan = qlND.GetCTBenhNhanByIDCTBenhNhan(IDCTBenhNhan).SingleOrDefault();
            BenhNhan benhNhan = qlND.GetBenhNhanByID(IDBenhNhan);
            List<sp_GetDSExcerciseByIDCTBNResult> listEx = qlND.GetDSExcerciseByIDCTBN(IDCTBenhNhan);

            rptPatientMedical rptAll = new rptPatientMedical();

            //rptAll.parThangNam.Value = string.Format("DANH SÁCH CUỘC GỌI TỪ KHÁCH HÀNG THÁNG {0}/{1}", thang, nam);
            //rptAll.parThangNam.Visible = false;

            //rptAll.DataSource = list;
            //BindToBand
            DetailReportBand cTBenhNhanComplaint = rptAll.Bands["DetailReport_Complant"] as DetailReportBand;
            cTBenhNhanComplaint.DataSource = listComplaint;
            DetailReportBand cTBenhNhanMRIImage = rptAll.Bands["DetailReport_MRI"] as DetailReportBand;
            cTBenhNhanMRIImage.DataSource = listMRIImage;
            DetailReportBand cTBenhNhanDicsJoint = rptAll.Bands["DetailReport_DiscAndJoint"] as DetailReportBand;
            cTBenhNhanDicsJoint.DataSource = listConditionDicsJoint;

            DetailReportBand cTBenhNhanAnkle = rptAll.Bands["DetailReport_Ankle"] as DetailReportBand;
            cTBenhNhanAnkle.DataSource = listCondition;
            DetailReportBand DetailReport_Ankle = rptAll.Bands["DetailReport_Ankle"] as DetailReportBand;
            DetailReport_Ankle.DataSource = listCondition;
            DetailReportBand DetailReport_Elbow = rptAll.Bands["DetailReport_Elbow"] as DetailReportBand;
            DetailReport_Elbow.DataSource = listCondition;
            DetailReportBand DetailReport_Foot = rptAll.Bands["DetailReport_Foot"] as DetailReportBand;
            DetailReport_Foot.DataSource = listCondition;
            DetailReportBand DetailReport_Hip = rptAll.Bands["DetailReport_Hip"] as DetailReportBand;
            DetailReport_Hip.DataSource = listCondition;
            DetailReportBand DetailReport_Knee = rptAll.Bands["DetailReport_Knee"] as DetailReportBand;
            DetailReport_Knee.DataSource = listCondition;
            DetailReportBand DetailReport_Posture = rptAll.Bands["DetailReport_Posture"] as DetailReportBand;
            DetailReport_Posture.DataSource = listCondition;
            DetailReportBand DetailReport_Sacroiliac = rptAll.Bands["DetailReport_Sacroiliac"] as DetailReportBand;
            DetailReport_Sacroiliac.DataSource = listCondition;
            DetailReportBand DetailReport_Scoliosis = rptAll.Bands["DetailReport_Scoliosis"] as DetailReportBand;
            DetailReport_Scoliosis.DataSource = listCondition;
            DetailReportBand DetailReport_Shoulder = rptAll.Bands["DetailReport_Shoulder"] as DetailReportBand;
            DetailReport_Shoulder.DataSource = listCondition;
            DetailReportBand DetailReport_Wrist = rptAll.Bands["DetailReport_Wrist"] as DetailReportBand;
            DetailReport_Wrist.DataSource = listCondition;

            DetailReportBand cTBenhNhanVertebral = rptAll.Bands["DetailReport_Vertebral"] as DetailReportBand;
            cTBenhNhanVertebral.DataSource = listConditionVertebral;
            DetailReportBand cTBenhNhanSnap = rptAll.Bands["DetailReport_Snap"] as DetailReportBand;
            cTBenhNhanSnap.DataSource = listSnapShot;
            DetailReportBand DetailReport_Excercises = rptAll.Bands["DetailReport_Excercises"] as DetailReportBand;
            DetailReport_Excercises.DataSource = listEx;
            //DetailReportBand cTBenhNhanComment = rptAll.Bands["DetailReport_Comment"] as DetailReportBand;
            //cTBenhNhanComment.DataSource = cTBenhNhan.Comment;

            rptAll.parComment.Value = cTBenhNhan.Comment.ToString();
            rptAll.parComment.Visible = false;
            rptAll.parDate.Value = cTBenhNhan.NgayKham.ToString();
            rptAll.parDate.Visible = false;
            rptAll.parFileNumber.Value = benhNhan.ID.ToString();
            rptAll.parFileNumber.Visible = false;
            rptAll.parName.Value = benhNhan.TenBN.ToString();
            rptAll.parName.Visible = false;
            rptAll.parTreamentFor.Value = cTBenhNhan.TreatmentTimeFor.ToString();
            rptAll.parTreamentFor.Visible = false;
            rptAll.parTreamentTime.Value = cTBenhNhan.TreatmentTime.ToString();
            rptAll.parTreamentTime.Visible = false;
            rptAll.parTreamentTotal.Value = cTBenhNhan.TreatmentTimeFor.ToString();
            rptAll.parTreamentTotal.Visible = false;

            ReportPrintTool tool = new ReportPrintTool(rptAll);
            //tool.PreviewForm.Shown += new EventHandler(PreviewForm_Shown);
            tool.ShowPreviewDialog();
        }
        private void simpleButton_View_Click(object sender, EventArgs e)
        {
            //View
            if (comboBoxEdit_Report.SelectedIndex == 0)
            {
                splashScreenManager_Report.ShowWaitForm();
                splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                XtraReport_Template _XtraReport_Template = new XtraReport_Template(FillDatasetFromGrid(), gridViewThongKe, checkEdit_Landscape.Checked);
                ReportPrintTool printTool = new ReportPrintTool(_XtraReport_Template);
                splashScreenManager_Report.CloseWaitForm();
                printTool.ShowPreviewDialog();

            }
            else
            {
                splashScreenManager_Report.ShowWaitForm();
                splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                XtraReport_XtraGrid _XtraReport_XtraGrid = new XtraReport_XtraGrid(gridControlThongKe, checkEdit_Landscape.Checked);
                ReportPrintTool printTool = new ReportPrintTool(_XtraReport_XtraGrid);
                splashScreenManager_Report.CloseWaitForm();
                printTool.ShowPreviewDialog();

            }
        }
Ejemplo n.º 44
0
        private void barBtnXuatBaoCao_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (Object.Equals(NhanVienPTs, null))
            {
                XtraMessageBox.Show("Chưa có nhân viên phụ trách", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (NhanVienPTs.Count > 0)
            {
                try
                {
                    DevExpress.XtraSplashScreen.SplashScreenManager splashScreenManager_Report = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::PTB_GUI.WaitForm1), true, true, DevExpress.XtraSplashScreen.ParentType.UserControl);
                    splashScreenManager_Report.ShowWaitForm();
                    splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                    splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                    XtraReport_Template _XtraReport_Template = new XtraReport_Template(SHARED.Libraries.ReportHelper.FillDatasetFromGrid(gridViewNhanVien), gridViewNhanVien, barCheckItemLandscape.Checked, false);
                    _XtraReport_Template.SetTitleText("Danh Sách Nhân Viên Phụ Trách");
                    if (barCheckItemThietKe.Checked)
                    {
                        ReportDesignTool designTool = new ReportDesignTool(_XtraReport_Template);
                        splashScreenManager_Report.CloseWaitForm();
                        designTool.ShowDesignerDialog();

                        ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                        printTool.ShowPreviewDialog();
                    }
                    else
                    {
                        ReportPrintTool printTool = new ReportPrintTool(_XtraReport_Template);
                        splashScreenManager_Report.CloseWaitForm();
                        printTool.ShowPreviewDialog();
                    }
                }
                catch
                {
                    XtraMessageBox.Show("Đã xảy ra lỗi!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                XtraMessageBox.Show("Chưa có nhân viên phụ trách", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 45
0
        public void Set_Export()
        {
            try
            {
                if (string.IsNullOrWhiteSpace(txtCOD_ORCO.Text))
                    throw new ArgumentException(_Message.MsgSelectOC);
                var oc = new xrPurchaseOrder();
                var odoc = new BEDocument()
                {
                    ALF_DOCU_REFE = txtALF_DOCU_REFE.Text.Trim(),
                    ALF_SOCI_NEGO = bteCOD_SOCI_NEGO.Text,
                    ALF_DIRE_ENTR = mmeALF_DIRE_ENTR.Text.Trim(),
                    ALF_COND_PAGO = lkeCOD_COND_PAGO.Text,
                    FEC_REGI = (DateTime?)dteFEC_REGI.EditValue,
                    ALF_COME = mmeALF_COME.Text,
                    NUM_SUBB_TOTA = Convert.ToDecimal(txtNUM_SUBB_TOTA.EditValue),
                    NUM_DESC = Convert.ToDecimal(txtNUM_DESC.EditValue),
                    NUM_IGVV = Convert.ToDecimal(txtNUM_IGVV.EditValue),
                    NUM_TOTA = Convert.ToDecimal(txtNUM_TOTA.EditValue)
                };

                oc.bdsDocument.DataSource = odoc;
                oc.bdsDocumentLines.DataSource = (List<BEDocumentLines>)gdvLines.DataSource;

                var SIMB = (BESVMC_MONE)lkeCOD_MONE.GetSelectedDataRow();
                var tfs = (SIMB.ALF_MONE_SIMB == "USD") ? "{0:USD 0.00}" : "{0:c2}";
                oc.lblNUM_SUBB_TOTA.DataBindings["Text"].FormatString = tfs;
                oc.lblNUM_DESC.DataBindings["Text"].FormatString = tfs;
                oc.lblNUM_IGVV.DataBindings["Text"].FormatString = tfs;
                oc.lblNUM_TOTA.DataBindings["Text"].FormatString = tfs;

                oc.tlcNUM_PREC_UNIT.DataBindings["Text"].FormatString = tfs;
                oc.tlcNUM_DESC.DataBindings["Text"].FormatString = tfs;
                oc.tlcNUM_PREC_DESC.DataBindings["Text"].FormatString = tfs;
                oc.tlcNUM_IMPO.DataBindings["Text"].FormatString = tfs;
                using (var printTool = new ReportPrintTool(oc))
                {
                    printTool.ShowPreviewDialog();
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message,
                                    _Message.MsgInsCaption,
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
            }
        }
        private void barBtnXuatBaoCao_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (Object.Equals(objPhong, null))
            {
                XtraMessageBox.Show("Chưa chọn phòng!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (Object.Equals(objPhong.id, Guid.Empty))
            {
                XtraMessageBox.Show("Chưa chọn phòng!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            String strViTri = "[Không Rõ]";
            if (!Object.Equals(objPhong.vitri, null))
                strViTri = objPhong.vitri.coso != null ? objPhong.vitri.coso.ten + (objPhong.vitri.day != null ? " - " + objPhong.vitri.day.ten + (objPhong.vitri.tang != null ? " - " + objPhong.vitri.tang.ten : "") : "") : "";
            if (Object.Equals(listCTThietBis, null))
            {
                XtraMessageBox.Show(String.Format("Phòng {0} ({1}) chưa có thiết bị!", objPhong.ten, strViTri), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                if (listCTThietBis.Count > 0)
                {
                    try
                    {
                        DevExpress.XtraSplashScreen.SplashScreenManager splashScreenManager_Report = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::PTB_GUI.WaitForm1), true, true, DevExpress.XtraSplashScreen.ParentType.UserControl);
                        splashScreenManager_Report.ShowWaitForm();
                        splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                        splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                        XtraReport_Template _XtraReport_Template = new XtraReport_Template(SHARED.Libraries.ReportHelper.FillDatasetFromGrid(gridViewCTThietBi), gridViewCTThietBi, barCheckItemLandscape.Checked);
                        _XtraReport_Template.SetTitleText(String.Format("Danh Sách Thiết Bị Tại Phòng: {0} ({1})", objPhong.ten, strViTri));
                        if (barCheckItemThietKe.Checked)
                        {
                            ReportDesignTool designTool = new ReportDesignTool(_XtraReport_Template);
                            splashScreenManager_Report.CloseWaitForm();
                            designTool.ShowDesignerDialog();

                            ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                            printTool.ShowPreviewDialog();
                        }
                        else
                        {
                            ReportPrintTool printTool = new ReportPrintTool(_XtraReport_Template);
                            splashScreenManager_Report.CloseWaitForm();
                            printTool.ShowPreviewDialog();
                        }
                    }
                    catch
                    {
                        XtraMessageBox.Show("Đã xảy ra lỗi!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    XtraMessageBox.Show(String.Format("Phòng {0} ({1}) chưa có thiết bị!", objPhong.ten, strViTri), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Ejemplo n.º 47
0
        private void buttonPrint_Click(object sender, EventArgs e)
        {
            bool resultValidateForm = validateForm();
            if (!resultValidateForm)
            {
                return;
            }
            MiniReport mini = new MiniReport();

            mini.dateTimeThai.Text = "";
            mini.inDocumentNumber.Text = inDocumentNumber.Text;
            mini.customerName.Text = customerName.Text;
            mini.address.Text = address.Text;
            mini.phone.Text = phone.Text;
            mini.productName.Text = productName.Text;
            mini.company.Text = companyName.Text;
            mini.productType.Text = productType.Text;
            mini.dtProductEndDate.Text = dtProductEndDate.Text;
            if (radioButtonInWarranty.Checked)
            {
                mini.warranty.Text = "ในประกัน";
            mini.chargebacks.Text = "0";
            }
            else
            {
                mini.warranty.Text = "นอกประกัน";
                mini.chargebacks.Text = textEditChargebacks.Text;
            }
            mini.symptom.Text = symptom.Text.Trim() == "" ? "-" : symptom.Text.Trim();
            mini.equipment.Text = equipment.Text.Trim() == "" ? "-" : equipment.Text.Trim();
            mini.detail2.Text = detail.Text.Trim() == "" ? "-" : detail.Text.Trim();

            fRMMain.showWaitingForm("กำลังทำการเปิดหน้าปริ้น");
            ReportPrintTool pt = new ReportPrintTool(mini);

            // Get the Print Tool's printing system.
            PrintingSystemBase ps = pt.PrintingSystem;
            fRMMain.closeWaitingForm();

            // Show a report's Print Preview.
            pt.ShowPreviewDialog();

            // Zoom the print preview, so that it fits the entire page.
            ps.ExecCommand(PrintingSystemCommand.ViewWholePage);

            // Invoke the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { true });

            // Hide the Hand tool.
            ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { false });
        }
Ejemplo n.º 48
0
        private void barBtnXuatBaoCao_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (Object.Equals(_ViTriHienTai, null))
            {
                XtraMessageBox.Show("Chưa chọn vị trí!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (Object.Equals(listPhong, null))
            {
                XtraMessageBox.Show("Không có phòng!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                String strViTri = _ViTriHienTai.coso != null ? _ViTriHienTai.coso.ten + (_ViTriHienTai.day != null ? " - " + _ViTriHienTai.day.ten + (_ViTriHienTai.tang != null ? " - " + _ViTriHienTai.tang.ten : "") : "") : "";
                if (listPhong.Count > 0)
                {
                    try
                    {
                        DevExpress.XtraSplashScreen.SplashScreenManager splashScreenManager_Report = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::PTB_GUI.WaitForm1), true, true, DevExpress.XtraSplashScreen.ParentType.UserControl);
                        splashScreenManager_Report.ShowWaitForm();
                        splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                        splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                        XtraReport_Template _XtraReport_Template = new XtraReport_Template(SHARED.Libraries.ReportHelper.FillDatasetFromGrid(gridViewPhong), gridViewPhong, barCheckItemLandscape.Checked);
                        _XtraReport_Template.SetTitleText("Danh Sách Phòng Tại: " + strViTri);
                        if (barCheckItemThietKe.Checked)
                        {
                            ReportDesignTool designTool = new ReportDesignTool(_XtraReport_Template);
                            splashScreenManager_Report.CloseWaitForm();
                            designTool.ShowDesignerDialog();

                            ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                            printTool.ShowPreviewDialog();
                        }
                        else
                        {
                            ReportPrintTool printTool = new ReportPrintTool(_XtraReport_Template);
                            splashScreenManager_Report.CloseWaitForm();
                            printTool.ShowPreviewDialog();
                        }
                    }
                    catch
                    {
                        XtraMessageBox.Show("Đã xảy ra lỗi!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    strViTri = "[" + strViTri + "]";
                    XtraMessageBox.Show(strViTri + " không có phòng!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Ejemplo n.º 49
0
        private void barButtonItemXuatThongKe_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (current.Equals(_ucTKPhong))
                {
                    if (Object.Equals(_ucTKPhong.gridControlPhong.DataSource, null))
                    {
                        XtraMessageBox.Show("Chưa có dữ liệu!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    if (((List<Phong_ThongKe>)_ucTKPhong.gridControlPhong.DataSource).Count > 0)
                    {
                        try
                        {
                            DevExpress.XtraSplashScreen.SplashScreenManager splashScreenManager_Report = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::TSCD_GUI.WaitFormLoad), true, true, DevExpress.XtraSplashScreen.ParentType.UserControl);
                            splashScreenManager_Report.ShowWaitForm();
                            splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                            splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                            XtraReportTSCD_Grid _XtraReportTSCD_Grid = new XtraReportTSCD_Grid(_ucTKPhong.gridControlPhong, false);
                            _XtraReportTSCD_Grid.SetTextTitle("Thống Kê Phòng");
                            _XtraReportTSCD_Grid.SetTextTitle_TopRight("");

                            ReportPrintTool printTool = new ReportPrintTool(_XtraReportTSCD_Grid);
                            splashScreenManager_Report.CloseWaitForm();
                            printTool.ShowPreviewDialog();
                        }
                        catch
                        {
                            XtraMessageBox.Show("Đã xảy ra lỗi!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    else
                    {
                        XtraMessageBox.Show("Chưa có dữ liệu!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else if (current.Equals(_ucTKTaiSan))
                {
                    if (Object.Equals(_ucTKTaiSan.gridControlTaiSan.DataSource, null))
                    {
                        XtraMessageBox.Show("Chưa có dữ liệu!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    if (((List<TaiSan_ThongKe>)_ucTKTaiSan.gridControlTaiSan.DataSource).Count > 0)
                    {
                        try
                        {
                            DevExpress.XtraSplashScreen.SplashScreenManager splashScreenManager_Report = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::TSCD_GUI.WaitFormLoad), true, true, DevExpress.XtraSplashScreen.ParentType.UserControl);
                            splashScreenManager_Report.ShowWaitForm();
                            splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                            splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                            XtraReportTSCD_Grid _XtraReportTSCD_Grid = new XtraReportTSCD_Grid(_ucTKTaiSan.gridControlTaiSan, false);
                            _XtraReportTSCD_Grid.SetTextTitle("Thống Kê Tài Sản");
                            _XtraReportTSCD_Grid.SetTextTitle_TopRight("");

                            ReportPrintTool printTool = new ReportPrintTool(_XtraReportTSCD_Grid);
                            splashScreenManager_Report.CloseWaitForm();
                            printTool.ShowPreviewDialog();
                        }
                        catch
                        {
                            XtraMessageBox.Show("Đã xảy ra lỗi!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    else
                    {
                        XtraMessageBox.Show("Chưa có dữ liệu!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else if (current.Equals(_ucTKHaoMon))
                {
                    if (Object.Equals(_ucTKHaoMon.gridControlHaoMon.DataSource, null))
                    {
                        XtraMessageBox.Show("Chưa có dữ liệu!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    if (((List<TaiSanHienThi>)_ucTKHaoMon.gridControlHaoMon.DataSource).Count > 0)
                    {
                        try
                        {
                            DevExpress.XtraSplashScreen.SplashScreenManager splashScreenManager_Report = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::TSCD_GUI.WaitFormLoad), true, true, DevExpress.XtraSplashScreen.ParentType.UserControl);
                            splashScreenManager_Report.ShowWaitForm();
                            splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                            splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                            XtraReportTSCD_Grid _XtraReportTSCD_Grid = new XtraReportTSCD_Grid(_ucTKHaoMon.gridControlHaoMon, false);
                            _XtraReportTSCD_Grid.SetTextTitle("Thống Kê Hao Mòn");
                            _XtraReportTSCD_Grid.SetTextTitle_TopRight("");

                            ReportPrintTool printTool = new ReportPrintTool(_XtraReportTSCD_Grid);
                            splashScreenManager_Report.CloseWaitForm();
                            printTool.ShowPreviewDialog();
                        }
                        catch
                        {
                            XtraMessageBox.Show("Đã xảy ra lỗi!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    else
                    {
                        XtraMessageBox.Show("Chưa có dữ liệu!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else if (current.Equals(_ucTKTHPhong))
                {
                    if (Object.Equals(_ucTKTHPhong.gridControlPhong.DataSource, null))
                    {
                        XtraMessageBox.Show("Chưa có dữ liệu!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    if (((List<Phong_ThongKe>)_ucTKTHPhong.gridControlPhong.DataSource).Count > 0)
                    {
                        try
                        {
                            DevExpress.XtraSplashScreen.SplashScreenManager splashScreenManager_Report = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::TSCD_GUI.WaitFormLoad), true, true, DevExpress.XtraSplashScreen.ParentType.UserControl);
                            splashScreenManager_Report.ShowWaitForm();
                            splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                            splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                            XtraReportTSCD_Grid _XtraReportTSCD_Grid = new XtraReportTSCD_Grid(_ucTKTHPhong.gridControlPhong, false);
                            _XtraReportTSCD_Grid.SetTextTitle("Thống Kê Tổng Hợp Phòng");
                            _XtraReportTSCD_Grid.SetTextTitle_TopRight("");

                            ReportPrintTool printTool = new ReportPrintTool(_XtraReportTSCD_Grid);
                            splashScreenManager_Report.CloseWaitForm();
                            printTool.ShowPreviewDialog();
                        }
                        catch
                        {
                            XtraMessageBox.Show("Đã xảy ra lỗi!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    else
                    {
                        XtraMessageBox.Show("Chưa có dữ liệu!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else if (current.Equals(_ucTKTHTaiSan))
                {
                    if (Object.Equals(_ucTKTHTaiSan.gridControlTaiSan.DataSource, null))
                    {
                        XtraMessageBox.Show("Chưa có dữ liệu!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    if (((List<TaiSanHienThi>)_ucTKTHTaiSan.gridControlTaiSan.DataSource).Count > 0)
                    {
                        try
                        {
                            DevExpress.XtraSplashScreen.SplashScreenManager splashScreenManager_Report = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::TSCD_GUI.WaitFormLoad), true, true, DevExpress.XtraSplashScreen.ParentType.UserControl);
                            splashScreenManager_Report.ShowWaitForm();
                            splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                            splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                            XtraReportTSCD_Grid _XtraReportTSCD_Grid = new XtraReportTSCD_Grid(_ucTKTHTaiSan.gridControlTaiSan, false);
                            _XtraReportTSCD_Grid.SetTextTitle("Thống Kê Tổng Hợp Tài Sản");
                            _XtraReportTSCD_Grid.SetTextTitle_TopRight("");

                            ReportPrintTool printTool = new ReportPrintTool(_XtraReportTSCD_Grid);
                            splashScreenManager_Report.CloseWaitForm();
                            printTool.ShowPreviewDialog();
                        }
                        catch
                        {
                            XtraMessageBox.Show("Đã xảy ra lỗi!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    else
                    {
                        XtraMessageBox.Show("Chưa có dữ liệu!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            catch
            {
                XtraMessageBox.Show("Đã xảy ra lỗi!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }