public async Task <WishlistDto> 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);

            return(wl);
        }
Exemplo 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);
        }
Exemplo 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);
        }
 public bool Add(WishlistDto entity)
 {
     try
     {
         _log4net.Info("Add To Wishlist Repository initiated");
         var result = proceedToBuyRepository.addToWishlist(entity);
         if (result == null)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
     catch
     {
         _log4net.Info("Error in calling Wishlist Repository");
         return(false);
     }
 }