private void BindGrid() { GBJCLRDtsRule rule = new GBJCLRDtsRule(); DataTable dt = rule.RShow(" AND MainID=" + HTDataID + " ORDER BY Seq", ProcessGrid.GetQueryField(gridView1).Replace("SelectFlag", "0 SelectFlag")); gridView1.GridControl.DataSource = dt; gridView1.GridControl.Show(); }
/// <summary> /// 扫描条码 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtScanCode_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (HTFormStatus != FormStatus.查询) { this.ShowMessage("请先保存再扫描"); txtScanCode.Text = string.Empty; return; } if (HTDataSubmitFlag != (int)YesOrNo.No) { this.ShowMessage("只有未提交才允许扫描"); txtScanCode.Text = string.Empty; return; } string ScanCode = txtScanCode.Text.Trim(); txtScanCode.Text = string.Empty; if (ScanCode == string.Empty) { this.ShowMessage("请扫描挂板条形码"); return; } if (!checkScanCode(ScanCode)) { this.ShowMessage("挂板条形码不存在,请检查后重新扫描"); return; } if (!CheckDouble(ScanCode)) { this.ShowMessage("请勿重复扫描"); return; } //if (!checkSameGB(ScanCode)) //深圳那边提出,剪样后可以重复扫描,sc 2013.12.18 //{ // return; //} //if (!checkScanStatus(ScanCode)) //{ // return; //} //插入明细数据 GBJCLRDts entity = new GBJCLRDts(); GBJCLRDtsRule rule = new GBJCLRDtsRule(); entity.MainID = this.HTDataID; entity.Seq = SelectSeq(HTDataID); entity.GBCode = ScanCode; //挂板条码 entity.GBStatusID = (int)EnumGBStatus.借出; //挂板状态 entity.JCTime = DateTime.Now.Date; //借出时间 entity.GHOPID = ""; //归还操作人 entity.LYVendorID = ""; //留样客户编码 entity.LYVendorName = ""; //留样客户名称 rule.RAdd(entity); BindGrid(); ProcessGrid.GridViewFocus(gridView1, new string[1] { "GBCode" }, new string[1] { ScanCode }); txtScanCode.Focus(); } } catch (Exception E) { this.ShowMessage(E.Message); } }