Ejemplo n.º 1
0
        protected IEnumerable<Producer> GetProducers()
        {
            Extra aircondition = new Extra() { Name = "Aircondition" };
            Extra gps = new Extra() { Name = "GPS" };
            Extra esp = new Extra() { Name = "ESP" };
            Extra abs = new Extra() { Name = "ABS" };
            Extra airbag = new Extra() { Name = "Airbag" };

            List<Model> bmwModels = new List<Model>()
            {
                 new Model() { Name = "320i", EngineType = EngineType.Benzine, Extras = new List<Extra>() { aircondition, airbag } },
                 new Model() { Name = "320d", EngineType = EngineType.Diesel, Extras = new List<Extra>() { aircondition, airbag, abs } },
                 new Model() { Name = "520i", EngineType = EngineType.Benzine, Extras = new List<Extra>() { aircondition, airbag, abs } },
                 new Model() { Name = "520d", EngineType = EngineType.Diesel, Extras = new List<Extra>() { aircondition, airbag, abs, esp } }
            };
            Producer bmw = new Producer() { Name = "BMW", Models = bmwModels };

            List<Model> toyotaModels = new List<Model>()
            {
                 new Model() { Name = "Avensis", EngineType = EngineType.Benzine, Extras = new List<Extra>() { aircondition, airbag, abs, esp, gps } },
                 new Model() { Name = "Corolla", EngineType = EngineType.Diesel, Extras = new List<Extra>() { aircondition, airbag, abs } },
                 new Model() { Name = "Auris", EngineType = EngineType.Benzine, Extras = new List<Extra>() { aircondition, airbag, abs } },
                 new Model() { Name = "Aigo", EngineType = EngineType.Diesel, Extras = new List<Extra>() { aircondition, airbag } }
            };
            Producer toyota = new Producer() { Name = "Toyota", Models = toyotaModels };

            List<Model> audiModels = new List<Model>()
            {
                 new Model() { Name = "A3", EngineType = EngineType.Benzine, Extras = new List<Extra>() { aircondition, airbag, abs } },
                 new Model() { Name = "A4", EngineType = EngineType.Diesel, Extras = new List<Extra>() { aircondition, airbag, abs } },
                 new Model() { Name = "A6", EngineType = EngineType.Benzine, Extras = new List<Extra>() { aircondition, airbag, abs, esp } },
                 new Model() { Name = "A8", EngineType = EngineType.Diesel, Extras = new List<Extra>() { aircondition, airbag, abs, esp, gps } }
            };
            Producer audi = new Producer() { Name = "Audi", Models = audiModels };

            List<Producer> producers = new List<Producer>() { bmw, audi, toyota };

            return producers;
        }
Ejemplo n.º 2
0
 public Store(Producer producer)
 {
     this.StoreName = producer.ProducerName.ToString();
     OrderList      = new List <IOrder>();
     VehicleList    = new List <Vehicle>();
 }