Esempio n. 1
0
        private void btnEditContact_Click(object sender, EventArgs e)
        {
            if ((dgvContacts.Rows.Count <= 0) || (selectedRow < 0))
            {
                MessageBox.Show("You have to select a contact to edit.", "Error", MessageBoxButtons.OK);
            }
            else
            {
                try
                {
                    NewContactView newContactView = new NewContactView(model, this, 2, SelectedContactID);

                    presenter.EditView(
                        newContactView,
                        selectedRow,
                        firstName,
                        lastName,
                        birthday,
                        phoneNumber,
                        email,
                        street,
                        postalCode,
                        city
                        );

                    newContactView.ShowDialog();
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                }
            }
        }
Esempio n. 2
0
        private void btnAddContact_Click(object sender, EventArgs e)
        {
            NewContactView newContactView = new NewContactView(model, this, 1, 0);

            newContactView.ShowDialog();
        }