private void btnProductsInfo_Click(object sender, EventArgs e) { try { if (productsOverview.IsDisposed == true) { productsOverview = new ProductsOverview(); } productsOverview.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public Form1() { InitializeComponent(); msh = new MySqlhelper(); visitorsOverview = new VisitorsOverview(); campingOverview = new Camping_overview(); productsOverview = new ProductsOverview(); financeOverview = new FinanceOverview(); lbCurrVisitors.Text = msh.GetVisitorsInTheEvent().ToString(); lbProfit.Text = msh.GetTotalMoneySpent().ToString(); lbProductsSold.Text = msh.GetTotalProductsSoldAndRent().ToString(); lbCampTaken.Text = msh.GetBookedCampings().ToString(); lbCheckedin.Text = msh.GetVisitorCheckedInEvent().ToString(); lbCheckedOut.Text = msh.GetVisitorCheckedOutEvent().ToString(); timer1.Start(); }