//检查箱号及是否已满 private bool CheckCarton(string cartonNo) { #region Carton Length Check //if (chkCartonLen.Checked && chkCartonLen.Value.Trim().Length > 0) //{ // if (cartonNo.Length != Convert.ToInt32(chkCartonLen.Value.Replace("-", ""))) // { // ucMessage.AddEx(this.m_FunctionName, "包装箱号: " + this.ucLabelCartonNo.Value, new UserControl.Message(MessageType.Error, "$CS_CARTON_NO_LEN_CHECK_FAIL"), false); // this.m_FlowControl = 1; // this.SetInputMessageByFlowControl(); // return false; // } //} #endregion #region Carton First Char Check //if (chkCartonFChar.Checked && chkCartonFChar.Value.Trim().Length > 0) //{ // if (cartonNo.IndexOf(chkCartonFChar.Value.Trim()) != 0) // { // ucMessage.AddEx(this.m_FunctionName, "包装箱号: " + this.ucLabelCartonNo.Value, new UserControl.Message(MessageType.Error, "$CS_CARTON_NO_FCHAR_CHECK_FAIL"), false); // this.m_FlowControl = 1; // this.SetInputMessageByFlowControl(); // return false; // } //} #endregion #region 判断是否箱中已满 CARTONINFO objCartonInfo = m_PackageFacade.GetCARTONINFO(cartonNo) as CARTONINFO; if (objCartonInfo != null) { if (objCartonInfo.CAPACITY == objCartonInfo.COLLECTED) { ShowMessage("$CARTON_ALREADY_FILL_OUT"); this.m_FlowControl = 1; this.SetInputMessageByFlowControl(); return(false); } } #endregion #region 判断箱是否已经送检 if (objCartonInfo != null) { //OQCFacade _OQCFacade = new OQCFacade(this.DataProvider); //object obj = _OQCFacade.GetLot2CartonByCartonNo(cartonNo); //if (obj != null) //{ // ucMessage.AddEx(this._FunctionName, "包装箱号: " + this.ucLabelCartonNo.Value, new UserControl.Message(MessageType.Error, "$CARTON_ALREADY_OQC"), false); // this.m_FlowControl = 1; // this.SetInputMessageByFlowControl(); // return false; //} } #endregion return(true); }
//private void RefreshCartonNumber() //{ // string cartonNo = FormatHelper.CleanString(this.ucLabelCartonNo.Value.Trim().ToUpper()); // CARTONINFO objCartonInfo = (new Package.PackageFacade(DataProvider)).GetCARTONINFO(cartonNo) as CARTONINFO; // //Refresh CartonCapacity and Lot Capacity // if (objCartonInfo != null) // { // this.ucLabelCartonCollected.Value = objCartonInfo.COLLECTED.ToString(); // } // else // { // this.ucLabelCartonCollected.Value = ""; // } // //Check // if (objCartonInfo != null && objCartonInfo.CAPACITY == objCartonInfo.COLLECTED) // { // ucMessage.AddEx(this._FunctionName, "包装箱号: " + this.ucLabelCartonNo.Value, new UserControl.Message(MessageType.Normal, "$CARTON_ALREADY_FULL_PlEASE_CHANGE"), false); // this.m_FlowControl = 1; // this.SetInputMessageByFlowControl(); // return; // } // this.m_FlowControl = 3; // this.SetInputMessageByFlowControl(); // //End Add //} public void GetData(string cartonNo) { PackageFacade pf = new PackageFacade(DataProvider); CARTONINFO objCartonInfo = pf.GetCARTONINFO(cartonNo) as CARTONINFO; if (objCartonInfo != null) { this.cartonCollection = new CartonCollection(); this.cartonCollection.CAPACITY = objCartonInfo.CAPACITY; this.cartonCollection.COLLECTED = objCartonInfo.COLLECTED; object[] objs = pf.GetCarton2RCARDByCartonNO(cartonNo); if (objs != null) { this.carton2RCARD = new Carton2RCARD[objs.Length]; for (int i = 0; i < objs.Length; i++) { this.carton2RCARD[i] = (Carton2RCARD)objs[i]; } } if (this.carton2RCARD != null) { this.cartonCollection.MOCode = this.carton2RCARD[0].MOCode; object obj = pf.GetItemCodeByMOCode(this.carton2RCARD[0].MOCode); if (obj != null) { this.cartonCollection.ItemCode = ((CartonCollection)obj).ItemCode; this.cartonCollection.ItemDescription = ((CartonCollection)obj).ItemDescription; ItemFacade itemFacade = new ItemFacade(this.DataProvider); Item2SNCheck item2SNCheck = (Item2SNCheck)itemFacade.GetItem2SNCheck(((CartonCollection)obj).ItemCode, ItemCheckType.ItemCheckType_SERIAL); if (item2SNCheck != null) { if (item2SNCheck.SNLength > 0) { chkCardLen.Checked = true; chkCardLen.Value = item2SNCheck.SNLength.ToString(); } if (!string.IsNullOrEmpty(item2SNCheck.SNPrefix)) { chkCardFChar.Checked = true; chkCardFChar.Value = item2SNCheck.SNPrefix; } } } } } }
private bool checkCarton(string cartonNo) { #region Carton Length Check if (chkCartonLen.Checked && chkCartonLen.Value.Trim().Length > 0) { if (cartonNo.Length != Convert.ToInt32(chkCartonLen.Value.Replace("-", ""))) { ucMessage.AddEx(this._FunctionName, "$CS_CARTON_NO: " + this.ucLabelCartonNo.Value, new UserControl.Message(MessageType.Error, "$CS_CARTON_NO_LEN_CHECK_FAIL"), false); this.m_FlowControl = 1; this.SetInputMessageByFlowControl(); return(false); } } #endregion #region Carton First Char Check if (chkCartonFChar.Checked && chkCartonFChar.Value.Trim().Length > 0) { if (cartonNo.IndexOf(chkCartonFChar.Value.Trim()) != 0) { ucMessage.AddEx(this._FunctionName, "$CS_CARTON_NO: " + this.ucLabelCartonNo.Value, new UserControl.Message(MessageType.Error, "$CS_CARTON_NO_FCHAR_CHECK_FAIL"), false); this.m_FlowControl = 1; this.SetInputMessageByFlowControl(); return(false); } } #endregion #region 判断是否箱中已满 PackageFacade pf = new PackageFacade(DataProvider); CARTONINFO objCartonInfo = pf.GetCARTONINFO(cartonNo) as CARTONINFO; if (objCartonInfo != null) { if (objCartonInfo.CAPACITY == objCartonInfo.COLLECTED) { ucMessage.AddEx(this._FunctionName, "$CS_CARTON_NO: " + this.ucLabelCartonNo.Value, new UserControl.Message(MessageType.Error, "$CARTON_ALREADY_FILL_OUT"), false); this.m_FlowControl = 1; this.SetInputMessageByFlowControl(); return(false); } } #endregion return(true); }