예제 #1
0
파일: Proiection.cs 프로젝트: algola/backup
        public static void ResolveProjection(ProductRigidApi from,  ProductRigid to)
        {

            var part = to.ProductParts.FirstOrDefault();
            var material = part.ProductPartPrintableArticles.FirstOrDefault();

            to.Format = from.Format;
            material.TypeOfMaterial = from.TypeOfMaterial;
            material.NameOfMaterial = from.NameOfMaterial;
            material.Color = from.Color;
            material.Weight = from.Weight;

        }
예제 #2
0
파일: Proiection.cs 프로젝트: algola/backup
        /// <summary>
        /// 
        /// </summary>
        /// <param name="from"></param>
        /// <param name="to"></param>
        public  static void MakeProjection(ProductRigid from, ProductRigidApi to)
        {
            
            var part = from.ProductParts.FirstOrDefault();
            var material = part.ProductPartPrintableArticles.FirstOrDefault();

            to.Format = from.Format;
            to.TypeOfMaterial = material.TypeOfMaterial;
            to.NameOfMaterial = material.NameOfMaterial;
            to.Color = material.Color;
            to.Weight = material.Weight;

        }
예제 #3
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;

        }
예제 #4
0
        public virtual void Copy(ProductRigid to)
        {
            //All properties of object
            //and pointer of sons
            to.Format = this.Format;

        }