Ejemplo n.º 1
0
 /// <summary>
 /// Find employee based on name
 /// </summary>
 static void GetEmployeeByName()
 {
     // Find employee by name
     Console.WriteLine();
     Console.WriteLine("Find employee by name : ");
     Console.Write("Enter employee name to find details : ");
     var nameMatched = Console.ReadLine();
     using (var svcClient = new ServiceClient())
     {
         var matchData = svcClient.GetEmployeeByName(nameMatched);
         if (matchData != null)
         {
             string msg = string.Format("Name : {0}, Code : {1}, StartDate : {2}", matchData.Name,
                                                                                   matchData.EmployeeCode,
                                                                                   matchData.StartDate.ToString("dd/MM/yyyy"));
             Console.WriteLine(msg);
         }
         else
         {
             Console.WriteLine("No matching data found with the name");
         }
     }
 }