예제 #1
0
        public void AddItem(disks dissk, int quantity)
        {
            CartLine line = lineCollection
                            .Where(g => g.disk.id == dissk.id)
                            .FirstOrDefault();

            if (line == null)
            {
                lineCollection.Add(new CartLine
                {
                    disk     = dissk,
                    Quantity = quantity
                });
            }
            else
            {
                line.Quantity += quantity;
            }
        }
예제 #2
0
 public void RemoveLine(disks dissk)
 {
     lineCollection.RemoveAll(l => l.disk.id == dissk.id);
 }