/// <summary> /// 切换当前流程批次 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btSetLotID_Click(object sender, EventArgs e) { FormObtainBarcode dlg = new FormObtainBarcode(); dlg.StartPosition = FormStartPosition.CenterScreen; dlg.Text = "输入流程批次号"; string lastLotID = _ms.CurrLotID; dlg.SetInitBarcode(lastLotID); ////日后添加流程批次可选值 dlg.ObtainMode = FormObtainBarcode.OBMode.Scanner; while (DialogResult.OK == dlg.ShowDialog()) { string errorInfo; bool isSetLotIDOK = _ms.SetCurrLotID(dlg.Barcode, out errorInfo); if (isSetLotIDOK) { lbLotID.Text = dlg.Barcode; lbLotID.ForeColor = Color.Black; //if(!string.IsNullOrEmpty(_ms.CurrRecipeID)) // _detectResultTransfer.SetRecipeLot(_ms.CurrRecipeID, _ms.CurrLotID, out string error); break; } else { if (DialogResult.Yes != MessageBox.Show("设置流程批次号失败,错误信息:" + errorInfo + "是否重新输入?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) { break; } } } }
/// <summary> /// 切换当前产品ID /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btSetProdID_Click(object sender, EventArgs e) { FormObtainBarcode dlg = new FormObtainBarcode(); dlg.StartPosition = FormStartPosition.CenterScreen; dlg.Text = "输入产品ID"; string lastProdID = _ms.CurrRecipeID; if (string.IsNullOrEmpty(lastProdID)) { lastProdID = JFHubCenter.Instance.SystemCfg.GetItemValue(MainStation.SCN_CurrentRecipeID) as string; } dlg.SetInitBarcode(lastProdID); JFDLAFRecipeManager rm = JFHubCenter.Instance.RecipeManager as JFDLAFRecipeManager; if (null != rm && rm.IsInitOK) { string[] allRecipeIDs = rm.AllRecipeIDsInCategoty(MainStation.SCN_CategotyProd); dlg.SetBarcodeOptions(allRecipeIDs); } dlg.ObtainMode = FormObtainBarcode.OBMode.Scanner; while (DialogResult.OK == dlg.ShowDialog()) { string errorInfo; if (_ms.CurrRecipeID == dlg.Barcode && !string.IsNullOrEmpty(dlg.Barcode)) { return; } bool isSetProdIDOK = _ms.SetCurrRecipeID(dlg.Barcode, out errorInfo); if (isSetProdIDOK) { lbProdID.Text = dlg.Barcode; lbProdID.ForeColor = Color.Black; UpdateMappingByProdID(dlg.Barcode); //if (!string.IsNullOrEmpty(_ms.CurrLotID)) // _detectResultTransfer.SetRecipeLot(_ms.CurrRecipeID, _ms.CurrLotID, out string err); break; } else { if (DialogResult.Yes != MessageBox.Show("设置产品ID失败,错误信息:" + errorInfo + "是否重新输入?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) { break; } } } }