private void LoadReportControl(Report reportControl) { panelReportControl.Controls.Clear(); Control ctrl = null; switch (reportControl) { //case Report.SalesReport: // ctrl = new SalesPurchaseReportControl(false); // break; //case Report.PurchaseReport: // ctrl = new SalesPurchaseReportControl(true); // break; case Report.DailySalesPurchase: ctrl = new DailySalesPurchaseReport(); break; case Report.ProfitLoss: ctrl = new ProfitLossReportControl(); break; case Report.CustomerTransactionsReport: break; case Report.CompanyTransactionsReport: break; //case Report.ProductReport: // break; case Report.BuyerLedger: break; case Report.CurrentCashReport: CurrentCashReport ccr = new CurrentCashReport(); ccr.ShowDialog(); break; default: break; } if (ctrl != null) { ctrl.Dock = DockStyle.Fill; panelReportControl.Controls.Add(ctrl); } }
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"); } }
private void btnCurrentCash_Click(object sender, EventArgs e) { EBusiness.Reports.CurrentCashReport frm = new Reports.CurrentCashReport(); frm.ShowDialog(); }