Ejemplo n.º 1
0
 public static CreatorProducts getInstance()
 {
     if (instance == null)
     {
         instance = new CreatorProducts();
     }
     return(instance);
 }
Ejemplo n.º 2
0
        public void AddProduct(String name, int count)
        {
            int pos = FindPositionProductInBasket(name);

            if (pos == -1)
            {
                basket.Add(CreatorProducts.getInstance().CreateProduct(name));
                basket[basket.Count - 1].AddCountInOrder(count);
            }
            else
            {
                basket[pos].AddCountInOrder(count);
            }
        }