private void ProductOnlineEvent(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; var exitProductTask = HasExitProductTask(); if (!exitProductTask) { ProductNameTxt.Clear(); ProductIDTxt.Clear(); CurrentProcessTxt.Clear(); OnlineTimeTxt.Clear(); var scanOnlineForm = new ScanOnlineForm(_staffId, _staffCode, _staffName) { 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; }, RegetProcedureTasksDetails = InialToDoTasks, ClearMainPanelTxt = () => { ProductIDTxt.Clear(); ProductIDTxt.ReadOnly = false; ProductNameTxt.Clear(); ProductNameTxt.ReadOnly = false; CurrentProcessTxt.Clear(); CurrentProcessTxt.ReadOnly = false; OnlineTimeTxt.Clear(); OnlineTimeTxt.ReadOnly = false; ProductionStatusInfoPanel.Controls.Find("control001", false).First().BackColor = Color.LightSlateGray; } }; 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; } }
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; } }