예제 #1
0
        private void bnAddCustomer_Click(object sender, EventArgs e)
        {
            try
            {
                customerDialog.ClearDisplayItems();

                //BookShopControl.findDuplicateCustomers(customerDialog.UserName);
                switch (customerDialog.Display())
                {
                case DialogReturn.Cancel:
                    return;

                case DialogReturn.Done:
                    BookShopControl.addNewCustomer(customerDialog.FirstName, customerDialog.LastName, customerDialog.UserName,
                                                   customerDialog.Password, customerDialog.EMailAddress, customerDialog.Address, customerDialog.TelephoneNumber);
                    break;

                default:
                    return;
                }
            }
            catch (BookShopException bsex)
            {
                MessageBox.Show(this, bsex.ErrorMessage);
            }
        }