private void btn_SupportRequest_Click(object sender, EventArgs e) { String[] ar_SupportRequestCodes = { "SR_Leader", "SR_Material", "SR_MES", "SR_NPI", "SR_Quality", "SR_Sustaining", "SR_Technology", "SR_Testing" }; InputBox_Form myIBF = new InputBox_Form("Support Request", "Vyberte druh podpory, napiste poziadavku a odoslite klikom na OK"); myIBF.ShowDialog(); if (myIBF.SelectedItem != "") { String strWarning = String.Empty; if (this.objBelMes.SendSupportRequest(myIBF.SelectedItem.Trim(), myIBF.Answer, ref strWarning)) { this.lbl_Info.Text = "SupportRequest uspesne poslany."; this.lbl_Info.ForeColor = Color.Green; } else { this.lbl_Info.Text = "SupportRequest poslany."; this.lbl_Info.ForeColor = Color.Red; } } }
private void dgv_SNsIP_CellClick(object sender, DataGridViewCellEventArgs e) { if (this.cb_TestTypes.SelectedIndex == -1) { MessageBox.Show("Najprv zvolte druh testu."); this.cb_TestTypes.Focus(); return; } if ((e.ColumnIndex == 5) && (e.RowIndex == -1) && (this.dgv_SNsIP.Rows.Count > 0)) { if (MessageBox.Show("Naozaj chcete ukoncit vsetky vyrobky zo zoznamu s vysledkom PASS?", "Hromadne ukoncenie", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { while (this.dgv_SNsIP.Rows.Count > 0) { String actSN = this.dgv_SNsIP.Rows[0].Cells[0].Value.ToString().Trim(); this.tb_SerialNumber.Text = actSN; this.tb_SerialNumber_KeyUp(new object(), new KeyEventArgs(Keys.Enter)); } } return; } try { if (e.RowIndex == -1) { return; } String actSN = this.dgv_SNsIP.Rows[e.RowIndex].Cells[0].Value.ToString().Trim(); String actTestType = this.dgv_SNsIP.Rows[e.RowIndex].Cells[2].Value.ToString().Trim(); if (e.ColumnIndex == 5) { this.tb_SerialNumber.Text = actSN; this.tb_SerialNumber_KeyUp(new object(), new KeyEventArgs(Keys.Enter)); return; } else if (e.ColumnIndex == 6) { StepInfo[] arrFSI = { }; InputBox_Form myIBF = new InputBox_Form("Failed test", "Zadajte nazov chybneho kroku"); if (myIBF.ShowDialog() == DialogResult.OK) { Array.Resize(ref arrFSI, 0); while (myIBF.Answer != "") { StepInfo actFSI = new StepInfo(); actFSI.Name = myIBF.Answer; actFSI.Grade = "FAIL"; Array.Resize(ref arrFSI, arrFSI.Length + 1); arrFSI.SetValue(actFSI, arrFSI.Length - 1); myIBF = new InputBox_Form("Failed test", "Zadajte nazov dalsieho chybneho kroku"); myIBF.ShowDialog(); } if (arrFSI.Length == 0) { StepInfo actFSI = new StepInfo(); actFSI.Name = "Test1"; actFSI.Grade = "FAIL"; Array.Resize(ref arrFSI, arrFSI.Length + 1); arrFSI.SetValue(actFSI, arrFSI.Length - 1); } this.act_SNS = new SerialNumberSteps(actSN); this.act_SNS.Steps = arrFSI; this.GenerateReport(actSN, DateTime.Now); this.myStationConfig.IsInProcessAndDelete(actSN, actTestType, true); this.dgv_SNsIP.Rows.RemoveAt(e.RowIndex); this.lbl_Info.ForeColor = System.Drawing.Color.Green; this.lbl_Info.Text = this.objBelMes.Authorization.strResult; } } else if (e.ColumnIndex == 7) { this.objBelMes.SetActualResult("Terminated", "", actSN); this.myStationConfig.IsInProcessAndDelete(actSN, actTestType, true); this.dgv_SNsIP.Rows.RemoveAt(e.RowIndex); this.lbl_Info.ForeColor = System.Drawing.Color.FromArgb(255, 150, 0); this.lbl_Info.Text = this.objBelMes.Authorization.strResult; } else { return; } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { this.tb_SerialNumber.Clear(); this.tb_SerialNumber.Focus(); } }
private void dgv_Instructions_CellClick(object sender, DataGridViewCellEventArgs e) { if ((e.ColumnIndex < 3) || (e.ColumnIndex > 4)) { return; } if (e.ColumnIndex == 3) { if (this.Rows[e.RowIndex].Cells[3].Value.ToString() == "SCAN") { InputBox_Form myIBF = new InputBox_Form("Pouzite snimac ciarovych kodov", this.Rows[e.RowIndex].Cells[1].Value.ToString()); myIBF.ShowDialog(); if (myIBF.Answer != "") { ProductsConfigurationFile.ChildTestInfo actCTI = (ProductsConfigurationFile.ChildTestInfo) this.ar_ChildTestInfos.GetValue(e.RowIndex); Boolean b_ScanInfoValidation = true; if (myIBF.Answer.Length >= actCTI.ScanBarcode.Length) { for (int i = 0; i < actCTI.ScanBarcode.Length; i++) { if (actCTI.ScanBarcode[i].ToString().Trim() == "*") { continue; } if (actCTI.ScanBarcode[i].ToString().Trim() != myIBF.Answer[i].ToString().Trim()) { b_ScanInfoValidation = false; break; } } } else { b_ScanInfoValidation = false; } if (b_ScanInfoValidation) { this.Rows[e.RowIndex].Cells[2].Value = "PASS"; this.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Green; } else { this.Rows[e.RowIndex].Cells[2].Value = "FAIL"; this.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Red; } this.Rows[e.RowIndex].Cells[2].ToolTipText = myIBF.Answer; } } else { this.Rows[e.RowIndex].Cells[2].Value = "PASS"; this.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Green; this.Rows[e.RowIndex].Cells[2].ToolTipText = ""; } } else if (e.ColumnIndex == 4) { this.Rows[e.RowIndex].Cells[2].Value = "FAIL"; this.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Red; this.Rows[e.RowIndex].Cells[2].ToolTipText = ""; } }