Beispiel #1
0
 protected void ButtonFind_Click(object sender, EventArgs e)
 {
     try
     {
         var host = new EmployeeServiceClient();
         TextBoxShowEmployeeID.Text = host.GetEmployeeByID(int.Parse(TextBoxFindEmployee.Text)).EmployeeID.ToString();
         TextBoxShowFirstname.Text = host.GetEmployeeByID(int.Parse(TextBoxFindEmployee.Text)).FirstName;
         TextBoxShowLastname.Text = host.GetEmployeeByID(int.Parse(TextBoxFindEmployee.Text)).LastName;
         TextBoxShowTitle.Text = host.GetEmployeeByID(int.Parse(TextBoxFindEmployee.Text)).Title;
         TextBoxShowAddress.Text = host.GetEmployeeByID(int.Parse(TextBoxFindEmployee.Text)).Address;
         TextBoxShowCity.Text = host.GetEmployeeByID(int.Parse(TextBoxFindEmployee.Text)).City;
     }
     catch (FaultException error)
     {
         MessageBox.Show($"Something went wrong here, please read the message for more details: {error.Message}");
     }
     catch (Exception error)
     {
         MessageBox.Show($"Something went wrong here, please read the message for more details: {error.Message}");
     }
 }