/// <summary> /// 获取条形码信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnGetBarCodeInfo_Click(object sender, EventArgs e) { if (numBarcode.Value == 0m) { MessageDialog.ShowPromptMessage("条形码不能是0"); return; } View_S_InDepotGoodsBarCodeTable goodsInfo = GetBarCodeInfo(Convert.ToInt32(numBarcode.Value)); if (goodsInfo != null) { bool isValid = false; if (goodsInfo.图号型号 == txtGoodsCode.Text) { // 是否选配零件,是选配零件则不要检查规格 if (m_choseConfectServer.IsExistChoseConfectInfo(goodsInfo.图号型号)) { isValid = true; } else { if (goodsInfo.规格 == m_dataRow["规格"]) { isValid = true; } } } if (isValid) { txtBatchNo.Text = goodsInfo.批次号; txtProvider.Text = goodsInfo.供货单位; txtSpec.Text = goodsInfo.规格; } else { MessageDialog.ShowErrorMessage( string.Format("您录入的条形码【{0}】物品名称为【{1}】规格为【{2}】,与返修零件不符合", goodsInfo.条形码, goodsInfo.物品名称, goodsInfo.规格)); } } }