示例#1
0
        private void BeginQcEvent(object sender, EventArgs e)
        {
            var find = panel10.Controls.Find("scanOnlineForm", false);

            if (find.Any())
            {
                return;
            }
            ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor =
                Color.LightSlateGray;
            ProductionStatusInfoPanel.Controls.Find("control002", false).First().BackColor =
                Color.LightSlateGray;
            ProductionStatusInfoPanel.Controls.Find("control003", false).First().BackColor =
                Color.LightSlateGray;
            var exitProductTask = HasExitProductTask();

            if (!exitProductTask)
            {
                ProductNameTxt.Clear();
                ProductIDTxt.Clear();
                CurrentProcessTxt.Clear();
                QCTimeTxt.Clear();
                var scanOnlineForm = new ScanOnlineForm(_staffId, _staffCode, _staffName)
                {
                    DisplayInfoToMainPanel = (s1, s2, s3, s4) =>
                    {
                        ProductIDTxt.Text      = s1;
                        ProductNameTxt.Text    = s2;
                        CurrentProcessTxt.Text = s3;
                        QCTimeTxt.Text         = s4;
                    },
                    ChangeBgColor = () =>
                    {
                        ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor =
                            Color.MediumSeaGreen;
                        ProductionStatusInfoPanel.Controls.Find("control002", false).First().BackColor =
                            Color.LightSlateGray;
                        ProductionStatusInfoPanel.Controls.Find("control003", false).First().BackColor =
                            Color.LightSlateGray;
                    },
                    RegetProcedureTasksDetails = () =>
                    {
                        InialToDoTasks();
                    }
                };
                var controls = scanOnlineForm.Controls.Find("lblTitle", false).First();
                controls.Visible               = false;
                scanOnlineForm.Location        = new Point(panel10.Width / 2 - scanOnlineForm.Width / 2, 0);
                scanOnlineForm.FormBorderStyle = FormBorderStyle.None;
                scanOnlineForm.AutoSize        = false;
                scanOnlineForm.AutoScaleMode   = AutoScaleMode.None;
                scanOnlineForm.Size            = new Size(553, panel10.Height);
                scanOnlineForm.AutoScaleMode   = AutoScaleMode.Font;
                scanOnlineForm.TopLevel        = false;
                scanOnlineForm.BackColor       = Color.FromArgb(247, 247, 247);
                scanOnlineForm.ForeColor       = Color.FromArgb(66, 66, 66);
                panel10.Controls.Add(scanOnlineForm);
                scanOnlineForm.Show();
            }
            else
            {
                ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor =
                    Color.MediumSeaGreen;
                ReportUploadJudge();
            }
        }
示例#2
0
        private void UcDataGridView2_ItemClick(object sender, DataGridViewEventArgs e)
        {
            ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor =
                Color.LightSlateGray;
            ProductionStatusInfoPanel.Controls.Find("control002", false).First().BackColor =
                Color.LightSlateGray;
            ProductionStatusInfoPanel.Controls.Find("control003", false).First().BackColor =
                Color.LightSlateGray;

            var controls = panel10.Controls.Find("scanOnlineForm", false);

            if (controls.Any())
            {
                controls[0].Dispose();
            }

            if (!HasExitProductTask())
            {
                ProductNameTxt.Clear();
                ProductIDTxt.Clear();
                CurrentProcessTxt.Clear();
                QCTimeTxt.Clear();

                var dataGridViewRow = ucDataGridView2.SelectRow;
                var dataSource      = dataGridViewRow.DataSource;
                if (dataSource is C_CheckTask checktask)
                {
                    var dialogResult = FrmDialog.ShowDialog(this, $"确定上线选中产品[{checktask.ProductBornCode}]吗", "手检上线", true);
                    if (dialogResult == DialogResult.OK)
                    {
                        if (!DoneAllThreeCoordinate(checktask.ProductBornCode))
                        {
                            FrmDialog.ShowDialog(this, "该产品尚有三坐标质检任务未完成,请先完成!");
                            return;
                        }
                        var scanOnlineForm = new ScanOnlineForm(_staffId, _staffCode, _staffName,
                                                                checktask.ProductBornCode, _workshopId, _workshopCode, _workshopName, _equipmentId,
                                                                _equipmentCode, _equipmentName)
                        {
                            DisplayInfoToMainPanel = (s1, s2, s3, s4) =>
                            {
                                ProductIDTxt.Text      = s1;
                                ProductNameTxt.Text    = s2;
                                CurrentProcessTxt.Text = s3;
                                QCTimeTxt.Text         = s4;
                            },
                            ChangeBgColor = () =>
                            {
                                ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor =
                                    Color.MediumSeaGreen;
                                ProductionStatusInfoPanel.Controls.Find("control002", false).First().BackColor =
                                    Color.LightSlateGray;
                                ProductionStatusInfoPanel.Controls.Find("control003", false).First().BackColor =
                                    Color.LightSlateGray;
                            }
                        };
                        if (scanOnlineForm.CheckTaskValidity(checktask.ProcedureCode))
                        {
                            scanOnlineForm.AddCntLogicPro(checktask.ProcedureCode);
                            {
                                //操作人员确认
                                if (scanOnlineForm.WorkerConfirm())
                                {
                                    //转档  检验任务表=>检验过程表
                                    scanOnlineForm.CheckProcessTurnArchives();
                                    //完善检验任务表 诸如任务状态 ; 修改人修改时间
                                    scanOnlineForm.PerfectCheckTask();
                                    //控制点转档
                                    scanOnlineForm.CntLogicTurn();
                                    InialToDoTasks();
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor =
                    Color.MediumSeaGreen;
                ReportUploadJudge();
            }
        }