/// <summary> /// Search for Customer information via phone /// Fill in TextBox /// </summary> private void SearchBtn_Click(object sender, RoutedEventArgs e) { if (ContractsDetailsPhoneNoTbx.Text == "") { MessageBox.Show("请输入搜索的电话号码!"); } else { try { var customer = facade.GetCustomerViaPhone(ContractsDetailsPhoneNoTbx.Text); ContractsDetailsNameTbx.Text = customer.Name; ContractsDetailsCreditCardNoTbx.Text = customer.IDcard; ContractsDetailsConpanyTbx.Text = customer.Company; ContractsDetailsAddrTbx.Text = customer.Address; } catch (Exception) { MessageBox.Show("找不到旅客信息!请添加新旅客!"); CheckBoxRegister_Checked(sender, e); } } }