Exemplo n.º 1
0
        public AddBookStatusCodes AddBook(string iSBNNumber, string bookTitle, string author, int price, int condition,
                                          int shelfNumber, int aisleNumber)
        {
            var existingShelf = shelfManager.GetShelfFromAisle(shelfNumber, aisleNumber);
            var purchaseYear  = DateTime.Today.Year;

            if (existingShelf == null)
            {
                return(AddBookStatusCodes.NoSuchShelf);
            }

            bookManager.AddBook(iSBNNumber, bookTitle, author, purchaseYear, price, condition, existingShelf, false, null);
            return(AddBookStatusCodes.Ok);
        }
Exemplo n.º 2
0
        public AddShelfStatusCodes AddShelf(int shelfNumber, int aisleNumber)
        {
            var newAisle = aisleManager.GetAisleByAisleNumber(aisleNumber);

            if (newAisle == null)
            {
                return(AddShelfStatusCodes.NoSuchAisle);
            }
            var existingShelf = shelfManager.GetShelfFromAisle(shelfNumber, aisleNumber);

            if (existingShelf != null)
            {
                return(AddShelfStatusCodes.ShelfAlreadyExist);
            }

            shelfManager.AddShelf(shelfNumber, aisleNumber);
            return(AddShelfStatusCodes.Ok);
        }