Example #1
0
        // MAIN
        static void Main(string[] args)
        {
            // INITIALIZAION
            // Array of settings
            string[] settings = { "Data Source=.\\user.db", "SHA256", "8" };
            // Instantiates the User
            User currentUser = new User();

            currentUser.Session  = 0;
            currentUser.LoggedIn = 0;
            // Caches conference lists
            var confLists = ConfMgmt.BuildConfLists();

            while (currentUser.Session == 0)
            {
                while (currentUser.LoggedIn == 0)
                {
                    currentUser = UserMgmt.LoginMenu(currentUser, confLists, settings);
                }

                int again = 1;
                while (again == 1 && currentUser.LoggedIn == 1)
                {
                    again = MainMenu(currentUser, confLists, settings);
                }
            }
        }
Example #2
0
        // PRIMARY FUNCTIONALITY
        // Prints menu and interprets user's choice
        public static int MainMenu(User currentUser, List <List <string> > confLists, string[] settings)
        {
            Console.Clear();
            Console.WriteLine("************************* MAIN MENU **************************");
            Console.WriteLine("1. Display Individual School Stats by Football Conference");
            Console.WriteLine("2. Display Individual School Stats by Primary Conference");
            Console.WriteLine("3. Display Favorite Football Conference");
            Console.WriteLine("4. Display Favorite Primary Conference");
            Console.WriteLine("...");
            Console.WriteLine("6. Edit Profile");
            Console.WriteLine("7. Delete Profile");
            Console.WriteLine("...");
            Console.WriteLine("9. Quit");
            Console.WriteLine("");
            string choice = Console.ReadLine();

            if (choice == "1")
            {
                ConfMgmt.GetStats(5, confLists);
                return(1);
            }
            else if (choice == "2")
            {
                ConfMgmt.GetStats(4, confLists);
                return(1);
            }
            else if (choice == "3")
            {
                ConfMgmt.GetStats(5, currentUser.FavFootballConf, confLists);
                return(1);
            }
            else if (choice == "4")
            {
                ConfMgmt.GetStats(4, currentUser.FavPrimaryConf, confLists);
                return(1);
            }
            else if (choice == "6")
            {
                UserMgmt.EditUser(currentUser, confLists, settings);
                return(1);
            }
            else if (choice == "7")
            {
                UserMgmt.DeleteUser(currentUser, settings);
                return(0);
            }
            else if (choice == "9")
            {
                Console.WriteLine("Goodbye");
                return(0);
            }
            else
            {
                return(1);
            }
        }