/** * This method defines what happens when the form is closed */ private void AddTeam_FormClosing(object sender, FormClosingEventArgs e) { DialogResult result = MessageBox.Show("Do you really want to team management?\n", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (result == DialogResult.Yes) { ManageTeams team = new ManageTeams(); team.Show(); } else e.Cancel = true; }
/** * This method defines what happens when the team management button is clicked */ private void btnTeamManagement_Click(object sender, EventArgs e) { if (GlobalVariables.allSalesmenList.Count == 0) { MessageBox.Show(this, "There are no salesmen in the database.\nPlease add salesmen or open a file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }//check if file's been opened else { var manage = new ManageTeams(); manage.Show(this); this.Hide(); } }