Пример #1
0
        public static int ISBNResponse(string promptMessage, string userResponse)
        {
            int userResponseInteger = 0;

            while (!(int.TryParse(userResponse, out userResponseInteger)))
            {
                ConsoleView.DisplayReset();

                ConsoleView.DisplayMessage("");
                ConsoleView.DisplayMessage("It appears you have not entered a valid interger. Please try again.");

                ConsoleView.DisplayMessage("");
                ConsoleView.DisplayPromptMessage(promptMessage);
                userResponse = Console.ReadLine();
            }
            return(userResponseInteger);
        }
Пример #2
0
        private static void RemoveABook()
        {
            FinalLibraryRepositorySQL libraryRepository = new FinalLibraryRepositorySQL();
            List <Library>            librarys          = libraryRepository.SelectAll();
            Library library = new Library();
            int     libraryID;
            string  message;

            libraryID = ConsoleView.GetLibraryID(librarys);

            using (libraryRepository)
            {
                libraryRepository.Delete(libraryID);
            }

            ConsoleView.DisplayReset();

            message = String.Format("Library ID: {0} had been deleted.", libraryID);

            ConsoleView.DisplayMessage(message);
            ConsoleView.DisplayContinuePrompt();
        }