Exemplo n.º 1
0
 /// <summary> 
 /// List all employees
 /// </summary>
 static void GetAllEmployees()
 {
     // Get all employees
     Console.WriteLine();
     Console.WriteLine("Listing All Employees (Please wait...)");
     using (var svcClient = new ServiceClient())
     {
         var allEmployee = svcClient.GetAllEmployees();
         if (allEmployee != null && allEmployee.Length > 0)
         {
             foreach (var item in allEmployee)
             {
                 string employeeDetail = string.Format("{0}, {1}, {2}", item.Name,
                                                                        item.EmployeeCode,
                                                                        item.StartDate.ToString("dd/MM/yyyy"));
                 Console.WriteLine(employeeDetail);
             }
         }
         else
         {
             Console.WriteLine("No employees details found...");
         }
     }
 }