public void BorrowEdition() { string email = Helper.ReadString("Introduce user's email: "); while (!UserDAL.CheckUser(email)) { Helper.DisplayError("\n User not found!"); Console.ForegroundColor = ConsoleColor.Red; email = Helper.ReadString("\nReintroduce email: "); } string bookName = Helper.ReadString("Introduce the name of the book: "); while (!BookDAL.CheckBook(bookName)) { Helper.DisplayError("\n Book not found!"); Console.ForegroundColor = ConsoleColor.Red; bookName = Helper.ReadString("Introduce the name of the book: "); } int publicationYear = Helper.ReadYear("Introduce the year of publishing: "); string publishingHouseName = Helper.ReadString("Introduce publishing house name: "); while (!EditionDAL.CheckEdition(bookName, publishingHouseName, publicationYear)) { Helper.DisplayError("\n Edition not found!"); Console.ForegroundColor = ConsoleColor.Red; publicationYear = Helper.ReadYear("Introduce the year of publishing: "); publishingHouseName = Helper.ReadString("Introduce publishing house name: "); } string authorName = Helper.ReadString("Introduce the name of the author: "); Author author = new Author(authorName); while (!AuthorDAL.CheckAuthor(author)) { Helper.DisplayError("\n Wrong author!"); Console.ForegroundColor = ConsoleColor.Red; authorName = Helper.ReadString("Introduce the name of the author: "); author = new Author(authorName); } if (ValidBorrow(email, bookName, publishingHouseName, publicationYear)) { Edition edition = new Edition() { PublicationYear = publicationYear, PublishingHouseName = publishingHouseName, Name = bookName, }; int daysLeft = Helper.ReadInteger("Introduce the number of days of the borrow: "); DateTime endDate = DateTime.Now.AddDays(daysLeft); EditionDAL.BorrowEdition(email, edition, author, endDate); Console.WriteLine("\n Operation completed succesfully!"); } }