public IActionResult AddToWishList([FromBody] CartModel wish)
        {
            _log4net.Info("Add to WishList method initiated");
            try
            {
                _log4net.Info("Add To Wishlist Provider called");

                WishlistSuccess message = _provider.Wish(wish.CustomerId, wish.ProductId);
                return(Ok(message));
            }
            catch
            {
                _log4net.Info("Error calling Add Wishlist provider");
                return(Ok(null));
            }
        }
Ejemplo n.º 2
0
        public WishlistSuccess Wish(int custid, int prodid)
        {
            Random      unqid = new Random();
            WishlistDto wl    = new WishlistDto()
            {
                VendorId            = unqid.Next(1, 5),
                CustomerId          = custid,
                ProductId           = prodid,
                Quantity            = 1,
                DateAddedToWishlist = DateTime.Now.Date
            };
            WishlistDto     wl1 = proceedToBuyRepository.addToWishlist(wl);
            WishlistSuccess msg = new WishlistSuccess();

            msg.Message = "Requested product is out of stock. Product added to wishlist";
            return(msg);
        }
Ejemplo n.º 3
0
        public WishlistSuccess Wish(int custid, int prodid)
        {
            WishlistDto wl = new WishlistDto()
            {
                CustomerId          = custid,
                ProductId           = prodid,
                Quantity            = 1,
                DateAddedToWishlist = DateTime.Now.Date
            };
            WishlistDto     wl1 = proceedToBuyRepository.addToWishlist(wl);
            WishlistSuccess msg = new WishlistSuccess();

            if (wl1 != null)
            {
                msg.Message = " Product added to wishlist";
                return(msg);
            }

            return(null);
        }