コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
            }
        }