private void Worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { MainForm mf = this.MdiParent as MainForm; string path = $"WInServerTask{ti.taskID.Replace("task", "")}.exe"; int task_proc_id = 0; try { Process proc = Process.Start(path, $"{ti.taskID} {ti.hostIP} {ti.hostPort} {dr["PRODUCT_ID"]} {dr["PRODUCT_TACT_TIME"]}"); // 던질 파라미터 proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; task_proc_id = proc.Id; } catch (Exception err) { foreach (var process in Process.GetProcesses()) { if (process.ProcessName == path) { process.Kill(); } } MessageBox.Show(err.Message); } frmATLTask frm = new frmATLTask(ti.taskID, ti.hostIP, ti.hostPort, workOrderNo); frm.Show(); frm.Hide(); mf.popList.Add(new POPItem { TaskID = ti.taskID, Task_proc_id = task_proc_id, Worker = worker, Frm = frm, Work_order_no = Convert.ToInt32(dr["WORK_ORDER_NO"]), Employee_name = dr["EMPLOYEE_NAME"].ToString(), Product_name = dr["PRODUCT_NAME"].ToString(), Qty = Convert.ToInt32(dr["QTY"]), Process_name = dr["PROCESS_NAME"].ToString() }); PopForm popFrm = (this.MdiParent as MainForm).popFrm; if (popFrm != null) { frm.ReadData += popFrm.ReadDataDisplay; } }
private void pOPToolStripMenuItem_Click(object sender, EventArgs e) { if (popFrm == null) { popFrm = new PopForm(); popFrm.WindowState = FormWindowState.Maximized; popFrm.MdiParent = this; popFrm.Show(); } else { foreach (Form frm in Application.OpenForms) { if (frm is PopForm) { frm.Activate(); } } } }