コード例 #1
0
        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);
        }
コード例 #2
0
        public static DialogResult ShowNew()
        {
            var frm = new frmEditContacts();

            frm.bindingSource.DataSource = new Contact();
            frm._isNewContact            = true;

            var dialogResult = frm.ShowDialog();

            frm.Dispose();

            return(dialogResult);
        }