Exemple #1
0
        private static string NewRecord()
        {
            var item = new Employee();

            Console.Write("Input FirstName: ");
            item.FirstName = Console.ReadLine();
            Console.Write("Input LastName: ");
            item.LastName = Console.ReadLine();
            Console.Write("Input DateOfBirth: ");
            DateTime date;

            while (!DateTime.TryParse(Console.ReadLine(), out date))
            {
                Console.Write("Incorrect format. Try again: ");
            }
            item.DateOfBirth = date;
            Console.Write("Input PhoneNumber: ");
            item.PhoneNumber = Console.ReadLine();
            Console.Write("Input Email: ");
            item.Email = Console.ReadLine();
            var newId = client.Create(item).Result.EmployeeId;

            logger.Info("Record created. It's id=" + newId + " received");
            return("Employee record added. It's id: " + newId);
        }