public virtual void Copy(ProductPartSheetArticle to)
        {
            //All properties of object
            //and pointer of sons


        }
Exemple #2
0
        public override void InitProduct()
        {
            base.InitProduct();

            var cover = new ProductPartCoverSheet();
            cover.ProductPartTasks = this.GetInitalizedPartTask();
            cover.ProductPartName = "";
            cover.WidthWings = 0;
            cover.Back = 0;

            Type t = typeof(PapiroMVC.Models.Resources.Products.ResProductPart);
            cover.ProductPartName = (string)t.GetProperty(cover.TypeOfProductPart.ToString()).GetValue(null, null);

            ProductPartTask partTask;
            partTask = cover.ProductPartTasks.First(x => x.CodOptionTypeOfTask == "STAMPAOFFeDIGITALE_NO");
            partTask.Hidden = false;
            partTask.IndexOf = 1;

            partTask = cover.ProductPartTasks.First(x => x.CodOptionTypeOfTask == "PLASTIFICATURA_NO");
            partTask.Hidden = false;
            partTask.IndexOf = 2;

            ProductPartSheetArticle material = new ProductPartSheetArticle();

            cover.ProductPartPrintableArticles.Add(material);
            ProductParts.Add(cover);

            //-------------------------------------------------------------------------------------------

            var intern = new ProductPartBookSheet();
            intern.ProductPartTasks = this.GetInitalizedPartTask();

            partTask = intern.ProductPartTasks.First(x => x.CodOptionTypeOfTask == "STAMPAOFFeDIGITALE_NO");
            partTask.Hidden = false;
            partTask.IndexOf = 1;

            material = new ProductPartSheetArticle();

            intern.ProductPartPrintableArticles.Add(material);
            ProductParts.Add(intern);

            //descrizone che poi andrà nei costi per identificare la parte!
            intern.ProductPartName = (string)t.GetProperty(intern.TypeOfProductPart.ToString()).GetValue(null, null);
            intern.ProductPartName += " 1";

        }
        public override void InitProduct()
        {
            base.InitProduct();

            var p = new ProductPartSheetArticle();
            var part = new ProductPartSingleSheet();

            part.DCut = DCut;

            part.DCut1 = DCut1;
            part.DCut2 = DCut2;

            part.ShowDCut = ShowDCut;
            part.IsDCut = ShowDCut;

            part.ProductPartTasks = this.GetInitalizedPartTask();

            ProductPartTask partTask;

            partTask = part.ProductPartTasks.First(x => x.CodOptionTypeOfTask == "STAMPANEW_NO");
            partTask.Hidden = false;
            partTask.ImplantHidden = false;
            partTask.IndexOf = 1;

            partTask.CodItemGraph = "ST";

            partTask = part.ProductPartTasks.First(x => x.CodOptionTypeOfTask == "PLASTIFICATURA_NO");
            partTask.Hidden = false;
            partTask.ImplantHidden = true;
            partTask.IndexOf = 10;

            partTask.CodItemGraph = "PL";

            if (CodMenuProduct.Contains("Sago"))
            {
                partTask = part.ProductPartTasks.First(x => x.CodOptionTypeOfTask == "FUSTELLATURA_SI");
                partTask.Hidden = false;
                partTask.ImplantHidden = null; //impant is visibile only if task is visibile
                partTask.IndexOf = 20;

                partTask.CodItemGraph = "FS";

                partTask = part.ProductPartTasks.First(x => x.CodOptionTypeOfTask == "TAGLIO_NO");
                partTask.Hidden = true;
                partTask.ImplantHidden = true;
                partTask.IndexOf = 30;

                partTask.CodItemGraph = "TG";

            }
            else
            {
                partTask = part.ProductPartTasks.First(x => x.CodOptionTypeOfTask == "FUSTELLATURA_NO");
                partTask.Hidden = true;
                partTask.ImplantHidden = null; //impant is visibile only if task is visibile
                partTask.IndexOf = 20;

                partTask.CodItemGraph = "FS";

                partTask = part.ProductPartTasks.First(x => x.CodOptionTypeOfTask == "TAGLIO_AL_VIVO");
                partTask.Hidden = false;
                partTask.ImplantHidden = true; //impant is visibile only if task is visibile
                partTask.IndexOf = 20;

                partTask.CodItemGraph = "TG";
            }



            part.ProductPartPrintableArticles.Add(p);
            ProductParts.Add(part);

            //grafo diretto del prodotto
            ProductGraphLinks.Clear();

            ProductGraphLinks.Add(new ProductGraphLink { CodItemGraph = "ST", CodItemGraphLink = "PL" });
            ProductGraphLinks.Add(new ProductGraphLink { CodItemGraph = "PL", CodItemGraphLink = "FS" });
            ProductGraphLinks.Add(new ProductGraphLink { CodItemGraph = "FS", CodItemGraphLink = "TG" });

        }