private void BtnApprove_Click(object sender, RoutedEventArgs e) { ServiceReference2.Service1Client client = new ServiceReference2.Service1Client(); var items = queryExamine.GetCheckedResultCollection <StudentPending>().ToArray(); if (items.Count() <= 0) { return; } ObservableCollection <ServiceReference2.StudentPending> studentPs = new ObservableCollection <ServiceReference2.StudentPending>(); foreach (var item in items) { ServiceReference2.StudentPending studentP = new ServiceReference2.StudentPending(); Utility.CopyObjectProperties <StudentPending, ServiceReference2.StudentPending>(item, studentP, new string[] { "IsCheck" }); studentP.CHECK_OPERATOR_ID = Shar.user; studentP.CHECK_OPERATOR_TIME = DateTime.Now; studentP.AUDIT_STATE = (int?)NCS.Business.DataFlow.EnumAuditState.Approve; studentPs.Add(studentP); } if (MessageBoxResult.OK == MessageBox.Show("是否要审核选择的数据", "提示信息", MessageBoxButton.OKCancel)) { client.AduitCompleted += (se, de) => { if (de.Result) { MessageBox.Show("审核完毕!"); var stitems = queryExamine.ResultCollection as ObservableCollection <StudentPending>; var selecteds = queryExamine.GetCheckedResultCollection <StudentPending>().ToArray(); foreach (var selected in selecteds) { stitems.Remove(selected); } } else { MessageBox.Show("未审核完毕"); } }; client.AduitAsync(studentPs); } }