Пример #1
0
        public void Run()
        {
            //Productos simples
            SimpleProduct ram4gb        = new SimpleProduct("RAM 4GB", "Kingston", 750);
            SimpleProduct ram8gb        = new SimpleProduct("RAM 8GB", "Adata", 1000);
            SimpleProduct disc500Gb     = new SimpleProduct("Disco duro 500GB", "WesternDigital", 1500);
            SimpleProduct disc1Tb       = new SimpleProduct("Disco duro 1 TB", "Toshiba", 2000);
            SimpleProduct cpuAMD        = new SimpleProduct("Cpu AMD phenom", "AMD", 4000);
            SimpleProduct cpuIntel      = new SimpleProduct("Cpu Intel Lake", "Intel", 4500);
            SimpleProduct bigGabinete   = new SimpleProduct("Gabinete grande", "GabGRande", 2200);
            SimpleProduct pequeGabinete = new SimpleProduct("Gabinete pequenio", "GabPequenio", 2000);
            SimpleProduct monitor20inch = new SimpleProduct("Monitor 20 pulgadas", "DELL", 1500);
            SimpleProduct monitor30inch = new SimpleProduct("Monitor 30 pulgadas", "HP", 2000);
            SimpleProduct simpleMouse   = new SimpleProduct("Mouse sencillo", "Loitech", 150);
            SimpleProduct gamerMouse    = new SimpleProduct("Mouse gamer", "Alien", 750);
            SimpleProduct keyBoard      = new SimpleProduct("Teclado", "Acme", 100);

            //Producots compuestos
            CompositeProduct keyBoardAndMouse = new CompositeProduct("KeyBoard & mouse ", 0);

            keyBoardAndMouse.AddProduct(simpleMouse); //150
            keyBoardAndMouse.AddProduct(keyBoard);    //100

            CompositeProduct package1 = new CompositeProduct("Desktop pc", 0);

            package1.AddProduct(ram4gb);           //750
            package1.AddProduct(disc500Gb);        //1500
            package1.AddProduct(cpuIntel);         //4500
            package1.AddProduct(keyBoardAndMouse); //250

            Orden orden = new Orden(1, "Alex");

            orden.addProduct(package1);
            orden.addProduct(pequeGabinete);
            orden.printOreder();
        }