/// <summary> /// 处理条码 /// </summary> /// <param name="matchBarCode"></param> /// <returns></returns> private string HandleBarCode(string matchBarCode) { string result = string.Empty; if (!string.IsNullOrEmpty(matchBarCode)) { if (_dataDic.Count > 1) { List <string> bcuList = OrderHelper.GetBcuPackForOrder(); string index4 = string.Empty; if (BarCodeHelper.IsTempBCU(matchBarCode)) { index4 = matchBarCode.Substring(0, 5); } else { index4 = matchBarCode.Substring(0, 3); } KeyValuePair <string, int> bcuItem = new KeyValuePair <string, int>(); if (bcuList.Contains(index4)) { if (BarCodeHelper.IsOrderOutSet(txtOrderNum.Text)) { if (BarCodeHelper.IsTempBCU(matchBarCode)) { if (_outOrderBCUs.Count == 0) { result = OrderHelper.GetDescribeString(5); return(result); } else { bcuItem = _outOrderBCUs.FirstOrDefault(p => p.Key == matchBarCode); if (bcuItem.Key == null) { result = OrderHelper.GetDescribeString(3); return(result); } } } } else { if (BarCodeHelper.IsOutOrderBCU(matchBarCode)) { result = "此订单不能发送外来器械包。"; return(result); } } SortedList tempResult = _cnasHCSWorkflowInterface01.CheckBusinessLogic(matchBarCode, _dataDic); int bResult = -1; int.TryParse(Convert.ToString(tempResult["result_Code"]), out bResult); string bcct_barCode = Convert.ToString(tempResult["barCode"]); string bcct_barCodeObjectName = Convert.ToString(tempResult["barCodeObjectName"]); result = Convert.ToString(tempResult["result_Message"]); string messageForBox = Convert.ToString(tempResult["MessageBox_Message"]); int messageOperation = 1; if (bResult == 0) { if (!string.IsNullOrEmpty(messageForBox) && int.TryParse(Convert.ToString(tempResult["Message_Operation"]), out messageOperation)) { if (MessageBox.Show(messageForBox, "信息提示", (messageOperation == 1 ? MessageBoxButtons.OK : MessageBoxButtons.OKCancel), MessageBoxIcon.Information) != System.Windows.Forms.DialogResult.OK) { result = string.Format("{0} --用户取消", messageForBox); return(result); } else { result = string.Empty; } } if (BarCodeHelper.IsOrderOutSet(OrderNum) && string.IsNullOrEmpty(result) && BarCodeHelper.IsOutOrderBCU(matchBarCode)) { foreach (DataGridViewRow row in dgv_Instrument.Rows) { row.Cells["send_count_now"].Value = row.Cells["num"].Value; } } if (!_dataDic.ContainsKey(bcct_barCode)) { _dataDic.Add(bcct_barCode, bcct_barCode.Length > 3 ? bcct_barCode.Substring(0, 3) : bcct_barCode); } if (!string.IsNullOrEmpty(bcct_barCode) && bcct_barCode.Contains("BCC")) { bcct_barCode = bcct_barCode.Substring(bcct_barCode.IndexOf("BCC")); } AddDgv_BcuData(matchBarCode, bcct_barCode, bcct_barCodeObjectName); //grid数据添加 if (BarCodeHelper.IsOrderOutSet(OrderNum) && BarCodeHelper.IsOutOrderBCU(matchBarCode) && bcuItem.Key == matchBarCode) { _outOrderBCUs[matchBarCode] = 1; } } } else { result = OrderHelper.GetDescribeString(1); } } } else { result = "内部码错误"; } return(result); }