private void buttonQuery_Click(object sender, EventArgs e) { Proxies.EmployeesQueryProxyStub q = new Proxies.EmployeesQueryProxyStub("emp"); q.Select(q.EmployeeID, q.FirstName, q.LastName, q.HireDate, q.BirthDate, (q.LastName + ", " + q.FirstName).As("Fullname")); q.Where(q.LastName.Like("%" + txtLastName.Text + "%")); q.OrderBy(q.LastName.Ascending); coll = svc.Employees_QueryForCollection(Proxies.EmployeesQueryProxyStub.SerializeHelper.ToXml(q)); if (coll == null) { coll = new EmployeesCollectionProxyStub(); } this.dataGrid.DataSource = coll.Collection; }
private void SearchButton_Click(object sender, RoutedEventArgs e) { try { Proxies.EmployeesQueryProxyStub q = new Proxies.EmployeesQueryProxyStub("emp"); q.Select(q.EmployeeID, q.FirstName, q.LastName, q.HireDate, q.BirthDate, (q.LastName + ", " + q.FirstName).As("Fullname")); q.Where ( q.FirstName.Like("%" + SearchTextBox.Text + "%") | q.LastName.Like("%" + SearchTextBox.Text + "%") ); service.Employees_QueryForCollectionAsync(q); WorkingBar.Value = 0; Timer.Begin(); } catch (Exception exc) { Console.WriteLine(exc.StackTrace); } }