Ejemplo n.º 1
0
        private void OpenScanOfflineForm(out bool isOk)
        {
            var scanOfflineForm = new ScanOfflineForm(ProductIDTxt.Text.Trim(), _staffId, _staffCode, _staffName)
            {
                ChangeBgColor = () =>
                                ProductionStatusInfoPanel.Controls.
                                Find("control003", false).First().BackColor = Color.MediumSeaGreen,
                ClearMainPanelTxt = () =>
                {
                    ProductIDTxt.Clear();
                    CurrentProcessTxt.Clear();
                    ProductNameTxt.Clear();
                    QCTimeTxt.Clear();
                },
                RegetProcedureTasksDetails = () =>
                {
                    InitialDidTasks();
                    InialToDoTasks();
                },
                ResetProductPhoto = () =>
                {
                    BeginInvoke(new Action((() => ProductInfo.Image = null)));
                }
            };
            var controls = scanOfflineForm.Controls.Find("lblTitle", false).First();

            controls.Visible                = false;
            scanOfflineForm.Location        = new Point(panel10.Width / 2 - scanOfflineForm.Width / 2, 0);
            scanOfflineForm.FormBorderStyle = FormBorderStyle.None;
            scanOfflineForm.AutoSize        = false;
            scanOfflineForm.AutoScaleMode   = AutoScaleMode.None;
            scanOfflineForm.Size            = new Size(553, panel10.Height);
            scanOfflineForm.AutoScaleMode   = AutoScaleMode.Font;
            scanOfflineForm.TopLevel        = false;
            scanOfflineForm.BackColor       = Color.FromArgb(247, 247, 247);
            scanOfflineForm.ForeColor       = Color.FromArgb(66, 66, 66);
            panel10.Controls.Add(scanOfflineForm);
            scanOfflineForm.Show();
            isOk = true;
        }
Ejemplo n.º 2
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();
            }
        }
Ejemplo n.º 3
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();
            }
        }
Ejemplo n.º 4
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;

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

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

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

                var dataGridViewRow = ucDataGridView2.SelectRow;
                var dataSource      = dataGridViewRow.DataSource;
                if (dataSource is APS_ProcedureTaskDetail apsProcedureTaskDetail)
                {
                    var dialogResult = FrmDialog.ShowDialog(this, $"确定上线选中产品[{apsProcedureTaskDetail.ProductBornCode}]吗", "热压上线", true);
                    if (dialogResult == DialogResult.OK)
                    {
                        var scanOnlineForm = new ScanOnlineForm(_staffId, _staffCode, _staffName, apsProcedureTaskDetail.ProductBornCode, _workshopId, _workshopCode, _workshopName, _equipmentId, _equipmentCode, _equipmentName)
                        {
                            DisplayInfoToMainPanel = (s1, s2, s3, s4) =>
                            {
                                ProductIDTxt.Text      = s1;
                                ProductNameTxt.Text    = s2;
                                CurrentProcessTxt.Text = s3;
                                OnlineTimeTxt.Text     = s4;
                            },
                            ChangeBgColor = () =>
                            {
                                ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor =
                                    Color.MediumSeaGreen;
                                ProductionStatusInfoPanel.Controls.Find("control002", false).First().BackColor =
                                    Color.LightSlateGray;
                            }
                        };

                        if (scanOnlineForm.CheckTaskValidity(apsProcedureTaskDetail.ProcedureCode))
                        {
                            //判断机加工任务是否全部完成
                            var doneMachiningOrNot = DoneMachiningOrNot(apsProcedureTaskDetail);
                            if (!doneMachiningOrNot)
                            {
                                FrmDialog.ShowDialog(this, "尚有机加工环节未执行,请先执行机加工任务!");
                                return;
                            }
                            scanOnlineForm.AddCntLogicPro();
                            //先判断一下本产品出生证的有没有待检验的前序质检任务没做
                            // var hasSelfQcTask = scanOnlineForm.HasSelfQcTask();

                            //转档  工序任务明细表=>产品加工过程表
                            scanOnlineForm.ProcessTurnArchives();
                            //完善工序任务明细表中的数据 诸如任务状态 ; 修改人修改时间
                            scanOnlineForm.PerfectApsDetail();
                            //完善计划产品出生证表
                            // scanOnlineForm.PerfectPlanProductInfo();
                            //转档
                            scanOnlineForm.CntLogicTurn();
                            FrmDialog.ShowDialog(this, $"产品{ProductIDTxt.Text}热压上线成功!", "热压上线成功");

                            InialToDoTasks();
                        }
                    }
                }
            }
            else
            {
                ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor =
                    Color.MediumSeaGreen;
            }
        }