예제 #1
0
        public static void Run(Profile currentProfile, User currentUser)
        {
            while (true)
            {
                Profile potentialMatch = ProfileRepository.GetPotentialMatchProfile(currentUser);
                GUI.DisplayDatingProfile(potentialMatch);

                string menuChoice = Console.ReadLine().ToLower();
                if (menuChoice == "1")
                {
                    MatchRepository.RegisterLike(currentUser, potentialMatch);
                    bool isMatch = MatchRepository.CheckIfMatch(currentProfile, potentialMatch);
                    if (isMatch == true)
                    {
                        MatchesPage.Run(currentProfile, currentUser, potentialMatch);
                    }
                }
                if (menuChoice == "2")
                {
                    Run(currentProfile, currentUser);
                }
                if (menuChoice == "3")
                {
                    UserMenuPage.Run(currentProfile, currentUser);
                }
            }
        }
예제 #2
0
        public static void Run(Profile currentProfile, User currentUser)
        {
            while (true)
            {
                GUI.DisplayEditProfile(currentProfile);
                string menuChoice = Console.ReadLine().ToLower();

                if (menuChoice == "1")
                {
                    ProfileRepository.ChangeProfileStatus(currentProfile, currentUser);
                    break;
                }
                if (menuChoice == "2")
                {
                    UserMenuPage.Run(currentProfile, currentUser);
                }
            }
        }
예제 #3
0
        public static void Run()
        {
            GUI.DisplayLoginPage();

            User currentUser = UserRepository.GetUserCredentials();

            if (UserRepository.UserLoginSuccess(currentUser) == true)
            {
                Profile currentProfile = ProfileRepository.GetUserProfile(currentUser);
                UserMenuPage.Run(currentProfile, currentUser);
            }
            else if (UserRepository.UserLoginSuccess(currentUser) == false)
            {
                Run();
            }
            else
            {
                Console.SetCursorPosition(2, 15);
                Console.WriteLine("Something went wrong..");
                Console.SetCursorPosition(2, 16);
                Console.WriteLine("Press any key to return to the front page..");
                Console.ReadKey();
            }
        }