private void btnContactsOpen_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            try
            {
                // Find Employee Id
                var item = new Person();
                using (var frm = new frmContacts_Open())
                {
                    if (frm.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    item = frm.ItemData;
                }


                using (var frm = new frmContacts_Add())
                {
                    frm.ItemData = item;
                    frm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                MessageDialog.ShowError(ex, this);
            }
        }
Exemple #2
0
        private void btnContactsNew_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            _tempPerson = new Person();
            using (var frm = new frmContacts_Add())
            {
                frm.ItemData = _tempPerson;
                frm.Owner    = this;

                if (frm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            ShowPersonInfo(_tempPerson);
        }
        private void btnContactsCreate_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            try
            {
                var newItem = new Person();

                using (var frm = new frmContacts_Add())
                {
                    frm.ItemData = newItem;
                    frm.Owner    = this;

                    if (frm.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageDialog.ShowError(ex, this);
            }
        }