/// <summary> /// Initializes a new instance of the <see cref="WishListOperationsController"/> class. /// </summary> public WishListOperationsController() { if (CurrentCustomer != null) { _wishList = ((ICustomer)CurrentCustomer).WishList(); } }
public DetailModel(UserManager <User> userManager, TuplaContext context, IGame db, IGamePicture picdb, IGameTag dbgametag, IPlatform platformdb, IPlatformOfGame gamePlatformdb, ITag dbTag, IWishList wishdb, ITransaction transdb, IOrderDetail orderdetaildb, IReview reviewdb, ICustomerPicture userpicdb) { this.userManager = userManager; this.context = context; this.db = db; this.picdb = picdb; this.dbgametag = dbgametag; this.platformdb = platformdb; this.gamePlatformdb = gamePlatformdb; this.dbTag = dbTag; this.wishdb = wishdb; this.transdb = transdb; this.orderdetaildb = orderdetaildb; this.reviewdb = reviewdb; this.userpicdb = userpicdb; }
/// <summary> /// Initializes a new instance of the <see cref="BazaarWishListController"/> class. /// </summary> public BazaarWishListController() { if (CurrentCustomer != null) { _wishList = ((ICustomer)CurrentCustomer).WishList(); } }
/// <summary> /// Moves the wish list to the basket. /// </summary> /// <param name="wishList"> /// The wish list. /// </param> public static void MoveToBasket(this IWishList wishList) { var basket = wishList.Customer.Basket(); basket.Items.Add(wishList.Items.Select(x => x.AsLineItemOf <ItemCacheLineItem>())); basket.Save(); wishList.Empty(); }
/// <summary> /// Saves the wish list. /// </summary> /// <param name="merchelloContext"> /// The merchello context. /// </param> /// <param name="wishlist"> /// The wish list. /// </param> internal static void Save(IMerchelloContext merchelloContext, IWishList wishlist) { // Update the wishlist item cache version so that it can be validated in the checkout ((WishList)wishlist).VersionKey = Guid.NewGuid(); merchelloContext.Services.ItemCacheService.Save(((WishList)wishlist).ItemCache); Refresh(merchelloContext, wishlist); }
public WishlistModel(UserManager <Areas.Identity.Data.User> userManager, IWishList wishlistdb, IGame gamedb, IGamePicture gamepicdb) { this.userManager = userManager; this.wishlistdb = wishlistdb; this.gamedb = gamedb; this.gamepicdb = gamepicdb; }
public IActionResult SearchWishList_Products(int id, string search) { List <APIUsers.Library.Models.Product> listProducts = new List <APIUsers.Library.Models.Product>(); using (IWishList WishList = Factorizador.CrearConexionServicioWishList(ConnectionType.MSSQL, ConnectionStringLocal)) { listProducts = WishList.searchProducts_Wishlist(search, id); } return(Ok(new { listProducts })); }
public int RemovefromWishList([FromBody] APIUsers.Library.Models.WishList wishList) { int id = 0; using (IWishList WishList = Factorizador.CrearConexionServicioWishList(ConnectionType.MSSQL, ConnectionStringLocal)) { id = WishList.removeFromWishList(wishList.ID_User, wishList.ID_Product); } return(id); }
/// <summary> /// Refreshes the runtime cache /// </summary> /// <param name="merchelloContext">The merchello context</param> /// <param name="wishlist">The <see cref="IWishList"/></param> public static void Refresh(IMerchelloContext merchelloContext, IWishList wishlist) { var cacheKey = MakeCacheKey(wishlist.Customer); merchelloContext.Cache.RuntimeCache.ClearCacheItem(cacheKey); var customerItemCache = merchelloContext.Services.ItemCacheService.GetItemCacheWithKey(wishlist.Customer, ItemCacheType.Wishlist); wishlist = new WishList(customerItemCache, wishlist.Customer); merchelloContext.Cache.RuntimeCache.GetCacheItem(cacheKey, () => wishlist); }
public IEnumerable <Product> GetWishList_Products_ByOrder(int id, string order) { List <Product> listProducts = new List <Product>(); using (IWishList WishList = Factorizador.CrearConexionServicioWishList(ConnectionType.MSSQL, ConnectionStringLocal)) { listProducts = WishList.getProducts_Wishlist_ByOrder(id, order); } return(listProducts); }
public InMemoryWishListTest() { _systemClockMock = new Mock <ISystemClock>(); _options = new InMemoryWishListOptions { SystemClock = _systemClockMock.Object, ExpirationInSeconds = 30 }; #if TEST_InMemoryWishListRefactored sut = new InMemoryWishListRefactored(_options); #else sut = new InMemoryWishList(_options); #endif }
/// <summary> /// Moves the wish list to the basket. /// </summary> /// <param name="wishList"> /// The wish list. /// </param> /// <param name="lineItemKey"> /// The line Item Key. /// </param> public static void MoveItemToBasket(this IWishList wishList, Guid lineItemKey) { var lineItem = wishList.Items.FirstOrDefault(x => x.Key == lineItemKey); if (lineItem == null) { return; } var basket = wishList.Customer.Basket(); basket.AddItem(lineItem.AsLineItemOf <ItemCacheLineItem>()); basket.Save(); wishList.RemoveItem(lineItem.Key); wishList.Save(); }
public static IWishList CrearConexionServicioWishList(Models.ConnectionType type, string connectionString) { IWishList nuevoMotor = null;; switch (type) { case Models.ConnectionType.NONE: break; case Models.ConnectionType.MSSQL: SqlConexion sql = SqlConexion.Conectar(connectionString); nuevoMotor = WishListService.CrearInstanciaSQL(sql); break; case Models.ConnectionType.MYSQL: break; default: break; } return(nuevoMotor); }
public WishlistController(IWishList wishList, IMapper mapper) { _wishlist = wishList; _mapper = mapper; }
/// <summary> /// Initializes a new instance of the <see cref="BazaarWishListController"/> class. /// </summary> public BazaarWishListController() { if (CurrentCustomer != null) _wishList = ((ICustomer)CurrentCustomer).WishList(); }
/// <summary> /// Empties the wish list. /// </summary> /// <param name="merchelloContext"> /// The merchello context. /// </param> /// <param name="wishlist"> /// The wish list. /// </param> internal static void Empty(IMerchelloContext merchelloContext, IWishList wishlist) { wishlist.Items.Clear(); Save(merchelloContext, wishlist); }
/// <summary> /// Moves the wish list to the basket. /// </summary> /// <param name="wishList"> /// The wish list. /// </param> /// <param name="sku"> /// The SKU. /// </param> public static void MoveItemToBasket(this IWishList wishList, string sku) { var lineItem = wishList.Items.FirstOrDefault(x => x.Sku.Equals(sku)); wishList.MoveItemToBasket(lineItem); }
public WishListController(IWishList wishList) { _wishList = wishList ?? throw new ArgumentNullException(nameof(wishList)); }
/// <summary> /// Moves the wish list to the basket. /// </summary> /// <param name="wishList"> /// The wish list. /// </param> /// <param name="lineItem"> /// The line Item. /// </param> public static void MoveItemToBasket(this IWishList wishList, ILineItem lineItem) { wishList.MoveItemToBasket(lineItem.Key); }
/// <summary> /// Initializes a new instance of the <see cref="WishListOperationsController"/> class. /// </summary> public WishListOperationsController() { if (CurrentCustomer != null) _wishList = ((ICustomer)CurrentCustomer).WishList(); }