Beispiel #1
0
        private void btnReport_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable dtShop = shop.SelectAllShop();
                if (dtShop.Rows.Count != 1)
                {
                    MessageBox.Show("Error ! Please provide the shop information to continue", "Shop Information Required", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    frmShop frm = new frmShop();
                    frm.ShowDialog();
                }
                else
                {

                    ReportsForm rptForm = new ReportsForm();
                    ReportControl frm = null;
                    Form ccr = null;
                    string button = ((ToolStripButton)sender).Name;
                    switch (button)
                    {
                        //REPORTS SECTION
                        case "btnCurrentCashReport":
                            ccr = new CurrentCashReport();
                            break;
                        case "btnBuyerLedger":
                            frm = new SalesPurchaseReportControl(false, Report.Invoice);
                            break;
                        case "btnProductWiseReport":
                            frm = new SalesPurchaseReportControl(false, Report.Invoice);
                            break;
                        case "btnPurchaseReport":
                            frm = new SalesPurchaseReportControl(true, Report.Invoice);
                            break;
                        case "btnSalesReport":
                            frm = new SalesPurchaseReportControl(false, Report.Invoice);
                            break;
                        case "btnCustomerTransaction":
                            frm = new TransactionReportControl(true);
                            break;
                        case "btnCompanyTransaction":
                            frm = new TransactionReportControl(false);
                            break;
                        case "btnProfitReport":
                            frm = new ProfitLossReportControl();
                            break;
                        case "btnDailySalesReport":
                            frm = new DailySalesPurchaseReport();
                            break;
                        case "btnBuyerLedgerReport":
                            frm = new SalesPurchaseReportControl(false, Report.Invoice);
                            break;
                        case "btnItemTransaction":
                            frm = new ProductTransactionReportControl();
                            break;

                        default:
                            break;
                    }
                    if (ccr != null)
                    {
                        ccr.ShowDialog();
                    }
                    else if (frm != null)
                    {
                        frm.Dock = DockStyle.Fill;
                        rptForm.panelReportControl.Controls.Add(frm);
                        this.Visible = false;
                        rptForm.ShowDialog();
                        if (!this.IsDisposed)
                            this.Visible = true;
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionLog.LogException(Modules.WelcomeForm, "btnReport", ex, "Welcome Form Exception");

            }
        }
Beispiel #2
0
 private void btnShop_Click(object sender, EventArgs e)
 {
     frmShop shop = new frmShop();
     shop.ShowDialog();
 }