Ejemplo n.º 1
0
        /// <summary>
        /// creates a new PalletProperties object
        /// </summary>
        public void CreateNewPalletUI()
        {
            FormNewPallet form = new FormNewPallet(this);

            if (DialogResult.OK == form.ShowDialog())
            {
                PalletProperties palletProp = CreateNewPallet(form.PalletName, form.Description, form.PalletTypeName
                                                              , form.PalletLength, form.PalletWidth, form.PalletHeight
                                                              , form.Weight);
                palletProp.Color = form.PalletColor;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// creates a new PalletProperties object
        /// </summary>
        public void CreateNewPalletUI()
        {
            FormNewPallet form = new FormNewPallet(this, null);

            if (DialogResult.OK == form.ShowDialog())
            {
                CreateNewPallet(form.ItemName, form.ItemDescription
                                , form.PalletTypeName
                                , form.PalletLength, form.PalletWidth, form.PalletHeight
                                , form.Weight
                                , form.PalletColor);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// creates a new PalletProperties object
 /// </summary>
 public void CreateNewPalletUI()
 {
     FormNewPallet form = new FormNewPallet(this);
     if (DialogResult.OK == form.ShowDialog())
     {
         PalletProperties palletProp = CreateNewPallet(form.PalletName, form.Description, form.PalletTypeName
             , form.PalletLength, form.PalletWidth, form.PalletHeight
             , form.Weight);
         palletProp.Color = form.PalletColor;
     }
 }
Ejemplo n.º 4
0
        // ### AnalysisNodeClicked
        void DocumentTreeView_NodeClicked(object sender, AnalysisTreeViewEventArgs eventArg)
        {
            if ((null == eventArg.ItemBase) && (null != eventArg.Analysis)
                && (null == eventArg.TruckAnalysis) && (null == eventArg.ECTAnalysis))
            {
                CaseOfBoxesProperties caseOfBoxes = eventArg.Analysis.BProperties as CaseOfBoxesProperties;
                if (null != caseOfBoxes)
                    CreateOrActivateViewPalletAnalysisWithBox(eventArg.Analysis);
                else
                    CreateOrActivateViewCasePalletAnalysis(eventArg.Analysis);
            }
            else if ((null == eventArg.ItemBase) && (null == eventArg.Analysis) && (null != eventArg.PackPalletAnalysis)
                && (null == eventArg.CylinderAnalysis) && (null == eventArg.HCylinderAnalysis)
                && (null == eventArg.TruckAnalysis) && (null == eventArg.ECTAnalysis))
            {
                CreateOrActivateViewPackPalletAnalysis(eventArg.PackPalletAnalysis);
            }
            else if ((null == eventArg.ItemBase) && (null == eventArg.Analysis)
                && (null != eventArg.CylinderAnalysis) && (null == eventArg.HCylinderAnalysis)
                && (null == eventArg.TruckAnalysis) && (null == eventArg.ECTAnalysis))
            {
                CreateOrActivateViewCylinderPalletAnalysis(eventArg.CylinderAnalysis);
            }
            else if ((null == eventArg.ItemBase) && (null == eventArg.Analysis)
                && (null == eventArg.CylinderAnalysis) && (null != eventArg.HCylinderAnalysis)
                && (null == eventArg.TruckAnalysis) && (null == eventArg.ECTAnalysis))
            {
                CreateOrActivateViewHCylinderPalletAnalysis(eventArg.HCylinderAnalysis);
            }
            else if (null != eventArg.ItemBase)
            {
                ItemBase itemProp = eventArg.ItemBase;
                if (itemProp.GetType() == typeof(BoxProperties))
                {
                    BoxProperties box = itemProp as BoxProperties;
                    FormNewBox form = new FormNewBox(eventArg.Document, eventArg.ItemBase as BoxProperties);
                    if (DialogResult.OK == form.ShowDialog())
                    {
                        if (!UserAcknowledgeDependancies(box)) return;
                        box.Name = form.BoxName;
                        box.Description = form.Description;
                        box.Length = form.BoxLength;
                        box.Width = form.BoxWidth;
                        box.Height = form.BoxHeight;
                        box.Weight = form.Weight;
                        box.NetWeight = form.NetWeight;
                        box.InsideLength = form.InsideLength;
                        box.InsideWidth = form.InsideWidth;
                        box.InsideHeight = form.InsideHeight;
                        box.SetAllColors(form.Colors);
                        box.TextureList = form.TextureList;
                        box.ShowTape = form.ShowTape;
                        box.TapeWidth = form.TapeWidth;
                        box.TapeColor = form.TapeColor;
                        box.EndUpdate();
                    }
                }
                else if (itemProp.GetType() == typeof(PackProperties))
                {
                    PackProperties pack = itemProp as PackProperties;
                    FormNewPack form = new FormNewPack(eventArg.Document, eventArg.ItemBase as PackProperties);
                    form.Boxes = eventArg.Document.Boxes;

                    if (DialogResult.OK == form.ShowDialog())
                    {
                        if (!UserAcknowledgeDependancies(pack)) return;
                        pack.Name = form.ItemName;
                        pack.Description = form.ItemDescription;
                        pack.Box = form.SelectedBox;
                        pack.BoxOrientation = form.BoxOrientation;
                        pack.Arrangement = form.Arrangement;
                        pack.Wrap = form.Wrapper;
                        if (form.HasForcedOuterDimensions)
                            pack.ForceOuterDimensions(form.OuterDimensions);
                        pack.EndUpdate();
                    }
                }
                else if (itemProp.GetType() == typeof(CylinderProperties))
                {
                    CylinderProperties cylinderProperties = itemProp as CylinderProperties;
                    FormNewCylinder form = new FormNewCylinder(eventArg.Document, cylinderProperties);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        if (!UserAcknowledgeDependancies(cylinderProperties)) return;
                        cylinderProperties.Name = form.CylinderName;
                        cylinderProperties.Description = form.Description;
                        cylinderProperties.RadiusOuter = form.RadiusOuter;
                        cylinderProperties.RadiusInner = form.RadiusInner;
                        cylinderProperties.Height = form.CylinderHeight;
                        cylinderProperties.Weight = form.Weight;
                        cylinderProperties.ColorTop = form.ColorTop;
                        cylinderProperties.ColorWallOuter = form.ColorWallOuter;
                        cylinderProperties.ColorWallInner = form.ColorWallInner;
                        cylinderProperties.EndUpdate();
                    }
                }
                else if (itemProp.GetType() == typeof(CaseOfBoxesProperties))
                {
                    CaseOfBoxesProperties caseOfBoxes = itemProp as CaseOfBoxesProperties;
                    FormNewCaseOfBoxes form = new FormNewCaseOfBoxes(eventArg.Document, caseOfBoxes);
                    form.CaseName = itemProp.Name;
                    form.CaseDescription = itemProp.Description;

                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        if (!UserAcknowledgeDependancies(caseOfBoxes)) return;
                        caseOfBoxes.Name = form.CaseName;
                        caseOfBoxes.Description = form.CaseDescription;
                        caseOfBoxes.SetAllColors(form.Colors);
                        caseOfBoxes.TextureList = form.TextureList;
                        caseOfBoxes.EndUpdate();
                    }
                }
                else if (itemProp.GetType() == typeof(BundleProperties))
                {
                    BundleProperties bundle = itemProp as BundleProperties;
                    FormNewBundle form = new FormNewBundle(eventArg.Document, bundle);
                    if (DialogResult.OK == form.ShowDialog())
                    {
                        if (!UserAcknowledgeDependancies(bundle)) return;
                        bundle.Name = form.BundleName;
                        bundle.Description = form.Description;
                        bundle.Length = form.BundleLength;
                        bundle.Width = form.BundleWidth;
                        bundle.UnitThickness = form.UnitThickness;
                        bundle.UnitWeight = form.UnitWeight;
                        bundle.NoFlats = form.NoFlats;
                        bundle.EndUpdate();
                    }
                }
                else if (itemProp.GetType() == typeof(InterlayerProperties))
                {
                    InterlayerProperties interlayer = itemProp as InterlayerProperties;
                    FormNewInterlayer form = new FormNewInterlayer(eventArg.Document, interlayer);
                    if (DialogResult.OK == form.ShowDialog())
                    {
                        if (!UserAcknowledgeDependancies(interlayer)) return;
                        interlayer.Name = form.InterlayerName;
                        interlayer.Description = form.Description;
                        interlayer.Length = form.InterlayerLength;
                        interlayer.Width = form.InterlayerWidth;
                        interlayer.Thickness = form.Thickness;
                        interlayer.Weight = form.Weight;
                        interlayer.Color = form.Color;
                        interlayer.EndUpdate();
                    }
                }
                else if (itemProp.GetType() == typeof(PalletProperties))
                {
                    PalletProperties pallet = itemProp as PalletProperties;
                    FormNewPallet form = new FormNewPallet(eventArg.Document, pallet);
                    if (DialogResult.OK == form.ShowDialog())
                    {
                        if (!UserAcknowledgeDependancies(pallet)) return;
                        pallet.Name = form.PalletName;
                        pallet.Description = form.Description;
                        pallet.Length = form.PalletLength;
                        pallet.Width = form.PalletWidth;
                        pallet.Height = form.PalletHeight;
                        pallet.Weight = form.Weight;
                        pallet.TypeName = form.PalletTypeName;
                        pallet.Color = form.PalletColor;
                        pallet.EndUpdate();
                    }
                }
                else if (itemProp.GetType() == typeof(TruckProperties))
                {
                    TruckProperties truck = itemProp as TruckProperties;
                    FormNewTruck form = new FormNewTruck(eventArg.Document, truck);
                    if (DialogResult.OK == form.ShowDialog())
                    {
                        if (!UserAcknowledgeDependancies(truck)) return;
                        truck.Name = form.TruckName;
                        truck.Description = form.Description;
                        truck.Length = form.TruckLength;
                        truck.Width = form.TruckWidth;
                        truck.Height = form.TruckHeight;
                        truck.AdmissibleLoadWeight = form.TruckAdmissibleLoadWeight;
                        truck.Color = form.TruckColor;
                        truck.EndUpdate();
                    }
                }
                else if (itemProp.GetType() == typeof(PalletCornerProperties))
                {
                    PalletCornerProperties corner = itemProp as PalletCornerProperties;
                    FormNewPalletCorners form = new FormNewPalletCorners(eventArg.Document, corner);
                    if (DialogResult.OK == form.ShowDialog())
                    {
                        if (!UserAcknowledgeDependancies(corner)) return;
                        corner.Name = form.ItemName;
                        corner.Description = form.ItemDescription;
                        corner.Length = form.CornerLength;
                        corner.Width = form.CornerWidth;
                        corner.Thickness = form.CornerThickness;
                        corner.Color = form.CornerColor;
                        corner.EndUpdate();                    
                    }
                }
                else if (itemProp.GetType() == typeof(PalletCapProperties))
                {
                    PalletCapProperties cap = itemProp as PalletCapProperties;
                    FormNewPalletCap form = new FormNewPalletCap(eventArg.Document, cap);
                    if (DialogResult.OK == form.ShowDialog())
                    {
                        if (!UserAcknowledgeDependancies(cap)) return;
                        cap.Name = form.ItemName;
                        cap.Description = form.ItemDescription;
                        cap.Color = form.CapColor;
                        cap.Length = form.CapLength;
                        cap.Width = form.CapWidth;
                        cap.Height = form.CapHeight;
                        cap.InsideLength = form.CapInnerLength;
                        cap.InsideWidth = form.CapInnerWidth;
                        cap.InsideHeight = form.CapInnerHeight;
                        cap.EndUpdate();
                    }
                }
                else if (itemProp.GetType() == typeof(PalletFilmProperties))
                {
                    PalletFilmProperties film = itemProp as PalletFilmProperties;
                    FormNewPalletFilm form = new FormNewPalletFilm(eventArg.Document, film);
                    if (DialogResult.OK == form.ShowDialog())
                    {
                        film.Name = form.ItemName;
                        film.Description = form.ItemDescription;
                        film.UseTransparency = form.UseTransparency;
                        film.UseHatching = form.UseHatching;
                        film.HatchSpacing = form.HatchSpacing;
                        film.HatchAngle = form.HatchAngle;
                        film.Color = form.FilmColor;
                        film.EndUpdate();
                    }
                }
                else
                    Debug.Assert(false);
            }
            else if ((null == eventArg.ItemBase) && (null != eventArg.BoxCasePalletAnalysis))
            {
                BoxCasePalletAnalysis caseAnalysis = eventArg.BoxCasePalletAnalysis;
                if (null != caseAnalysis)
                    CreateOrActivateViewCaseAnalysis(caseAnalysis);
            }
            else if (null != eventArg.BoxCaseAnalysis)
            {
                BoxCaseAnalysis boxCaseAnalysis = eventArg.BoxCaseAnalysis;
                if (null != boxCaseAnalysis)
                    CreateOrActivateViewBoxCaseAnalysis(boxCaseAnalysis);
            }
            else if (null != eventArg.TruckAnalysis)
            {
                TruckAnalysis truckAnalysis = eventArg.TruckAnalysis;
                if (null != truckAnalysis)
                    CreateOrActivateViewTruckAnalysis(truckAnalysis);
            }
            else if (null != eventArg.ECTAnalysis)
            {
                ECTAnalysis ectAnalysis = eventArg.ECTAnalysis;
                if (null != ectAnalysis)
                    CreateOrActivateViewECTAnalysis(ectAnalysis);
            }
        }