Beispiel #1
0
        private void ItemClick(object sender, EventArgs e)
        {
            if (sender is ucWorkUnit)
            {
                ucWorkUnit workUnit = sender as ucWorkUnit;

                if (workUnit.Station.T102LeafID_InProduction != 0)
                {
                    using (formMDVO = new frmShowMDVO(stationUser))
                    {
                        try
                        {
                            timer.Enabled        = false;
                            formMDVO.WindowState = FormWindowState.Maximized;
                            Application.DoEvents();
                            formMDVO.WorkUnit = workUnit.Station.Clone();

                            formMDVO.ShowDialog();
                        }
                        finally
                        {
                            timer_Tick(this, null);
                        }
                    }
                }
            }
        }
Beispiel #2
0
        private void GenerateTileButtons(List <WIPStationProductionStatus> workUnits)
        {
            if (buttons.Count == 0)
            {
                int intButtonWidth = 0;
                int intButtonTop   = 0;
                int intButtonLeft  = 0;

                for (int i = 0; i < workUnits.Count; i++)
                {
                    WIPStationProductionStatus station = workUnits[i].Clone();
                    ucWorkUnit button = new ucWorkUnit();

                    if (intButtonWidth == 0)
                    {
                        intButtonWidth =
                            button.Width *
                            workUnits.Count +
                            widthButtonSplitter *
                            (workUnits.Count - 1);
                        intButtonTop =
                            (xtraScrollableControl.Height - button.Height) / 2;
                        intButtonLeft =
                            (xtraScrollableControl.Width - intButtonWidth) / 2;
                        if (intButtonLeft < 0)
                        {
                            intButtonLeft = 0;
                        }
                    }

                    button.Top  = intButtonTop;
                    button.Left = intButtonLeft + (button.Width + widthButtonSplitter) * i;

                    button.Station         = station;
                    button.Parent          = xtraScrollableControl;
                    button.MouseLeftClick += new EventHandler(ItemClick);

                    buttons.Add(button);
                }
            }
            else
            {
                for (int i = 0; i < workUnits.Count; i++)
                {
                    if (i >= buttons.Count)
                    {
                        break;
                    }
                    buttons[i].Station = workUnits[i].Clone();
                }
            }
        }