private void Readed(object sender, ReadEventArgs e) { if (((MainForm)this.MdiParent).ActiveMdiChild == this) { string employee_id = e.ReadMsg.Trim().Replace("\r", "").Replace("\n", "").Replace("+", ""); bool flag = false; foreach (DataGridViewRow dgvr in dataGridViewControl1.Rows) { if (dgvr.Cells["EMPLOYEE_ID"].Value.ToString().ToUpper().Equals(employee_id)) { dgvr.Selected = true; flag = true; break; } } if (!flag) { MessageBox.Show("찾는 사원이 없습니다."); } else if (MessageBox.Show("수정페이지로 이동 하시겠습니까?", "수정", MessageBoxButtons.YesNo) == DialogResult.Yes) { ShowEmployee(employee_id); } } ((MainForm)this.MdiParent).ClearStrs(); }
/// <summary> /// 바코드 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Readed(object sender, ReadEventArgs e) { if (((MainForm)this.MdiParent).ActiveMdiChild == this) { string barID = e.ReadMsg; barID = barID.Replace("%O", "-"); string[] str = barID.Split('-'); orderString = str[0]; productString = str[1]; for (int i = 0; i < dgvDetail.RowCount; i++) { if (dgvDetail.Rows[i].Cells[1].Value.ToString() == orderString) { if (dgvDetail.Rows[i].Cells[4].Value.ToString() == productString) { dgvDetail.Rows[i].Cells[0].Value = true; dgvDetail.Rows[i].Selected = true; btnWarehouse.PerformClick(); } } } ((MainForm)this.MdiParent).ClearStrs(); } }
private void Readed_Completed(object sender, ReadEventArgs e) { int readNum; // TryParse의 out에 이용 char readChar; // TryParse의 out에 이용 ((MainForm)this.MdiParent).ClearStrs(); e.ReadMsg = e.ReadMsg.Replace("\r", "").Replace("\n", ""); if (((MainForm)this.MdiParent).ActiveMdiChild == this) { if (e.ReadMsg.Length != 5) { MessageBox.Show("잘못된 바코드를 입력하셨습니다."); return; } else if (e.ReadMsg.Length == 5) // 바코드 길이가 5글자 { if (!int.TryParse(e.ReadMsg.Substring(0, 4), out readNum) || !char.TryParse(e.ReadMsg.Substring(4), out readChar)) { MessageBox.Show("잘못된 바코드를 입력하셨습니다."); return; } } if (e.ReadMsg.Contains("N")) // 재료 선택시 { MessageBox.Show("재료의 BOM 정보가 없으므로 복사를 진행하실 수 없습니다."); return; } int CodeNum = e.ReadMsg.Substring(0, 4).ToInt(); BarcodeList.Add(new ProductVO { Product_ID = CodeNum, Product_Name = pdSv.SelectProductName(CodeNum) }); } dgvBarcode.DataSource = null; dgvBarcode.DataSource = BarcodeList; }
private void Readed(object sender, ReadEventArgs e) { if (((MainForm)this.MdiParent).ActiveMdiChild == this) { int comCode = int.Parse(e.ReadMsg.Trim().Replace("\r", "").Replace("\n", "")); foreach (DataGridViewRow dgvr in dgvCompanyList.Rows) { if (dgvr.Cells["company_id"].Value.ToInt() == comCode) { dgvr.Selected = true; break; } } if (MessageBox.Show("수정하시겠습니까?", "", MessageBoxButtons.YesNo) == DialogResult.Yes) { CompanyVO company = new CompanyVO(); company.company_id = Convert.ToInt32(dgvCompanyList.SelectedRows[0].Cells[1].Value); company.company_name = dgvCompanyList.SelectedRows[0].Cells[2].Value.ToString(); company.company_type = dgvCompanyList.SelectedRows[0].Cells[3].Value.ToString(); company.company_seq = Convert.ToInt32(dgvCompanyList.SelectedRows[0].Cells[4].Value); CompanyProductPopupForm cpp = new CompanyProductPopupForm(emp.Employee_name, true, company); if (cpp.ShowDialog() == DialogResult.OK) { dgvCompanyList.Columns.Clear(); CompanyForm_Load(null, null); } return; } this.GetMdiParent().ClearStrs(); } }