Ejemplo n.º 1
0
 public static ProductsInfo getInstance()
 {
     if (instance == null)
     {
         instance = new ProductsInfo();
     }
     return(instance);
 }
Ejemplo n.º 2
0
 static void InitProducts()
 {
     ProductsInfo.getInstance().AddProductInfo("A", 10.0);
     ProductsInfo.getInstance().AddProductInfo("B", 20.0);
     ProductsInfo.getInstance().AddProductInfo("C", 30.0);
     ProductsInfo.getInstance().AddProductInfo("D", 40.0);
     ProductsInfo.getInstance().AddProductInfo("E", 50.0);
     ProductsInfo.getInstance().AddProductInfo("F", 60.0);
     ProductsInfo.getInstance().AddProductInfo("G", 70.0);
     ProductsInfo.getInstance().AddProductInfo("H", 80.0);
     ProductsInfo.getInstance().AddProductInfo("I", 90.0);
     ProductsInfo.getInstance().AddProductInfo("J", 100.0);
     ProductsInfo.getInstance().AddProductInfo("K", 110.0);
     ProductsInfo.getInstance().AddProductInfo("L", 120.0);
     ProductsInfo.getInstance().AddProductInfo("M", 130.0);
 }
Ejemplo n.º 3
0
        public IProduct CreateProduct(String nameProduct)
        {
            ProductInfo pi = ProductsInfo.getInstance().GetProductInfo(nameProduct);

            return(new Product(pi.name, pi.cost));
        }