Beispiel #1
0
        protected void OnOpenProject(object sender, EventArgs e)
        {
            // get selected file name
            var    dimCase = Vector3D.Zero;
            double weightCase = 0.0;
            var    dimPallet = Vector3D.Zero;
            double weightPallet = 0.0;
            bool   MirrorX = false, MirrorY = false;
            int    numberOfLayers = 0;
            List <BoxPositionIndexed> boxPositions = new List <BoxPositionIndexed>();
            List <bool> interlayers     = new List <bool>();
            int         layerDesignMode = 0;

            string filePath = DropDownListFiles.SelectedValue;

            byte[] fileContent = null;
            FtpHelpers.Download(ref fileContent, ConfigSettings.FtpDirectory, filePath, ConfigSettings.FtpUsername, ConfigSettings.FtpPassword);
            ExporterCSV_TechBSA.Import(new MemoryStream(fileContent),
                                       ref boxPositions,
                                       ref dimCase, ref weightCase,
                                       ref dimPallet, ref weightPallet,
                                       ref numberOfLayers,
                                       ref MirrorX, ref MirrorY,
                                       ref interlayers,
                                       ref layerDesignMode);

            DimCase         = dimCase; WeightCase = weightCase;
            PalletIndex     = 0; WeightPallet = weightPallet;
            NumberOfLayers  = numberOfLayers;
            BoxPositions    = boxPositions;
            LayersMirrorX   = MirrorX;
            LayersMirrorY   = MirrorY;
            LayerEdited     = true;
            FileName        = filePath;
            Interlayers     = string.Concat(interlayers.Select(p => p ? "1" : "0").ToArray());
            LayerDesignMode = layerDesignMode;

            if (ConfigSettings.WebGLMode)
            {
                Response.Redirect("ValidationWebGL.aspx");
            }
            else
            {
                Response.Redirect("Validation.aspx");
            }
        }
Beispiel #2
0
        protected void OnOpenProject(object sender, EventArgs e)
        {
            // get selected file name
            var    dimCase = Vector3D.Zero;
            double weightCase = 0.0;
            var    dimPallet = Vector3D.Zero;
            double weightPallet = 0.0;
            bool   MirrorX = false, MirrorY = false;
            int    numberOfLayers = 0;
            List <BoxPositionIndexed> boxPositions = new List <BoxPositionIndexed>();
            List <bool> interlayers = new List <bool>();

            string filePath = DropDownListFiles.SelectedValue;

            byte[] fileContent = null;
            FtpHelpers.Download(ref fileContent, ConfigSettings.FtpDirectory, filePath, ConfigSettings.FtpUsername, ConfigSettings.FtpPassword);
            ExporterCSV_TechBSA.Import(new MemoryStream(fileContent),
                                       ref boxPositions,
                                       ref dimCase, ref weightCase,
                                       ref dimPallet, ref weightPallet,
                                       ref numberOfLayers,
                                       ref MirrorX, ref MirrorY,
                                       ref interlayers);

            string queryString = string.Empty;

            if (ConfigSettings.UseSessionState)
            {
                DimCase        = dimCase; WeightCase = weightCase;
                PalletIndex    = 0; WeightPallet = weightPallet;
                NumberOfLayers = numberOfLayers;
                BoxPositions   = boxPositions;
                LayersMirrorX  = MirrorX;
                LayersMirrorY  = MirrorY;
                LayerEdited    = true;
                FileName       = filePath;
                Interlayers    = string.Concat(interlayers.Select(p => p ? "1" : "0").ToArray());;
            }
            else
            {
                string interlayerArray  = string.Concat(interlayers.Select(p => p ? "1" : "0").ToArray());
                string fileBoxPositions = string.Empty;

                StringBuilder sb = new StringBuilder();
                sb.Append(" ? ");
                sb.Append($"DimCase={dimCase}");
                sb.Append($"WeightCase={weightCase}");
                sb.Append($"&DimPallet={dimPallet}");
                sb.Append($"&WeightPallet={weightPallet}");
                sb.Append($"&NumberOfLayers={numberOfLayers}");
                sb.Append($"&BoxPositionsFile={fileBoxPositions}");
                sb.Append($"&LayerMirrorX={MirrorX}");
                sb.Append($"&LayerMirrorY={MirrorY}");
                sb.Append($"LayerEdited={true}");
                sb.Append($"FileName={filePath}");
                sb.Append($"Interlayers={interlayerArray}");

                queryString = sb.ToString();
            }

            if (ConfigSettings.WebGLMode)
            {
                Response.Redirect("ValidationWebGL.aspx" + queryString);
            }
            else
            {
                Response.Redirect("Validation.aspx" + queryString);
            }
        }