static void Main(string[] args) { Library weeb = new Library("Kinokuniya"); var catalog = new Catalog(); catalog.Add(new Book("kimi no na wa. / your name.", "Makoto Shinkai", 6)); // Create Your Name manga catalog.Add(new Book("We Never Learn", "Tashi Tsutsui", 3)); // Create We Never Learn manga catalog.Add(new Book("Nani ga Fakku Kono BL!?", "Nani", 2)); // Create Werid BL Stuff catalog.Add(new Book("Fullmetal Alchemist Artbook", "Minoru Arakawa", 1)); // Create Fullmetal Artbook weeb.Catalog = catalog; weeb.Register("Raghav Vivek", 1234, "Password"); // Create Raghav weeb.Register("Ishan Parikh", 5678, "drowssaP"); // Create Ishan weeb.Register("Ken Armstrong", 9012, "Pdarsosw"); // Create Ken Console.WriteLine(); weeb.Login(1234, "Password"); // Login Raghav weeb.Login(5678, "drowssaP"); // Login Ishan weeb.Login(9012, "Pdarsosw"); // Login Ken Console.WriteLine(); weeb.CheckOut // Check out Your Name manga to Raghav ( weeb.Users.First(x => x.Name == "Raghav Vivek").ID, weeb.Catalog.Books.First(x => x.Name == "kimi no na wa. / your name.").ID ); weeb.CheckOut // Raghav checks out BL ( weeb.Users.First(x => x.Name == "Raghav Vivek").ID, weeb.Catalog.Books.First(x => x.Name == "Nani ga Fakku Kono BL!?").ID ); weeb.CheckOut // Check out Fullmetal artbook to Ishan ( weeb.Users.First(x => x.Name == "Ishan Parikh").ID, weeb.Catalog.Books.First(x => x.Name == "Fullmetal Alchemist Artbook").ID ); weeb.CheckOut // Check out We Never Learn to Ken ( weeb.Users.First(x => x.Name == "Ken Armstrong").ID, weeb.Catalog.Books.First(x => x.Name == "We Never Learn").ID ); Console.WriteLine(); weeb.CheckIn // Raghav checks in BL ( weeb.Users.First(x => x.Name == "Raghav Vivek").ID, weeb.Catalog.Books.First(x => x.Name == "Nani ga Fakku Kono BL!?").ID ); Console.WriteLine(); weeb.Catalog.Search(x => x.Name == "We Never Learn"); // Search for that cool manga weeb.Logout(weeb.Users.First(x => x.Name == "Raghav Vivek").ID); // Log out Raghav weeb.Logout(weeb.Users.First(x => x.Name == "Ishan Parikh").ID); // Log out Ishan weeb.Logout(weeb.Users.First(x => x.Name == "Ken Armstrong").ID); // Log out Ken Console.WriteLine(); Console.ReadLine(); // So the window doesn't close! }
static void Main(string[] args) { /* * Create a few (4 or so) instances of books and use the method on your Library class to add them to the list of books in an instance of Library */ Book EndersGame = new Book() { Name = "Ender's Game", Author = "Orson Scott Card", ISBN = "ft37h890j", IsAvailable = true }; Book AnimalFarm = new Book() { Name = "Animal Farm", Author = "George Orwell", ISBN = "giy5uno3p", IsAvailable = true }; Book GreatGatsby = new Book() { Name = "The Great Gatsby", Author = "F. Scott Fitzgerald", ISBN = "htu3oine", IsAvailable = true }; Book Twilight = new Book() { Name = "Twilight", Author = "Stephenie Meyer", ISBN = "g678bi2d", IsAvailable = true }; Book book1 = new Book() { Name = "Book 1", Author = "Author 1", ISBN = "ehfh78394", IsAvailable = true }; Book book2 = new Book() { Name = "Book 2", Author = "Author 2", ISBN = "sdnbfayqu89", IsAvailable = true }; CardHolder Madi = new CardHolder() { FullName = "Madison Peper", Id = 1 }; CardHolder Kayla = new CardHolder() { FullName = "Kayla Reid", Id = 2 }; List <CardHolder> allCardHolders = new List <CardHolder>() { Madi, Kayla }; List <Book> newBooks = new List <Book>() { book1, book2, Twilight, AnimalFarm, GreatGatsby, EndersGame }; Library NSSLibrary = new Library(newBooks, "We the best Library", "Everywhere"); Console.WriteLine("///// Checkout a book /////"); NSSLibrary.Checkout(Twilight.ISBN, Madi); if (NSSLibrary.IsAvailable(Twilight.ISBN)) { Console.WriteLine($"{Twilight.Name} is currently available."); } else { Console.WriteLine($"{Twilight.Name} is currently unavailable."); foreach (CardHolder cardHolder in allCardHolders) { if (cardHolder.hasBook(Twilight.ISBN)) { Console.WriteLine($"{cardHolder.FullName} currently has {Twilight.Name}"); } } } Console.WriteLine("///// Check-in a book /////"); NSSLibrary.CheckIn(Twilight.ISBN, Madi); if (NSSLibrary.IsAvailable(Twilight.ISBN)) { Console.WriteLine($"{Twilight.Name} is currently available."); } else { Console.WriteLine($"{Twilight.Name} is currently unavailable."); foreach (CardHolder cardHolder in allCardHolders) { if (cardHolder.hasBook(Twilight.ISBN)) { Console.WriteLine($"{cardHolder.FullName} currently has {Twilight.Name}"); } } } }
static void Main(string[] args) { //Create Books Book book1 = new Book() { Title = "Game of Thrones", Author = "George R.R. Martin", ISBN = "111A" }; Book book2 = new Book() { Title = "Casino Royale", Author = "Ian Fleming", ISBN = "111B" }; Book book3 = new Book() { Title = "Lord of the Rings", Author = "J.R.R. Tolkien", ISBN = "111C" }; Book book4 = new Book() { Title = "Count of Monte Cristo", Author = "Alexander Dumas", ISBN = "111D" }; // Make two books for the initial inventory Book bookA = new Book() { Title = "BookA", Author = "AuthorA", ISBN = "A" }; Book bookB = new Book() { Title = "BookB", Author = "AuthorB", ISBN = "B" }; // make an initial inventory List <Book> initialInventory = new List <Book>(); initialInventory.Add(bookA); initialInventory.Add(bookB); // Create the library and give it the initial Inventory Library library1 = new Library(initialInventory) { Name = "Gulley's Library", Address = "here" }; // Add the books to the Library Inventory library1.AddToInventory(book1); library1.AddToInventory(book2); library1.AddToInventory(book3); library1.AddToInventory(book4); // create a Card Holder CardHolder tg = new CardHolder() { FullName = "Taylor Gulley", Id = 1234 }; //Check if a book is available if (library1.IsAvailable("111D")) { Console.WriteLine("This book is available"); } else { Console.WriteLine("This book is not available"); } // Checkout a book library1.Checkout("111D", tg); //Return the book library1.CheckIn("111D", tg); Console.WriteLine("Hello World!"); }