Exemple #1
0
        public void AddItem(Product product, int quantity,string size,string color,string mnfc , int sizeId,int colorId,int mnId,string shippedTo,DateTime ordDate)
        {
            CartLine line = lineCollection.Where(p => p.Product.ProductID == product.ProductID && p.Size==size && p.Color==color && p.Manufacterer==mnfc).FirstOrDefault();

            if (line == null)
            {
                lineCollection.Add(new CartLine
                {
                    Product = product,
                    Quantity = quantity,
                    Size=size,
                    Color=color,
                    Manufacterer=mnfc,
                    SizeId=sizeId,
                    ColorId=colorId,
                    ManufactererId=mnId,
                    ShippedTo=shippedTo,
                    OrderDate=ordDate
                });
            }
            else
            {
                line.Quantity += quantity;
            }
        }
Exemple #2
0
 public void RemoveLine(Product product, int sizeId, int colorId, int mnId)
 {
     lineCollection.RemoveAll(l => l.Product.ProductID == product.ProductID && l.SizeId==sizeId && l.ColorId==colorId && l.ManufactererId==mnId );
 }