public virtual IBasketLine AddItem(BasketItemType itemType, string description, decimal price) {

            BasketItem item = new BasketItem();

            item.Basket = this;
            item.Quantity = 1;
            item.ItemType = itemType;
            item.Status = PricingStatus.OK;
            Money m = new Money(price);
            item.UnitLinePrice = m;
            
            BasketItemList.Add(item);

            return item;
        }
 //This should be a preferred method
 public virtual IBasketLine AddItem(string itemCode, int quantity, BasketItemType itemType, string description, decimal unitPrice) {
     throw new Exception("The method or operation is not implemented.");
 }
		protected Money GetBasketItemTotal(BasketItemType itemType) {

			Money total = new Money(CurrencyCode, 0);
			ArrayList itemList = GetBasketItemList(itemType);

			foreach (IBasketLine item in itemList) {
				total.Amount += item.LinePrice.Amount;
			}

			return total;
		}
        public virtual IBasketLine AddItem(Product product, int quantity, BasketItemType itemType) {
            
            BasketItem item = new BasketItem();

            item.Basket = this;
            item.Product = product;
            item.Quantity = quantity;
            item.ItemType = itemType;

            BasketItemList.Add(item);

            return item;
        }
		public ArrayList GetBasketItemList(BasketItemType itemType) {

			IList itemList = BasketItemList;
			ArrayList foundItems = new ArrayList();

			foreach (IBasketLine item in itemList) {
				if (item.ItemType == itemType) {
					foundItems.Add(item);
				}
			}

			return foundItems;

		}
		public int RemoveItems(BasketItemType itemType) {
			return RemoveArrayItems(GetBasketItemList(itemType));
		}
		public IBasketLine AddItem(string itemCode, int quantity, BasketItemType itemType, string description, decimal unitPrice) {
			return _basket.AddItem(itemCode, quantity, itemType, description, unitPrice);
		}
        public IBasketLine AddItem(BasketItemType itemType, string description, decimal price) {

            throw new Exception("The method or operation is not implemented.");
        }
Example #9
0
 public BasketItem(BasketItemType itemType)
 {
     ItemType = itemType;
 }