public void addMember(User user) { if (usersInGroup.ContainsKey(user.name) == false) { usersInGroup.Add(user.name, user.group); numMembers++; } }
private void okButton_Click(object sender, EventArgs e) { if (nameTextBox.Text.ToString().Equals("") || textBox1.Text.ToString().Equals("")) { MessageBox.Show("There must be something entered into the first name and last name fields."); return; } String firstName = nameTextBox.Text.ToString(); String lastName = textBox1.Text.ToString(); String displayName = textBox2.Text.ToString(); theUser = new User(firstName, lastName, displayName, groupComboBox.Text.ToString()); dash.addUser(theUser); nameTextBox.Text = ""; groupComboBox.Text = "None"; Close(); }