Пример #1
0
        private void confirmButton_Click(object sender, EventArgs e)
        {
            customer.firstName     = firstNameTextBox.Text.ToString();
            customer.lastName      = lastNameTextBox.Text.ToString();
            customer.streetAddress = addressTextBox.Text.ToString();
            customer.state         = stateTextBox.Text.ToString();
            customer.zipcode       = zipcodeTextBox.Text.ToString();
            customer.phoneNumber   = phoneNumTextBox.Text.ToString();

            if (customer.firstName != null &&
                customer.lastName != null &&
                customer.streetAddress != null &&
                customer.state != null &&
                customer.zipcode != null &&
                customer.phoneNumber != null)
            {
                try
                {
                    //not using the int values, just making sure the user entered numbers
                    decimal zip   = decimal.Parse(customer.zipcode);
                    decimal phone = decimal.Parse(customer.phoneNumber);

                    CustomerDAO.EditCustomer(customer);
                    customersForm.ReloadCustomers();
                    this.Close();
                }
                catch
                {
                    MessageBox.Show("Invalid Input", "Invalid Input", MessageBoxButtons.OK);
                }
            }
        }