Exemple #1
0
 /// <summary>
 /// Adds a line item to the wish list.
 /// </summary>
 /// <param name="lineItem">
 /// The <see cref="IItemCacheLineItem"/>.
 /// </param>
 public void AddItem(IItemCacheLineItem lineItem)
 {
     if (lineItem.Quantity <= 0)
     {
         lineItem.Quantity = 1;
     }
     if (lineItem.Price < 0)
     {
         lineItem.Price = 0;
     }
     _itemCache.AddItem(lineItem);
 }
Exemple #2
0
        /// <summary>
        /// The build dto.
        /// </summary>
        /// <param name="entity">
        /// The entity.
        /// </param>
        /// <returns>
        /// The <see cref="ItemCacheItemDto"/>.
        /// </returns>
        public ItemCacheItemDto BuildDto(IItemCacheLineItem entity)
        {
            var dto = new ItemCacheItemDto()
            {
                Key           = entity.Key,
                ContainerKey  = entity.ContainerKey,
                LineItemTfKey = entity.LineItemTfKey,
                Sku           = entity.Sku,
                Name          = entity.Name,
                Quantity      = entity.Quantity,
                Price         = entity.Price,
                ExtendedData  = entity.ExtendedData.SerializeToXml(),
                Exported      = entity.Exported,
                UpdateDate    = entity.UpdateDate,
                CreateDate    = entity.CreateDate
            };

            return(dto);
        }
Exemple #3
0
        public ItemCacheItemDto BuildDto(IItemCacheLineItem entity)
        {
            var dto = new ItemCacheItemDto()
            {
                Key = entity.Key,
                ContainerKey = entity.ContainerKey,
                LineItemTfKey = entity.LineItemTfKey,
                Sku = entity.Sku,
                Name = entity.Name,
                Quantity = entity.Quantity,
                Price = entity.Price,
                ExtendedData = entity.ExtendedData.SerializeToXml(),
                Exported = entity.Exported,
                UpdateDate = entity.UpdateDate,
                CreateDate = entity.CreateDate
            };

            return dto;
        }
        /// <summary>
        /// Adds a line item to the customer item cache.
        /// </summary>
        /// <param name="lineItem">
        /// The <see cref="IItemCacheLineItem"/>.
        /// </param>
        public void AddItem(IItemCacheLineItem lineItem)
        {
            if (lineItem.Quantity <= 0)
            {
                lineItem.Quantity = 1;
            }
            if (lineItem.Price < 0)
            {
                lineItem.Price = 0;
            }

            if (AddingItem.IsRaisedEventCancelled(new Core.Events.NewEventArgs <ILineItem>(lineItem), this))
            {
                return;
            }

            _itemCache.AddItem(lineItem);

            AddedItem.RaiseEvent(new Core.Events.NewEventArgs <ILineItem>(lineItem), this);
        }
        /// <summary>
        /// Adds a line item to the customer item cache.
        /// </summary>
        /// <param name="lineItem">
        /// The <see cref="IItemCacheLineItem"/>.
        /// </param>
        public void AddItem(IItemCacheLineItem lineItem)
        {
            if (lineItem.Quantity <= 0) lineItem.Quantity = 1;
            if (lineItem.Price < 0) lineItem.Price = 0;

            if (AddingItem.IsRaisedEventCancelled(new Core.Events.NewEventArgs<ILineItem>(lineItem), this))
            {
                return;
            }

            _itemCache.AddItem(lineItem);

            AddedItem.RaiseEvent(new Core.Events.NewEventArgs<ILineItem>(lineItem), this);
        }
Exemple #6
0
 /// <summary>
 /// Adds a line item to the basket.
 /// </summary>
 /// <param name="lineItem">
 /// The <see cref="IItemCacheLineItem"/>.
 /// </param>
 public void AddItem(IItemCacheLineItem lineItem)
 {
     if (lineItem.Quantity <= 0) lineItem.Quantity = 1;
     if (lineItem.Price < 0) lineItem.Price = 0;
     _itemCache.AddItem(lineItem);
 }
Exemple #7
0
 /// <summary>
 /// Maps <see cref="IItemCacheLineItem"/> to <see cref="ItemCacheLineItemDisplay"/>.
 /// </summary>
 /// <param name="lineItem">
 /// The line item.
 /// </param>
 /// <returns>
 /// The <see cref="ItemCacheLineItemDisplay"/>.
 /// </returns>
 public static ItemCacheLineItemDisplay ToItemCacheLineItemDisplay(this IItemCacheLineItem lineItem)
 {
     return(AutoMapper.Mapper.Map <IItemCacheLineItem, ItemCacheLineItemDisplay>(lineItem));
 }