private void ucBtnOK_Click(object sender, System.EventArgs e) { if (this.rtxtInput.Text.Trim() == string.Empty) { this.ErrorMessage(lblMessage.Text); //请输入待移除的二维条码 this.rtxtInput.Focus(); return; } else { try { // BarCodeParse barParser = new BarCodeParse(this._domainDataProvider); // string[] idList = barParser.GetIDList( this.rtxtInput.Text.Trim()); // // if ( idList == null || idList.Length == 0) // { // this.ErrorMessage("$CS_RCard_List_Is_Empty"); // return; // } // else // { // this._idList = idList; // } BenQGuru.eMES.DataCollect.DataCollectFacade dc = new BenQGuru.eMES.DataCollect.DataCollectFacade(this.DataProvider); object[] idList = dc.GetSimulationFromCarton(this.rtxtInput.Text.Trim()); if (idList == null || idList.Length == 0) { this.ErrorMessage("$CS_RCard_List_Is_Empty"); return; } else { this._idList = new string[idList.Length]; int i = 0; foreach (BenQGuru.eMES.Domain.DataCollect.Simulation sim in idList) { _idList[i++] = sim.RunningCard; } } this.DialogResult = DialogResult.OK; this.Close(); } catch (System.Exception ex) { this.ErrorMessage(ex.Message); } } }
private bool InputRcard(string rcard, string companyCode) { InventoryFacade inventoryFacade = new InventoryFacade(this.DataProvider); //转换产品序列号为原始序列号 DataCollect.DataCollectFacade dcf = new BenQGuru.eMES.DataCollect.DataCollectFacade(DataProvider); string sourceRCard = dcf.GetSourceCard(rcard.Trim().ToUpper(), string.Empty); ////检查此垛位是否存在相关产品 // object[] objRcardToStackPalletList = inventoryFacade.GetRcardToStackPallet("", "", sourceRCard); if (objRcardToStackPalletList == null) { //Message:垛位不存在相关产品 ApplicationRun.GetInfoForm().Add( new UserControl.Message(MessageType.Error, "$CS_RCARD_NOT_EXIST_IN_STACK")); return(false); } PackageFacade pf = new PackageFacade(this.DataProvider); object objPalletRcrad = pf.GetPallet2RCardByRCard(sourceRCard); if (objPalletRcrad != null) { //序列号存在栈板,请以栈板号来进行公司变更 ApplicationRun.GetInfoForm().Add( new UserControl.Message(MessageType.Error, "$CS_RCARD_EXIST_PALLET_NOT_CHANGE_COMPANY")); return(false); } ////变更Company // inventoryFacade.UpdateCompany("", "", sourceRCard, companyCode, ApplicationService.Current().LoginInfo.UserCode); ////Add To Grid // this.LoadDataSource(objRcardToStackPalletList); return(true); }
private void GetLotNo() { DataCollect.DataCollectFacade dcf = new BenQGuru.eMES.DataCollect.DataCollectFacade(DataProvider); string rCard = this.ucLabelEditRCard.Value.Trim().ToUpper(); string cartonCode = txtCartonCode.Value.ToUpper().Trim(); string sourceRCard = dcf.GetSourceCard(rCard, string.Empty); if (rCard.Length > 0) { object objSimulationReport = dcf.GetLastSimulationReport(sourceRCard); if (objSimulationReport != null) { Domain.DataCollect.SimulationReport simulationReport = objSimulationReport as Domain.DataCollect.SimulationReport; this.ucLabelEditLotNo.Value = simulationReport.LOTNO; if (simulationReport.LOTNO == string.Empty) { ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_SN_NOT_EXIST_LOT")); this.ucLabelEditRCard.TextFocus(false, true); return; } Messages msg = this.LoadLotInfo(); if (!msg.IsSuccess()) { ApplicationRun.GetInfoForm().Add(msg); this.m_LotNo = string.Empty; this.ucLabelEditSizeAndCapacity.Value = ""; this.ucLabelEditItemCode.Value = ""; this.labelItemDescription.Text = ""; } else { this.m_LotNo = this.ucLabelEditLotNo.Value.Trim().ToUpper(); this.LoadSampleList(m_LotNo); this.LoadCheckList(m_LotNo); this.LoadBaseList(m_LotNo); this.ucLabelEditLotNo.TextFocus(false, true); } } else { ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$NoSimulationInfo")); this.m_LotNo = string.Empty; this.ucLabelEditSizeAndCapacity.Value = ""; this.ucLabelEditItemCode.Value = ""; this.labelItemDescription.Text = ""; this.ucLabelEditRCard.TextFocus(false, true); } } //add by alex 2010.11.19 else if (cartonCode != String.Empty) { OQCFacade oqcFacade = new OQCFacade(this.DataProvider); object obj = oqcFacade.GetLot2CartonByCartonNo(cartonCode); if (obj != null) { Lot2Carton lot2Carton = obj as Lot2Carton; this.ucLabelEditLotNo.Value = lot2Carton.OQCLot; if (lot2Carton.OQCLot == string.Empty) { Messages messages = new Messages(); messages.Add(new UserControl.Message(MessageType.Error, "$CS_CARTON_NOT_EXIST_LOT")); ApplicationRun.GetInfoForm().Add(messages); this.txtCartonCode.TextFocus(false, true); return; } Messages msg = this.LoadLotInfo(); if (!msg.IsSuccess()) { ApplicationRun.GetInfoForm().Add(msg); this.m_LotNo = string.Empty; this.ucLabelEditSizeAndCapacity.Value = ""; this.ucLabelEditItemCode.Value = ""; this.labelItemDescription.Text = ""; } else { this.m_LotNo = this.ucLabelEditLotNo.Value.Trim().ToUpper(); this.LoadSampleList(m_LotNo); this.LoadCheckList(m_LotNo); this.LoadBaseList(m_LotNo); this.ucLabelEditLotNo.TextFocus(false, true); } } else { Messages messages = new Messages(); messages.Add(new UserControl.Message(MessageType.Error, "$NoLol2CartonInfo")); ApplicationRun.GetInfoForm().Add(messages); this.txtCartonCode.TextFocus(false, true); } } else { ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$CS_Please_Input_RunningCard")); this.ucLabelEditSizeAndCapacity.Value = ""; this.m_LotNo = string.Empty; this.ucLabelEditItemCode.Value = ""; this.labelItemDescription.Text = ""; this.ucLabelEditRCard.TextFocus(false, true); } }