private void PrintInvoice()
 {
     try
     {
         // get last order to print
         DialogResult respnse = MessageBox.Show(@"Print Invoice", @"Print Sales Invoice", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (respnse == DialogResult.Yes)
         {
             this.Cursor = Cursors.WaitCursor;
             int Order_No = int.Parse(txtOrder_Id.Text);
             RPT.rpt_PrintROrder MyReport = new RPT.rpt_PrintROrder();
             RPT.frm_Rpt_Product MyForm   = new RPT.frm_Rpt_Product();
             MyReport.SetDataSource(cls_ROrder.stp_SelectROrder_Details(Order_No));
             MyReport.Refresh();
             MyForm.crystalReportViewer1.ReportSource = MyReport;
             MyForm.ShowDialog();
             this.Cursor = Cursors.Default;
         }
         else
         {
             return;
         }
     }
     catch (IOException ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 2
0
        private void PrintRInvoice()
        {
            // get last order to print
            DialogResult respnse = MessageBox.Show(@"طباعة فاتورة مردودات مبيعات؟", @"طباعة فاتورة", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (respnse == DialogResult.Yes)
            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    int Order_No = int.Parse(dgvOrders.CurrentRow.Cells[0].Value.ToString());
                    RPT.rpt_PrintROrder MyReport = new RPT.rpt_PrintROrder();
                    RPT.frm_Rpt_Product MyForm   = new RPT.frm_Rpt_Product();
                    MyReport.SetDataSource(cls_ROrder.stp_SelectROrder_Details(Order_No));
                    MyReport.Refresh();
                    MyForm.crystalReportViewer1.ReportSource = MyReport;
                    MyForm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }