コード例 #1
0
 private void Search()
 {
     DoProgress(delegate
     {
         ModelSource.UpdateData();
         Model     = ModelSource.AttendanceResults;
         var items = Model.ToList().Where(a =>
                                          (string.IsNullOrEmpty(FilterEpName) || a.EmployeeName.Contains(FilterEpName)) &&
                                          (string.IsNullOrEmpty(FilterEpNo) || a.EmployeeNo.Contains(FilterEpNo))).ToList();
         if (!items.Any())
         {
             MessageBox.Show("查无结果");
         }
         else
         {
             DispatcherHelper.UIDispatcher.BeginInvoke(new Action(() =>
             {
                 FiltedItems.Clear();
                 foreach (var item in items)
                 {
                     FiltedItems.Add(item);
                 }
             }));
         }
     }, "正在查询...");
 }
コード例 #2
0
 private void Search()
 {
     DoProgress(delegate
     {
         ModelSource.UpdateData();
         Model     = ModelSource.SalaryDetails;
         var items = Model.ToList().Where(a =>
                                          (string.IsNullOrEmpty(FilterEpName) || a.Employee.EmployeeBaseInfo.EmployName.Contains(FilterEpName)) &&
                                          (string.IsNullOrEmpty(FilterEpNo) || a.Employee.EmployeeNO.Contains(FilterEpNo))).ToList();
         if (!items.Any())
         {
             MessageBox.Show("查无结果");
         }
         else
         {
             FiltedItems.Clear();
             foreach (var item in items)
             {
                 FiltedItems.Add(item);
             }
         }
     }, "正在查询...");
 }