Пример #1
0
 public EntityProductBusinessEngine(IDataRepositoryFactory data_repo_fact, IBusinessEngineFactory bus_eng_fact, IEntityServiceFactory ent_serv_fact)
     : base(data_repo_fact, bus_eng_fact, ent_serv_fact)
 {
     _entity_product_repo = _data_repository_factory.GetDataRepository <IEntityProductRepository>();
     _prod_repository     = _data_repository_factory.GetDataRepository <IProductRepository>();
     _prod_type_be        = _business_engine_factory.GetBusinessEngine <IProductTypeBusinessEngine>();
     _entity_type_be      = _business_engine_factory.GetBusinessEngine <IEntityTypeBusinessEngine>();
     _ent_prod_es         = _entity_service_factory.GetEntityService <IEntityProductEntityService>();
 }
Пример #2
0
        public List <EntityProduct> GetAllEntityProducts()
        {
            List <EntityProduct> products = new List <EntityProduct>();

            return(ExecuteFaultHandledOperation(() =>
            {
                IEntityProductRepository entity_product_repo = _data_repository_factory.GetDataRepository <IEntityProductRepository>();
                IProductRepository prod_repository = _data_repository_factory.GetDataRepository <IProductRepository>();
                IEnumerable <EntityProductData> entity_prods = entity_product_repo.GetAll();

                foreach (EntityProductData entity_prod in entity_prods)
                {
                    ProductData prod_data = prod_repository.GetByID(entity_prod.ProductKey);
                    products.Add(Map(entity_prod, prod_data));
                }
                return products;
            }));
        }
Пример #3
0
        public List <EntityProduct> GetEntityProductsByEntity(int entity_key, QIQOEntityType entity_type)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                IEntityProductRepository entity_product_repo = _data_repository_factory.GetDataRepository <IEntityProductRepository>();
                IProductRepository product_repo = _data_repository_factory.GetDataRepository <IProductRepository>();
                List <EntityProduct> entity_products = new List <EntityProduct>();

                IEnumerable <EntityProductData> entity_products_data = entity_product_repo.GetAll(entity_key, (int)entity_type);

                foreach (EntityProductData entity_product_data in entity_products_data)
                {
                    ProductData product_data = product_repo.GetByID(entity_product_data.ProductKey);
                    EntityProduct entity_product = Map(entity_product_data, product_data);
                    entity_products.Add(entity_product);
                }
                return entity_products;
            }));
        }