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