void ShowDialog(string button) { Form frm = null; bool ShopInfoRequired = false; if (button != "btnShop") { 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); ShopInfoRequired = true; frm = new frmShop(); } } if (!ShopInfoRequired) { switch (button) { case "btnPOS": frm = new frmPOS(); break; case "btnSystemLog": frm = new frmSystemLog(); break; case "btnShop": frm = new frmShop(); break; case "btnUser": frm = new frmUser(); break; case "btnCompany": frm = new frmCompany(); break; case "btnCustomer": frm = new frmCustomer(); break; case "btnItem": frm = new frmItem(); break; case "btnInvoice": frm = new frmInvoice(); break; case "btnOrder": frm = new frmOrder(); break; case "btnStock": frm = new frmStock(); break; default: break; } } if (frm != null) { //this.Visible = false; if (Common.ShowModelDialogs) { frm.ShowDialog(); if (!this.IsDisposed) this.Visible = true; } else { frm.Show(); } } }
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 btnShop_Click(object sender, EventArgs e) { frmShop shop = new frmShop(); shop.ShowDialog(); }