Пример #1
0
        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);
            }
        }
        private void btnContactsSelect_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            Person personItem;

            using (var frm = new frmContacts_Open())
            {
                if (frm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                personItem = frm.ItemData;
            }

            if (ExistingPersonId(personItem.Id))
            {
                MessageDialog.Show(this, "Existing Record",
                                   "An existing Student Record associated with this contact already exists!");

                lblName.Tag = null;
                return;
            }

            ShowPersonInfo(personItem);
        }
Пример #3
0
        private void btnContactsSelect_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            using (var frm = new frmContacts_Open())
            {
                if (frm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                _tempPerson = frm.ItemData;
            }

            if (ExistingPersonId(_tempPerson.Id))
            {
                _tempPerson = null;
                MessageDialog.Show(this, "Existing Record",
                                   "An existing Record associated with this contact already exists!");
                return;
            }


            LoadPhoneNumbers(_tempPerson);
            ShowPersonInfo(_tempPerson);
        }