Esempio n. 1
0
        public async Task <IActionResult> DeleteBookFromWishList([FromRoute] int bookId)
        {
            string WishListData;

            try
            {
                string userId = null;
                userId = User.FindFirst("userId").Value;
                if (userId == null)
                {
                    return(this.Ok(new ResponseEntity(HttpStatusCode.OK, "Invalid Token", userId, "")));
                }
                WishListData = await Task.FromResult(WishListService.DeleteBookFromWishList(bookId, userId));

                if (!WishListData.Contains("Not") && WishListData != null)
                {
                    return(this.Ok(new ResponseEntity(HttpStatusCode.OK, WishListData, bookId, "")));
                }
            }
            catch
            {
                return(this.BadRequest(new ResponseEntity(HttpStatusCode.BadRequest, "Bad Request", null, "")));
            }
            return(this.Ok(new ResponseEntity(HttpStatusCode.NoContent, WishListData, null, "")));
        }
Esempio n. 2
0
        public List <string> transferItemFromWishList(int id, int bookId,
                                                      string wishListNameOrigin, string wishListNameDestination)
        {
            WishListData data = new WishListData();

            return(data.transferItemFromWishList(id, bookId, wishListNameOrigin, wishListNameDestination));
        }
Esempio n. 3
0
        public List <string> deleteUserWishList(int id, string wishListName)
        {
            WishListData data = new WishListData();

            return(data.deleteUserWishList(id, wishListName));
        }
Esempio n. 4
0
        public List <WishlistModel> getUserWishList(int UserId)
        {
            WishListData data = new WishListData();

            return(data.getUserWishList(UserId));
        }
Esempio n. 5
0
        public List <WishlistBookModel> getWishListBooks(int UserId, string wishListName)
        {
            WishListData data = new WishListData();

            return(data.getWishListBooks(UserId, wishListName));
        }
Esempio n. 6
0
        public List <string> removeItemFromWishList(int id, int bookId, string wishListName)
        {
            WishListData data = new WishListData();

            return(data.removeItemFromWishList(id, bookId, wishListName));
        }
Esempio n. 7
0
        public List <string> addItemToWishList(int id, int bookId, string wishListName)
        {
            WishListData data = new WishListData();

            return(data.addItemToWishList(id, bookId, wishListName));
        }
Esempio n. 8
0
        public List <string> createWishList(int id, string wishListName)
        {
            WishListData data = new WishListData();

            return(data.createWishList(id, wishListName));
        }