private void updateContact() { clsContact contact; //make sure an there is a selected item in the List Box if (lvwContacts.SelectedItems.Count == 0) { showInformationMessage("You must select a user to update."); return; } contact = (clsContact)lvwContacts.SelectedItems[0].Tag; //tags the row to update string name = contact.ContactLastName + ", " + contact.ContactFirstName + " "; UpdateContact updateContact = new UpdateContact("Update: " + name, "Update", contact); updateContact.ShowDialog(); //Rebuild table after adding, updating, or deleting a contact. readUsers(); showUsers(); }
private void addContact() { clsContact contact = new clsContact(); UpdateContact updateContact = new UpdateContact("Add a new User", "Add", contact); updateContact.ShowDialog(); //Rebuild table after adding or updating a user. readUsers(); showUsers(); }