private void contactList_SelectedIndexChanged(object sender, EventArgs e) { BusinessLogic.Contact c = this.contactList.SelectedItem as BusinessLogic.Contact; this.shwName.Text = c.Name; this.shwPhnNum.Text = c.PhoneNumber; this.shwAddr.Text = c.Address; }
private void newContactSubmit_Click(object sender, EventArgs e) { BusinessLogic.Contact newContact = new BusinessLogic.Contact(); newContact.Name = this.nameImput.Text; newContact.Address = this.addressInput.Text; newContact.PhoneNumber = this.phoneNumInput.Text; this.book.AddContact(newContact); this.contacts.UpdateContacts(); this.Hide(); }