private void Forwarding_KeyPress(object sender, KeyPressEventArgs e) { productionNo += e.KeyChar.ToString().Replace("\r", ""); BLL.T_JISA t_JISA = new BLL.T_JISA(); if (e.KeyChar == 13) { BLL.T_Verifying t_Verifying = new BLL.T_Verifying(); DataTable dt = t_Verifying.GetHZOrder(); List <string> product = dt.AsEnumerable().Select(d => d.Field <string>("ProductNo")).ToList(); if (product.Contains(productionNo)) { DataTable tt = t_JISA.GetJISA(2); string p = tt.Rows[0]["ProductionNumber"].ToString(); if (p == productionNo) { t_JISA.SaveJISA(p, 2); ShowEDIInfo(); } } else { HZ hZ = new HZ("未找到生产号"); hZ.ShowDialog(); } } this.scanTitle.Focus(); }
private void ShowEDIInfo() { this.EDIQueue.Controls.Clear(); BLL.T_JISA t_JISA = new BLL.T_JISA(); DataTable dt = t_JISA.GetJISA(2); if (dt != null) { if (dt.Rows.Count > 0) { int locationX = 0; int locationY = 0; foreach (DataRow item in dt.Rows) { FZPrintControl fz = new FZPrintControl(); fz.Name = item["ProductionNumber"].ToString(); fz.productNo = item["ProductionNumber"].ToString(); fz.carType = item["CarType"].ToString(); fz.carModelName = item["CarModelName"].ToString(); int state = t_JISA.GetJISAState(item["ProductionNumber"].ToString()); if (state == 1) { fz.FontColor = Color.Blue; } else { fz.FontColor = Color.Black; } fz.SetInfo(this.EDIQueue.Width, this.EDIQueue.Height / 12); fz.Location = new Point(locationX, locationY); this.EDIQueue.Controls.Add(fz); locationY += fz.Height; } } } else { MessageBox.Show("未找到JISA信息"); } }