Ejemplo n.º 1
0
        public void MakeItHappen()
        {
            var parsedBookData = BuildLibraryItems.GetFileMetadata();
            var bookList       = BuildLibraryItems.BuildBookInstanceList(parsedBookData);
            var userList       = LoginAndRegister.GetUserArray();
            var user           = LoginAndRegister.LogIn(userList, bookList);

            userList = LoginAndRegister.AddUserToList(userList, user.Name);
            var checkedOutBooks = CheckInAndOut.GetCheckedOutBooks(bookList, user);
            var checkedInBooks  = CheckInAndOut.GetCheckedinBooks(bookList);

            CheckInAndOut.UserStatus(checkedOutBooks);
            Console.WriteLine("\n");

            var welcome = new Welcome();

            welcome.WelcomeUser();

            //CheckInAndOut.CheckIn(bookList, checkedOutBooks);
            //CheckInAndOut.CheckOut(bookList, checkedInBooks, user);


            BuildLibraryItems.BuildBookPropertyFile(bookList);
            BuildLibraryItems.BuildUserFile(userList);
        }
Ejemplo n.º 2
0
        public void MakeItHappen()
        {
            Welcome.IntroPage();
            var parsedBookData = BuildLibraryItems.GetFileMetadata();
            var bookList       = BuildLibraryItems.BuildBookInstanceList(parsedBookData);
            var userList       = LoginAndRegister.GetUserArray();
            var user           = LoginAndRegister.LogIn(userList, bookList);

            userList = LoginAndRegister.AddUserToList(userList, user.Name);
            var checkedOutBooks = CheckInAndOut.GetCheckedOutBooks(bookList, user);
            var checkedInBooks  = CheckInAndOut.GetCheckedinBooks(bookList);

            CheckInAndOut.UserStatus(checkedOutBooks);
            Console.WriteLine("\n");

            while (true)
            {
                var userSelection = Welcome.WelcomeUser();
                switch (userSelection)
                {
                case 1:
                    GetSearchResults.AuthorSearch(bookList);
                    break;

                case 2:
                    GetSearchResults.TitleSearch(bookList);
                    break;

                case 3:
                    GetSearchResults.FullStatusDisplay(bookList);
                    break;

                case 4:
                    CheckInAndOut.CheckIn(bookList, checkedOutBooks, checkedInBooks);
                    break;

                case 5:
                    CheckInAndOut.CheckOut(bookList, checkedInBooks, checkedOutBooks, user);
                    break;

                case 6:
                    BuildLibraryItems.AddBook(bookList, checkedInBooks);
                    break;

                case 7:
                    Welcome.ResetPage();
                    Console.WriteLine($"Please come back soon, {user.Name}!");
                    BuildLibraryItems.BuildBookPropertyFile(bookList);
                    BuildLibraryItems.BuildUserFile(userList);
                    return;

                default:
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        public void MakeItHappen()
        {
            var parsedBookData = BuildLibraryItems.GetFileMetadata();
            var bookList       = BuildLibraryItems.BuildBookInstanceList(parsedBookData);
            var userList       = LoginAndRegister.GetUserArray();
            var user           = LoginAndRegister.LogIn(userList, bookList);

            userList = LoginAndRegister.AddUserToList(userList, user.Name);
            var checkedOutBooks = CheckInAndOut.GetCheckedOutBooks(bookList, user);
            var checkedInBooks  = CheckInAndOut.GetCheckedinBooks(bookList);

            CheckInAndOut.UserStatus(checkedOutBooks);
            Console.WriteLine("\n");

            while (true)
            {
                // wrap this entire thing in a while
                var userSelection = Welcome.WelcomeUser();
                if (userSelection == 1)
                {
                    GetSearchResults.AuthorSearch(bookList);
                }
                else if (userSelection == 2)
                {
                    GetSearchResults.TitleSearch(bookList);
                }
                else if (userSelection == 3)
                {
                    GetSearchResults.FullStatusDisplay(bookList);
                }
                else if (userSelection == 4)
                {
                    CheckInAndOut.CheckIn(bookList, checkedOutBooks, checkedInBooks);
                }
                else if (userSelection == 5)
                {
                    CheckInAndOut.CheckOut(bookList, checkedInBooks, user);
                }
                else if (userSelection == 6)
                {
                    Console.WriteLine($"See ya later, {user.Name}");
                    break;
                }

                //BuildLibraryItems.BuildBookPropertyFile(bookList);
                //BuildLibraryItems.BuildUserFile(userList);
            }
        }