Exemplo n.º 1
0
        private static void RescindAward()
        {
            Console.WriteLine("Enter user id");
            string user = Console.ReadLine();
            int    userid;

            while (!int.TryParse(user, out userid))
            {
                Console.WriteLine("Enter a valid integer");
                user = Console.ReadLine();
            }

            Console.WriteLine("Enter award id");
            string award = Console.ReadLine();
            int    awardid;

            while (!int.TryParse(award, out awardid))
            {
                Console.WriteLine("Enter a valid integer");
                award = Console.ReadLine();
            }

            try
            {
                awardLogic.Rescind(userid, awardid);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            finally
            {
                Console.WriteLine($"Successfully rescinded {awardLogic.Get(awardid).Name} from {userLogic.Get(userid).Username}");
            }
        }