int id; bool ok = int.TryParse(TextBoxSearch.Text, out id); if (ok) { } var service = new ServiceReference.Service1Client("http://localhost:54187/Service1.svc"); try { var product = service.GetProduct(id); UpdateTextBoxes(product); } catch (Exception) { throw new FaultException(); } } private void UpdateTextBoxes(Product product) { TextBoxName.Text = product.ProductName; TextBoxProductNumber.Text = product.ProductNumber; TextBoxListPrice.Text = product.ListPrice.ToString(CultureInfo.InvariantCulture); TextBoxColor.Text = product.Color; TextBoxSearch.Text = product.ProductID.ToString(CultureInfo.InvariantCulture); }
if (ok) { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)