Exemple #1
0
        private void LoadUserControlProcesss()
        {
            int lineId = 0;

            if (!string.IsNullOrEmpty(LineName))
            {
                lineId = _lineService.GetLineByName(LineName).Id_line;
            }
            var processPanels      = new List <ProcessControl>();
            var getProcessByLineId = _processService.GetAllProcesseses(lineId);

            for (int i = 0; i < getProcessByLineId.Count; i++)
            {
                var    processes    = getProcessByLineId.ElementAtOrDefault(i);
                var    processFirst = getProcessByLineId.ElementAtOrDefault(i - 1);
                var    mp           = new ProcessControl();
                string processName  = null;
                int    x            = 209;
                int    y            = 32;

                if (processes != null)
                {
                    processName = processes.Id_process;
                    processPanels.Add(mp);
                    mp.ProcessName = processName;
                    mp.Name        = "Panel" + processName + i;
                    mp.Location    = new Point(x * i, y);
                }

                if (processFirst != null)
                {
                    ////mp.Location = new Point(209 * (i - 1), 32);
                    //mp.Location = new Point(x * i, y);
                    if (processName == processFirst.Id_process)
                    {
                        //this.Size = new Size(900, 170*i);
                        mp.Location = new Point(x * (i - 1), y);
                        //mp.Location = new Point(x * i, y);
                        //mp.Location = new Point(x * (i-2), y);
                    }
                    else
                    {
                        mp.Location = new Point(x * (i - 1), y);
                        //mp.Location = new Point(x * i, y);
                    }
                }

                processPanels.Add(mp);
            }

            foreach (var p in processPanels)
            {
                panelControl1.SuspendLayout();
                panelControl1.Controls.Add(p);
                panelControl1.ResumeLayout();
            }
        }
Exemple #2
0
        private void LoadUserControlProcesss()
        {
            int lineId = 0;
            if (!string.IsNullOrEmpty(LineName))
            {
                lineId = _lineService.GetLineByName(LineName).Id_line;
            }
            var processPanels = new List<ProcessControl>();
            var getProcessByLineId = _processService.GetAllProcesseses(lineId);
            for (int i = 0; i < getProcessByLineId.Count; i++)
            {
                var processes = getProcessByLineId.ElementAtOrDefault(i);
                var processFirst = getProcessByLineId.ElementAtOrDefault(i - 1);
                var mp = new ProcessControl();
                string processName = null;
                int x = 209;
                int y = 32;
                 
                if (processes != null)
                {
                    processName = processes.Id_process;
                    processPanels.Add(mp);
                    mp.ProcessName = processName;
                    mp.Name = "Panel" + processName + i;
                    mp.Location = new Point(x*i, y);
                }

                if (processFirst != null)
                {
                    ////mp.Location = new Point(209 * (i - 1), 32);
                    //mp.Location = new Point(x * i, y);
                    if (processName == processFirst.Id_process)
                    {
                        //this.Size = new Size(900, 170*i);
                        mp.Location = new Point(x * (i - 1), y);
                        //mp.Location = new Point(x * i, y);
                        //mp.Location = new Point(x * (i-2), y);
                    }
                    else
                    {
                        mp.Location = new Point(x * (i - 1), y);
                        //mp.Location = new Point(x * i, y);
                    }
                }

                processPanels.Add(mp);
            }

            foreach (var p in processPanels)
            {
                panelControl1.SuspendLayout();
                panelControl1.Controls.Add(p);
                panelControl1.ResumeLayout();
            }
        }