Esempio n. 1
0
        public ProductController(IProductRepository _productRepository,
            ITypeOfTaskRepository _typeOfTaskRepository,
            IMenuProductRepository _menuProduct,
            IProductTaskNameRepository _productTaskName,
            IFormatsNameRepository _formatsName,
            IDocumentRepository _documentRepository,
            IArticleRepository _articleRepository,
            ICostDetailRepository _costDetailRepository,
            ITaskExecutorRepository _taskExecuteRepository,
            ICustomerSupplierRepository _customerSupplierRepository,
            IWarehouseRepository _warehouseRepository

            )
        {
            formatsRepository = _formatsName;
            prodTskNameRepository = _productTaskName;
            menu = _menuProduct;
            typeOfTaskRepository = _typeOfTaskRepository;
            productRepository = _productRepository;
            documentRepository = _documentRepository;
            articleRepository = _articleRepository;
            costDetailRepository = _costDetailRepository;
            taskExecuteRepository = _taskExecuteRepository;
            customerSupplierRepository = _customerSupplierRepository;
            warehouseRepository = _warehouseRepository;

            this.Disposables.Add(typeOfTaskRepository);
            this.Disposables.Add(documentRepository);
            this.Disposables.Add(productRepository);
            this.Disposables.Add(formatsRepository);
            this.Disposables.Add(articleRepository);
            this.Disposables.Add(prodTskNameRepository);
            this.Disposables.Add(costDetailRepository);
            this.Disposables.Add(taskExecuteRepository);
            this.Disposables.Add(customerSupplierRepository);

            this.Disposables.Add(menu);
        }
Esempio n. 2
0
        /// <summary>
        /// returns Product initialization by id
        /// </summary>
        /// <param name="id"></param>
        /// <param name="prodTskNameRepository"></param>
        /// <param name="formatsRepository"></param>
        /// <param name="typeOfTaskRepository"></param>
        /// <returns></returns>
        public Product InitProduct(string id, IProductTaskNameRepository prodTskNameRepository, IFormatsNameRepository formatsRepository, ITypeOfTaskRepository typeOfTaskRepository)
        {

            Product product;
            product = new ProductEmpty();

            if (id == "Buste" ||
                id == "Volantini" ||
                id == "Pieghevoli" ||
                id == "EtichetteCartellini" ||
                id == "CartaIntestata" ||
                id == "Locandine" ||
                id == "FogliMacchina")
            {
                product = new ProductSingleSheet();
            }

            if (
                id == "BigliettiVisita" ||
                id == "EtichetteCartelliniSago" ||
                id == "CartolineInviti" ||
                id == "CartolinePostali" ||
                id == "AltriFormati")
            {
                product = new ProductSingleSheet();
                product.ShowDCut = true;
                //                product.DCut = 0.5;
                product.DCut1 = 0.5;
                product.DCut2 = 0.5;
            }

            if (id == "PuntoMetallico" ||
                id == "SpiraleMetallica" ||
                id == "BrossuraFresata" ||
                id == "BrossuraCucitaFilo" ||
                id == "RivistePostalizzazione" ||
                id == "SchedeNonRilegate")
            {
                product = new ProductBookSheet();
            }

            if (
                id == "Fotoquadri" ||
                id == "SuppRigidi")
            {
                product = new ProductRigid();
                product.ShowDCut = true;
                product.DCut = 0;
                product.DCut1 = 1;
                product.DCut2 = 1;

            }

            if (
                id == "PVC" ||
                id == "Manifesti" ||
                id == "Striscioni" ||
                id == "Poster")
            {
                product = new ProductSoft();
            }

            if (
                id == "EtichetteRotolo" ||
                id == "EtichetteSagRotolo" ||
                id.StartsWith("FasceGommateRotolo"))
            {
                product = new ProductSingleLabelRoll();
            }

            if (
                id == "EtichetteRotoloDouble")
            {
                product = new ProductDoubleLabelRoll();
            }

            product.CodMenuProduct = id;
            product.ProductTaskName = prodTskNameRepository.GetAllById(id);
            product.FormatsName = formatsRepository.GetAllById(id);

            product.SystemTaskList = typeOfTaskRepository.GetAll().ToList();

            product.ProductNameGenerator = ProductRepository.GetProductNameGenerator(id).Generator;
            product.InitProduct();

            return product;

        }