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