public void AddPackstoCarriage(Packs packs, int quantity) { CartLine line = lineCollection.Where(p => p.Packs.PacksID == packs.PacksID).FirstOrDefault(); if (line == null) { lineCollection.Add(new CartLine { Packs = packs, Quantity = quantity /*, Waga = waga*/ }); } else { line.Quantity += quantity; // line.Waga += waga; } }
public void RemoveLine(Packs packs) { lineCollection.RemoveAll(l => l.Packs.PacksID == packs.PacksID); }