예제 #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, "")));
        }
예제 #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));
        }
예제 #3
0
        public List <string> deleteUserWishList(int id, string wishListName)
        {
            WishListData data = new WishListData();

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

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

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

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

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

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