コード例 #1
0
ファイル: ConsoleUI.cs プロジェクト: MasterOfDeath/XT2015-5
        private static void RewardUser(IAwardLogic logic)
        {
            try
            {
                Console.Write("Enter Id of Employee: ");
                int userId = Convert.ToInt32(Console.ReadLine());

                Console.Write("Enter Id of Award: ");
                int awardId = Convert.ToInt32(Console.ReadLine());

                if (!logic.PresentAward(userId, awardId))
                {
                    Console.WriteLine("Employee or Award haven't found.");
                }
            }
            catch (FormatException)
            {
                Console.WriteLine("Only integer numbers are possoble.");
            }
            catch (OverflowException)
            {
                Console.WriteLine("Out of range");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            Console.WriteLine();
        }