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);
            }
        }
Example #2
0
        private void PrintInvoice()
        {
            if (MessageBox.Show(@"Print invoice", @"Print your purchase invoice?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                ;
            }

            {
                // get last order to print

                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    int Inv_No = int.Parse(txtOrder_Id.Text);
                    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(Inv_No));
                    MyReport.Refresh();
                    MyForm.crystalReportViewer1.ReportSource = MyReport;
                    MyForm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Example #3
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            // get last order to print

            try
            {
                if (dgvOrders.Rows.Count == 0)
                {
                    return;
                }
                this.Cursor = Cursors.WaitCursor;
                int Order_No = Convert.ToInt32(dgvOrders.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;
            }
            catch (IOException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #4
0
        private void PrintInvoice()
        {
            DialogResult respnse = MessageBox.Show(@"Print invoice", @"Print your purchase invoice?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            {
                // get last order to print

                try
                {
                    int Inv_No = Convert.ToInt32(txtOrder_Id.Text);
                    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;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
 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);
     }
 }
Example #6
0
        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 Order_No = int.Parse(txtOrder_Id.Text);
                    RPT.rpt_OrderMade   MyReport = new RPT.rpt_OrderMade();
                    RPT.frm_Rpt_Product MyForm   = new RPT.frm_Rpt_Product();
                    MyReport.SetDataSource(cls_MadeOrder.stp_SelectOrderMade_Details(Order_No));
                    MyReport.Refresh();
                    MyForm.crystalReportViewer1.ReportSource = MyReport;
                    MyForm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Example #7
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);
            }
        }
        private void PrintInvoice()
        {
            DialogResult respnse = MessageBox.Show(@"Print Invoice", @"First Term Invoice", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (respnse == DialogResult.Yes)
            {
                // get last order to print
                int Inv_No = Convert.ToInt32(cls_Invoice.stp_SelectInvoice_DetailsForPrint().Rows[0][0]);
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    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(Inv_No));
                    MyReport.Refresh();
                    MyForm.crystalReportViewer1.ReportSource = MyReport;
                    MyForm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
        private void PrintInvoice()
        {
            DialogResult respnse = MessageBox.Show(@"طباعة الفاتورة", @"طباعة فاتورة الشراء", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (respnse == DialogResult.Yes)
            {
                // get last order to print

                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    int Inv_No = int.Parse(dgvOrders.CurrentRow.Cells[0].Value.ToString());
                    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(Inv_No));
                    MyReport.Refresh();
                    MyForm.crystalReportViewer1.ReportSource = MyReport;
                    MyForm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
 private void btnPrint_All_Click(object sender, EventArgs e)
 {
     try
     {
         RPT.rpt_All_Products MyReport = new RPT.rpt_All_Products();
         RPT.frm_Rpt_Product  MyForm   = new RPT.frm_Rpt_Product();
         MyForm.crystalReportViewer1.ReportSource = null;
         MyForm.crystalReportViewer1.ReportSource = MyReport;
         MyForm.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void btnPrint_Single_Click(object sender, EventArgs e)
 {
     try
     {
         RPT.rpt_Single_Product MyReport = new RPT.rpt_Single_Product();
         RPT.frm_Rpt_Product    MyForm   = new RPT.frm_Rpt_Product();
         MyReport.SetParameterValue("@Product_Id", this.dgvMadeProduct.CurrentRow.Cells[0].Value.ToString());
         MyForm.crystalReportViewer1.ReportSource = null;
         MyForm.crystalReportViewer1.ReportSource = MyReport;
         MyForm.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void btnPrint_AllSupplierTrans(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         RPT.frm_Rpt_Product            frm    = new RPT.frm_Rpt_Product();
         RPT.rpt_PrintAll_SupplierTrans Report = new RPT.rpt_PrintAll_SupplierTrans();
         Report.SetDataSource(cls_Credit.stp_Search_SupplierTrans(""));
         frm.crystalReportViewer1.ReportSource = Report;
         frm.ShowDialog();
         this.Cursor = Cursors.Default;
     }
     catch (IOException ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Example #13
0
 private void print_Punch()
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         RPT.rpt_Print_Paid_Paunch MyReport = new RPT.rpt_Print_Paid_Paunch();
         RPT.frm_Rpt_Product       MyForm   = new RPT.frm_Rpt_Product();
         MyReport.SetDataSource(cls_Punches.Print_Paid_Paunch(Convert.ToInt32(txtTransNo.Text), Convert.ToInt32(dgvPunch.CurrentRow.Cells[0].Value)));
         MyReport.Refresh();
         MyForm.crystalReportViewer1.ReportSource = MyReport;
         MyForm.ShowDialog();
         this.Cursor = Cursors.Default;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Example #14
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);
            }
        }
Example #15
0
 private void btnPrintSelected_Click(object sender, EventArgs e)
 {
     if (dgvDebit.Rows.Count == 0)
     {
         MessageBox.Show(@"No data");
         return;
     }
     try
     {
         this.Cursor = Cursors.WaitCursor;
         int id = Convert.ToInt32(dgvDebit.CurrentRow.Cells[0].Value);
         RPT.frm_Rpt_Product             frm    = new RPT.frm_Rpt_Product();
         RPT.rpt_Print_CustomerTransById Report = new RPT.rpt_Print_CustomerTransById();
         Report.SetDataSource(cls_Debit.Print_CustomerTrans_ByCustId(id));
         frm.crystalReportViewer1.ReportSource = Report;
         frm.ShowDialog();
         this.Cursor = Cursors.Default;
     }
     catch (IOException ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        private void PrintInvoice()
        {
            // get last order to print
            if (MessageBox.Show("Do you really want to cancel your billing data?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)

            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    int Order_No = int.Parse(txtOrder_Id.Text);
                    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;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
        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);
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (rdbAll.Checked && RepKind == "Purchase")
            {
                // get last order to print

                try
                {
                    if (dgvReport.Rows.Count == 0)
                    {
                        return;
                    }
                    this.Cursor = Cursors.WaitCursor;
                    int Order_No = Convert.ToInt32(dgvReport.CurrentRow.Cells[0].Value);
                    RPT.rpt_PrintAll_Invoices MyReport = new RPT.rpt_PrintAll_Invoices();
                    RPT.frm_Rpt_Product       MyForm   = new RPT.frm_Rpt_Product();
                    MyReport.SetDataSource(cls_Invoice.stp_Search_Invoices(""));
                    //MyReport.Refresh();
                    MyForm.crystalReportViewer1.ReportSource = MyReport;
                    MyForm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (rdbAll.Checked && RepKind == "Sales")
            {
                if (dgvReport.Rows.Count == 0)
                {
                    return;
                }
                this.Cursor = Cursors.WaitCursor;
                int Order_No = Convert.ToInt32(dgvReport.CurrentRow.Cells[0].Value);
                RPT.rpt_PrintAll_Orders MyReport = new RPT.rpt_PrintAll_Orders();
                RPT.frm_Rpt_Product     MyForm   = new RPT.frm_Rpt_Product();
                MyReport.SetDataSource(cls_Order.stp_Search_Orders(""));
                //MyReport.Refresh();
                MyForm.crystalReportViewer1.ReportSource = MyReport;
                MyForm.ShowDialog();
                this.Cursor = Cursors.Default;
            }
            else if (rdbAll.Checked && RepKind == "RPurchase")
            {
                if (dgvReport.Rows.Count == 0)
                {
                    return;
                }
                this.Cursor = Cursors.WaitCursor;
                RPT.rpt_PrintAll_RPurchase MyReport = new RPT.rpt_PrintAll_RPurchase();
                RPT.frm_Rpt_Product        MyForm   = new RPT.frm_Rpt_Product();
                MyReport.SetDataSource(cls_RInvoice.stp_Search_RInvoices(""));
                //MyReport.Refresh();
                MyForm.crystalReportViewer1.ReportSource = MyReport;
                MyForm.ShowDialog();
                this.Cursor = Cursors.Default;
            }
            else if (rdbAll.Checked && RepKind == "RSales")
            {
                if (dgvReport.Rows.Count == 0)
                {
                    return;
                }
                this.Cursor = Cursors.WaitCursor;
                RPT.rpt_PrintAll_RSales MyReport = new RPT.rpt_PrintAll_RSales();
                RPT.frm_Rpt_Product     MyForm   = new RPT.frm_Rpt_Product();
                MyReport.SetDataSource(cls_ROrder.stp_Search_ROrders(""));
                //MyReport.Refresh();
                MyForm.crystalReportViewer1.ReportSource = MyReport;
                MyForm.ShowDialog();
                this.Cursor = Cursors.Default;
            }
            else if (rdbAll.Checked && RepKind == "Credit")
            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    RPT.frm_Rpt_Product            frm    = new RPT.frm_Rpt_Product();
                    RPT.rpt_PrintAll_SupplierTrans Report = new RPT.rpt_PrintAll_SupplierTrans();
                    Report.SetDataSource(cls_Credit.stp_Search_SupplierTrans(""));
                    frm.crystalReportViewer1.ReportSource = Report;
                    frm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (rdbAll.Checked && RepKind == "Debit")
            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    RPT.frm_Rpt_Product            frm    = new RPT.frm_Rpt_Product();
                    RPT.rpt_PrintAll_CustomerTrans Report = new RPT.rpt_PrintAll_CustomerTrans();
                    Report.SetDataSource(cls_Debit.stp_Search_CustomerTrans(""));
                    frm.crystalReportViewer1.ReportSource = Report;
                    frm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }

            // By Date

            if (rdbDate.Checked && RepKind == "Purchase")
            {
                try
                {
                    if (dgvReport.Rows.Count == 0)
                    {
                        return;
                    }
                    this.Cursor = Cursors.WaitCursor;
                    RPT.rpt_Print_PurchaseByDate MyReport = new RPT.rpt_Print_PurchaseByDate();
                    RPT.frm_Rpt_Product          MyForm   = new RPT.frm_Rpt_Product();
                    MyReport.SetDataSource(cls_Invoice.Print_Invoices_ByDate(dtpStart.Value, dtpEnd.Value));
                    //MyReport.Refresh();
                    MyForm.crystalReportViewer1.ReportSource = MyReport;
                    MyForm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (rdbDate.Checked && RepKind == "Sales")
            {
                if (dgvReport.Rows.Count == 0)
                {
                    return;
                }
                this.Cursor = Cursors.WaitCursor;
                RPT.rpt_PrintSalesByDate MyReport = new RPT.rpt_PrintSalesByDate();
                RPT.frm_Rpt_Product      MyForm   = new RPT.frm_Rpt_Product();
                MyReport.SetDataSource(cls_Order.Print_Orders_ByDate(dtpStart.Value, dtpEnd.Value));
                //MyReport.Refresh();
                MyForm.crystalReportViewer1.ReportSource = MyReport;
                MyForm.ShowDialog();
                this.Cursor = Cursors.Default;
            }
            else if (rdbDate.Checked && RepKind == "RPurchase")
            {
                try
                {
                    if (dgvReport.Rows.Count == 0)
                    {
                        return;
                    }
                    this.Cursor = Cursors.WaitCursor;
                    RPT.rpt_Print_RPuchaseByDate MyReport = new RPT.rpt_Print_RPuchaseByDate();
                    RPT.frm_Rpt_Product          MyForm   = new RPT.frm_Rpt_Product();
                    MyReport.SetDataSource(cls_RInvoice.Print_RInvoices_ByDate(dtpStart.Value, dtpEnd.Value));
                    //MyReport.Refresh();
                    MyForm.crystalReportViewer1.ReportSource = MyReport;
                    MyForm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (rdbDate.Checked && RepKind == "RSales")
            {
                if (dgvReport.Rows.Count == 0)
                {
                    return;
                }
                this.Cursor = Cursors.WaitCursor;

                RPT.rpt_Print_ROrderById MyReport = new RPT.rpt_Print_ROrderById();
                RPT.frm_Rpt_Product      MyForm   = new RPT.frm_Rpt_Product();
                MyReport.SetDataSource(cls_ROrder.Print_ROrders_ByDate(dtpStart.Value, dtpEnd.Value));
                //MyReport.Refresh();
                MyForm.crystalReportViewer1.ReportSource = MyReport;
                MyForm.ShowDialog();
                this.Cursor = Cursors.Default;
            }
            else if (rdbDate.Checked && RepKind == "Credit")
            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    RPT.frm_Rpt_Product frm = new RPT.frm_Rpt_Product();
                    RPT.rpt_Print_SupplierTransByDate Report = new RPT.rpt_Print_SupplierTransByDate();
                    Report.SetDataSource(cls_Credit.Print_SupplierTrans_ByDate(dtpStart.Value, dtpEnd.Value));
                    frm.crystalReportViewer1.ReportSource = Report;
                    frm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (rdbDate.Checked && RepKind == "Debit")
            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    RPT.frm_Rpt_Product            frm    = new RPT.frm_Rpt_Product();
                    RPT.rpt_PrintAll_CustomerTrans Report = new RPT.rpt_PrintAll_CustomerTrans();
                    Report.SetDataSource(cls_Debit.Print_CustomerTrans_ByDate(dtpStart.Value, dtpEnd.Value));
                    frm.crystalReportViewer1.ReportSource = Report;
                    frm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }

            // By Suppllier-Customer
            if (rdbId.Checked && RepKind == "Purchase")
            {
                try
                {
                    if (dgvReport.Rows.Count == 0)
                    {
                        return;
                    }
                    this.Cursor = Cursors.WaitCursor;
                    RPT.rpt_Print_InvoiceById MyReport = new RPT.rpt_Print_InvoiceById();
                    RPT.frm_Rpt_Product       MyForm   = new RPT.frm_Rpt_Product();
                    MyReport.SetDataSource(cls_Invoice.Print_Invoices_BySupId(Convert.ToInt32(txtId.Text)));
                    //MyReport.Refresh();
                    MyForm.crystalReportViewer1.ReportSource = MyReport;
                    MyForm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (rdbId.Checked && RepKind == "Sales")
            {
                if (dgvReport.Rows.Count == 0)
                {
                    return;
                }
                this.Cursor = Cursors.WaitCursor;
                RPT.rpt_Print_OrderById MyReport = new RPT.rpt_Print_OrderById();
                RPT.frm_Rpt_Product     MyForm   = new RPT.frm_Rpt_Product();
                MyReport.SetDataSource(cls_Order.Print_Orders_ByCust_Id(Convert.ToInt32(txtId.Text)));
                //MyReport.Refresh();
                MyForm.crystalReportViewer1.ReportSource = MyReport;
                MyForm.ShowDialog();
                this.Cursor = Cursors.Default;
            }
            else if (rdbId.Checked && RepKind == "RPurchase")
            {
                try
                {
                    if (dgvReport.Rows.Count == 0)
                    {
                        return;
                    }
                    this.Cursor = Cursors.WaitCursor;
                    RPT.rpt_Print_RInvoiceById MyReport = new RPT.rpt_Print_RInvoiceById();
                    RPT.frm_Rpt_Product        MyForm   = new RPT.frm_Rpt_Product();
                    MyReport.SetDataSource(cls_RInvoice.Print_RInvoices_BySupId(Convert.ToInt32(txtId.Text)));
                    //MyReport.Refresh();
                    MyForm.crystalReportViewer1.ReportSource = MyReport;
                    MyForm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (rdbId.Checked && RepKind == "RSales")
            {
                if (dgvReport.Rows.Count == 0)
                {
                    return;
                }
                this.Cursor = Cursors.WaitCursor;
                RPT.rpt_Print_ROrderById MyReport = new RPT.rpt_Print_ROrderById();
                RPT.frm_Rpt_Product      MyForm   = new RPT.frm_Rpt_Product();
                MyReport.SetDataSource(cls_ROrder.Print_ROrders_ByCust_Id(Convert.ToInt32(txtId.Text)));
                MyForm.crystalReportViewer1.ReportSource = MyReport;
                MyForm.ShowDialog();
                this.Cursor = Cursors.Default;
            }
            else if (rdbId.Checked && RepKind == "Credit")
            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    RPT.frm_Rpt_Product             frm    = new RPT.frm_Rpt_Product();
                    RPT.rpt_Print_SupplierTransById Report = new RPT.rpt_Print_SupplierTransById();
                    Report.SetDataSource(cls_Credit.Print_SupplierTrans_BySupId(Convert.ToInt32(txtId.Text)));
                    frm.crystalReportViewer1.ReportSource = Report;
                    frm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else if (rdbId.Checked && RepKind == "Debit")
            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    RPT.frm_Rpt_Product             frm    = new RPT.frm_Rpt_Product();
                    RPT.rpt_Print_CustomerTransById Report = new RPT.rpt_Print_CustomerTransById();
                    Report.SetDataSource(cls_Debit.Print_CustomerTrans_ByCustId(Convert.ToInt32(txtId.Text)));
                    frm.crystalReportViewer1.ReportSource = Report;
                    frm.ShowDialog();
                    this.Cursor = Cursors.Default;
                }
                catch (IOException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }