コード例 #1
0
 void Search()
 {
     MyEmployees.Clear();
     foreach (var employee in employees
              .Where(e => e.FirstName.ToLower().Contains(Filter.ToLower()) ||
                     e.LastName.ToLower().Contains(Filter.ToLower()))
              .OrderBy(e => e.FirstName)
              .ThenBy(e => e.LastName))
     {
         if (employee.EmployeeId != me.EmployeeId)
         {
             MyEmployees.Add(new EmployeeItemViewModel
             {
                 Address        = employee.Address,
                 Document       = employee.Document,
                 DocumentTypeId = employee.DocumentTypeId,
                 Email          = employee.Email,
                 EmployeeCode   = employee.EmployeeCode,
                 EmployeeId     = employee.EmployeeId,
                 FirstName      = employee.FirstName,
                 LastName       = employee.LastName,
                 LoginTypeId    = employee.LoginTypeId,
                 Phone          = employee.Phone,
                 Picture        = employee.Picture,
             });
         }
     }
 }
コード例 #2
0
 void ReloadEmployees()
 {
     MyEmployees.Clear();
     foreach (var employee in employees
              .OrderBy(e => e.FirstName)
              .ThenBy(e => e.LastName))
     {
         if (employee.EmployeeId != me.EmployeeId)
         {
             MyEmployees.Add(new EmployeeItemViewModel
             {
                 Address        = employee.Address,
                 Document       = employee.Document,
                 DocumentTypeId = employee.DocumentTypeId,
                 Email          = employee.Email,
                 EmployeeCode   = employee.EmployeeCode,
                 EmployeeId     = employee.EmployeeId,
                 FirstName      = employee.FirstName,
                 LastName       = employee.LastName,
                 LoginTypeId    = employee.LoginTypeId,
                 Phone          = employee.Phone,
                 Picture        = employee.Picture,
             });
         }
     }
 }