Beispiel #1
0
        public static void GetService()
        {
            Service service = new Service();
            string  insertData;

            Console.WriteLine("GET A SERVICE TESTER");
            Console.WriteLine("--------------------");

            User user = UserActions.GetUser();

            if (user == null)
            {
                user = new User();
                UserForm.NewUser(user);
            }

            Category cat = ChooseCategory();

            ListServices(cat);

            Console.WriteLine("CHOOSE SERVICE : ");
            insertData = Console.ReadLine();
            if (CommonLib.ValidateNumEntrance(insertData))
            {
                try
                {
                    service = _adminMgm.GetService(long.Parse(insertData));
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }
            else
            {
                try
                {
                    service = _adminMgm.GetService(insertData);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }
            if (service != null)
            {
                _adminMgm.NewValidation(user, service);
                Console.WriteLine("Service adquired");
            }
        }