Esempio n. 1
0
        // Precondition:  The Insert >> Address menu item has been selected
        // Postcondition:  A dialog box prompts the user for new Address information.
        //                 If the user submits, a new Address object is created.
        private void addressToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddAddressForm addAddress = new AddAddressForm();    //  Calls Add Address Form
            DialogResult   result     = addAddress.ShowDialog(); //  Result from dialog - OK/Cancel?

            if (result == DialogResult.OK)                       //  Address is created if user selects OK from dialog box
            {
                upv.AddAddress(addAddress.NameInput, addAddress.Address1Input, addAddress.Address2Input,
                               addAddress.CityInput, addAddress.StateInput, addAddress.ZipInput);
            }
        }
Esempio n. 2
0
        // Pre-Condition: None
        // Post-Condition: A new AddAddressForm will be created and shown.
        private void AddressToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddAddressForm addAddressForm = new AddAddressForm(this);

            addAddressForm.Show();
        }