public static DialogResult ShowEdit(Contact contact) { var frm = new frmEditContacts(); frm.bindingSource.DataSource = frm.Context.Contacts.Find(contact.Id); frm._isNewContact = false; var dialogResult = frm.ShowDialog(); frm.Dispose(); return(dialogResult); }
public static DialogResult ShowNew() { var frm = new frmEditContacts(); frm.bindingSource.DataSource = new Contact(); frm._isNewContact = true; var dialogResult = frm.ShowDialog(); frm.Dispose(); return(dialogResult); }