private void btnAdd_Click(object sender, EventArgs e) { using (frmAddEditContact frm = new frmAddEditContact(null)) { if (frm.ShowDialog() == DialogResult.OK) { contactBindingSource.DataSource = ContactServices.GetAll(); } } }
private void btnEdit_Click(object sender, EventArgs e) { if (contactBindingSource.Current == null) { return; } using (frmAddEditContact frm = new frmAddEditContact(contactBindingSource.Current as Contact)) { if (frm.ShowDialog() == DialogResult.OK) { contactBindingSource.DataSource = ContactServices.GetAll(); } } }