Esempio n. 1
0
        private void PrintInvoice()
        {
            try
            {
                // get last order to print
                if (MessageBox.Show(@"طباعة الفاتورة؟", @"طباعة فاتورة مبيعات", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)

                {
                    this.Cursor = Cursors.WaitCursor;
                    int                 orderNo  = int.Parse(txtOrder_Id.Text);
                    RPT.rpt_Orders      myReport = new RPT.rpt_Orders();
                    RPT.frm_Rpt_Product myForm   = new RPT.frm_Rpt_Product();
                    myReport.SetDataSource(cls_Order.stp_SelectOrder_Details(orderNo));
                    myReport.Refresh();
                    myForm.crystalReportViewer1.ReportSource = myReport;
                    myForm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                else
                {
                    return;
                }
            }
            catch (IOException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPrintOrder_Click(object sender, EventArgs e)
        {
            // get last order to print
            if (MessageBox.Show(@"Print invoice", @"Print your purchase invoice?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                ;
            }

            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    int                 orderNo  = int.Parse(txtOrder_Id.Text);
                    RPT.rpt_Orders      myReport = new RPT.rpt_Orders();
                    RPT.frm_Rpt_Product myForm   = new RPT.frm_Rpt_Product();
                    myReport.SetDataSource(cls_Order.stp_SelectOrder_Details(orderNo));
                    myReport.Refresh();
                    myForm.crystalReportViewer1.ReportSource = myReport;
                    myForm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Esempio n. 3
0
        private void PrintInvoice()
        {
            // 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_Orders      MyReport = new RPT.rpt_Orders();
                    RPT.frm_Rpt_Product MyForm   = new RPT.frm_Rpt_Product();
                    MyReport.SetDataSource(cls_Order.stp_SelectOrder_Details(Order_No));
                    MyReport.Refresh();
                    MyForm.crystalReportViewer1.ReportSource = MyReport;
                    MyForm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
        private void btnPrintOrder_Click(object sender, EventArgs e)
        {
            //this to make cursor waiting
            this.Cursor = Cursors.WaitCursor;
            //get last order
            int order_id = Convert.ToInt32(order.GET_Last_Orders_ID_FOR_PRINT().Rows[0][0]);

            // form for crestal report
            RPT.rpt_Orders      report = new RPT.rpt_Orders();
            RPT.FRM_PRT_PRODUCT frm    = new RPT.FRM_PRT_PRODUCT();
            report.SetDataSource(order.GetOrderDetails(order_id));
            frm.crystalReportViewer1.ReportSource = report;
            frm.ShowDialog();

            //this to make cursor Default
            this.Cursor = Cursors.Default;
        }
Esempio n. 5
0
        private void btnPrintOrder_Click(object sender, EventArgs e)
        {
            // get last order to print

            try
            {
                this.Cursor = Cursors.WaitCursor;
                int                 orderNo  = int.Parse(txtOrder_Id.Text);
                RPT.rpt_Orders      myReport = new RPT.rpt_Orders();
                RPT.frm_Rpt_Product myForm   = new RPT.frm_Rpt_Product();
                myReport.SetDataSource(cls_Order.stp_SelectOrder_Details(orderNo));
                myReport.Refresh();
                myForm.crystalReportViewer1.ReportSource = myReport;
                myForm.ShowDialog();
                this.Cursor = Cursors.Default;
            }
            catch (IOException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 6
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            try
            {
                //this to make cursor waiting
                this.Cursor = Cursors.WaitCursor;
                //get last order
                int order_id = Convert.ToInt32(DGV_ORDERSlist.CurrentRow.Cells[0].Value);
                // form for crestal report
                RPT.rpt_Orders      report = new RPT.rpt_Orders();
                RPT.FRM_PRT_PRODUCT frm    = new RPT.FRM_PRT_PRODUCT();
                report.SetDataSource(order.GetOrderDetails(order_id));
                frm.crystalReportViewer1.ReportSource = report;
                frm.ShowDialog();

                //this to make cursor Default
                this.Cursor = Cursors.Default;
            }
            catch
            {
                return;
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            try
            {
                if (dgvListManagement.Rows.Count == 0)
                {
                    return;
                }
                if (List == "Orders" && cboType.SelectedIndex == 0)
                {
                    // get last order to print
                    DialogResult respnse = MessageBox.Show(@"Print Saled Invoice?", @"Print Invoice", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (respnse == DialogResult.Yes)
                    {
                        this.Cursor = Cursors.WaitCursor;
                        int                 Order_No = int.Parse(dgvListManagement.CurrentRow.Cells[0].Value.ToString());
                        RPT.rpt_Orders      MyReport = new RPT.rpt_Orders();
                        RPT.frm_Rpt_Product MyForm   = new RPT.frm_Rpt_Product();
                        MyReport.SetDataSource(cls_Order.stp_SelectOrder_Details(Order_No));
                        MyReport.Refresh();
                        MyForm.crystalReportViewer1.ReportSource = MyReport;
                        MyForm.ShowDialog();
                        this.Cursor = Cursors.Default;
                    }
                }

                // get last order to print
                else if (List == "Invoices" && cboType.SelectedIndex == 0)
                {
                    DialogResult respnse = MessageBox.Show(@"Print Purchase Invoice?", @"Print Invoice", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (respnse == DialogResult.Yes)
                    {
                        this.Cursor = Cursors.WaitCursor;
                        int Order_No = Convert.ToInt32(dgvListManagement.CurrentRow.Cells[0].Value);
                        RPT.rpt_Invoices    MyReport = new RPT.rpt_Invoices();
                        RPT.frm_Rpt_Product MyForm   = new RPT.frm_Rpt_Product();
                        MyReport.SetDataSource(cls_Invoice.Stp_SelectInvoice_Details(Order_No));
                        //MyReport.Refresh();
                        MyForm.crystalReportViewer1.ReportSource = MyReport;
                        MyForm.ShowDialog();
                        this.Cursor = Cursors.Default;
                    }
                }
                else if (List == "Orders" && cboType.SelectedIndex == 1)
                {
                    DialogResult respnse = MessageBox.Show(@"Print Return Sales Invoice", @"Print Invoice", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (respnse == DialogResult.Yes)
                    {
                        this.Cursor = Cursors.WaitCursor;
                        int Order_No = Convert.ToInt32(dgvListManagement.CurrentRow.Cells[0].Value);
                        RPT.rpt_Print_ROrder MyReport = new RPT.rpt_Print_ROrder();
                        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 if (List == "Invoices" && cboType.SelectedIndex == 1)
                {
                    DialogResult respnse = MessageBox.Show(@"Print Return Purchase Invoice", @"Print Invoice", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (respnse == DialogResult.Yes)
                    {
                        int Inv_No = Convert.ToInt32(cls_Invoice.stp_SelectInvoice_DetailsForPrint().Rows[0][0]);
                        this.Cursor = Cursors.WaitCursor;
                        RPT.rpt_Print_RInvoice MyReport = new RPT.rpt_Print_RInvoice();
                        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;
                    }
                }

                else if (List == "MadeOrders")
                {
                    dgvListManagement.DataSource = cls_MadeOrder.stp_Search_MadeOrders("");
                    lblList.Text = "Made Orders Invoices List Screen";
                }

                else if (List == "Services")
                {
                    dgvListManagement.DataSource = cls_Service.stp_SelectAll_Service();
                    lblList.Text = "Service Invoices List Screen";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }