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); } }