private void btnCampingInfo_Click(object sender, EventArgs e) { try { if (campingOverview.IsDisposed == true) { campingOverview = new Camping_overview(); } campingOverview.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(); }