Пример #1
0
 public ProductService(IProductEntity entity, IKindEntity kindEntity, ISupplierEntity supplierEntity, IProductSupplierEntity productSupplierEntity)
 {
     Entity                = entity;
     KindEntity            = kindEntity;
     SupplierEntity        = supplierEntity;
     ProductSupplierEntity = productSupplierEntity;
 }
Пример #2
0
        public Product Convert(IProductEntity productEntity, OnObjectCreation onObjectCreation)
        {
            List <Tag>   tags   = new List <Tag>();
            List <Stock> stocks = new List <Stock>();
            //compose product
            Product product = new Product(productEntity.Id
                                          , productEntity.Name
                                          , productEntity.Price
                                          , productEntity.Sku, tags, stocks);

            // handle instantiated products. Needed by repository to prevent looping.
            onObjectCreation(product, productEntity);

            // gather child objects: tags
            foreach (ProductTagEntity productTagEntity in productEntity.ProductTagEntities)
            {
                Tag tag = repositoryFactory.TagsRepository.Get(productTagEntity.TagId);
                tags.Add(tag);
            }

            // gather child objects: stocks
            foreach (StockEntity stockEntity in productEntity.StockEntities)
            {
                Stock stock = repositoryFactory.StocksRepository.Get(stockEntity.Id);
                stocks.Add(stock);
            }


            return(product);
        }
Пример #3
0
 public SearchService(IUserEntity entity,IProductEntity product, ICategoryEntity category, IArticleEntity articel, IManufacturerEntity fac, IExamineeEntity exc )
 {
     this.entity = entity;
        this.Productentity = product;
        this.Categoryenity = category;
        this.Articelenity = articel;
        this.ManuFacenity = fac;
        this.ExamineeEntity = exc;
 }
Пример #4
0
 public ProductService(IProductEntity entity,IModelEntity modelentity, IProductTypeEntity producttype,
     IManufacturerEntity manufacturer, ICategoryEntity category)
 {
     this.entity = entity;
        this.modelentity = modelentity;
        this.productentity = producttype;
        this.menufacturerentity = manufacturer;
        this.categoryentity = category;
     //bat 1 tien trinh check hang ton kho/thoi han khuyen mai
 }
Пример #5
0
 // Handle cacheing of object on instantiation
 private void OnObjectCreation(Product product, IProductEntity productEntity)
 {
     productCache.Add(product, productEntity);
 }
Пример #6
0
 public ProductModel(IProductEntity productEntity)
 {
     _productEntity = productEntity;
 }