public RemoveShelfErrorCodes RemoveShelf(int shelfNumber) { var newShelf = shelfManager.GetShelfByNumber(shelfNumber); if (newShelf.Book.Count > 0) { return(RemoveShelfErrorCodes.ShelfHasBooks); } shelfManager.RemoveShelf(newShelf.ShelfID); return(RemoveShelfErrorCodes.OK); }
public ShelfStatusCodes RemoveShelf(int shelfNumber, int aisleNumber) { var newShelf = shelfManager.GetShelfByShelfNumber(shelfNumber, aisleNumber); if (newShelf == null) { return(ShelfStatusCodes.NoSuchShelf); } if (newShelf.Book.Count > 0) { return(ShelfStatusCodes.ShelfHasBooks); } shelfManager.RemoveShelf(newShelf.ShelfID); return(ShelfStatusCodes.Ok); }
public RemoveShelfErrorCodes RemoveShelf(int shelfNumber, int bookNumber, int pathID) { var newShelf = shelfManager.GetShelfByShelfNumber(shelfNumber, pathID); if (newShelf == null) { return(RemoveShelfErrorCodes.NoSuchShelf); } if (newShelf.Books.Count > 0) { return(RemoveShelfErrorCodes.ShelfHasBooks); } shelfManager.RemoveShelf(newShelf.ShelfID); return(RemoveShelfErrorCodes.Ok); }
public ShelfErrorCodes RemoveShelf(int shelfID) { var shelf = shelfManager.GetShelf(shelfID); if (shelf == null) { return(ShelfErrorCodes.NoSuchShelf); } else { if (shelf.Books != null) { return(ShelfErrorCodes.TheShelfContainsBooks); } else { shelfManager.RemoveShelf(shelf); } return(ShelfErrorCodes.ok); } }