private void PrintInvoice() { try { if (MessageBox.Show(@"طباعة الفاتورة؟", @"طباعة فاتورة مبيعات", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { this.Cursor = Cursors.WaitCursor; int Inv_No = int.Parse(txtOrder_Id.Text); RPT.rpt_PrintRInvoice MyReport = new RPT.rpt_PrintRInvoice(); RPT.frm_Rpt_Product MyForm = new RPT.frm_Rpt_Product(); MyReport.SetDataSource(cls_RInvoice.stp_SelectRInvoice_Details(Inv_No)); MyReport.Refresh(); MyForm.crystalReportViewer1.ReportSource = MyReport; MyForm.ShowDialog(); //cls_Controls.PrintInvoice(Inv_No,MyForm, MyReport, "cls_RInvoice.stp_SelectRInvoice_Details" ); this.Cursor = Cursors.Default; } else { return; } } catch (IOException ex) { MessageBox.Show(ex.Message); } }
private void PrintRInvoice() { DialogResult respnse = MessageBox.Show(@"طباعة الفاتورة", @"طباعة فاتورة مردودات الشراء", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (respnse == DialogResult.Yes) { try { this.Cursor = Cursors.WaitCursor; int Inv_No = int.Parse(dgvOrders.CurrentRow.Cells[0].Value.ToString()); RPT.rpt_PrintRInvoice MyReport = new RPT.rpt_PrintRInvoice(); RPT.frm_Rpt_Product MyForm = new RPT.frm_Rpt_Product(); MyReport.SetDataSource(cls_RInvoice.stp_SelectRInvoice_Details(Inv_No)); MyReport.Refresh(); MyForm.crystalReportViewer1.ReportSource = MyReport; MyForm.ShowDialog(); this.Cursor = Cursors.Default; } catch (IOException ex) { MessageBox.Show(ex.Message); } } }