private void mnuCustomerAdd_Click(object sender, EventArgs e)
{
CustomerForm frmCust = new CustomerForm("Add A New Customer");
int index = lstCustomers.SelectedIndex;
if (index != -1)
frmCust.CustomerData = new Customer(customerMngr.GetCustomer(index).ContactData);
MessageBox.Show("dev1");
DialogResult dr = frmCust.ShowDialog();
if (dr == DialogResult.OK)
{
MessageBox.Show("dev2");
if (frmCust.ReadInput())
{
MessageBox.Show("dev3");
customerMngr.AddCustomer(frmCust.CustomerData);
}
else
MessageBox.Show("Please supply all necessary fields with the correct information");
}
UpdateCustomerList();
}
不明白我在这里做错了什么,如果用户在出现的表单中点击 OK,我想执行条件语句frmCust.ShowDialog()
。目前我只能进入“dev1”。