コード例 #1
0
ファイル: FTransferCarton.cs プロジェクト: windygu/.net-wms
        //check for carton capacity if overload
        private bool CheckTargetCarton(string tagCarton)
        {
            bool bResult = true;

            m_NeedAddNewCarton = false;
            object obj = (new Package.PackageFacade(DataProvider)).GetCARTONINFO(tagCarton);

            if (tagCarton == txtCurrentCarton.Value.ToUpper().Trim())
            {
                ucMessage.Add(new UserControl.Message(MessageType.Error, "$CS_TAG_CARTON_EQUAL_CUR_CARTON $CS_CARTON_NO =" + tagCarton));
                bResult = false;
            }

            #region OQC检验
            //Added by lisa@2012-8-29
            //检查目标小箱是否已经在OQC处理过程中
            OQCFacade  _OQCFacade   = new OQCFacade(this.DataProvider);
            Lot2Carton lot2carton   = _OQCFacade.GetLot2CartonByCartonNo(tagCarton) as Lot2Carton;
            OQCLot     oqcCartonLot = null;
            if (lot2carton != null)
            {
                oqcCartonLot = _OQCFacade.GetOQCLot(lot2carton.OQCLot, OQCFacade.Lot_Sequence_Default) as OQCLot;
                if (oqcCartonLot != null && !(oqcCartonLot.LOTStatus == OQCLotStatus.OQCLotStatus_Reject || oqcCartonLot.LOTStatus == OQCLotStatus.OQCLotStatus_Rejecting ||
                                              oqcCartonLot.LOTStatus == OQCLotStatus.OQCLotStatus_Pass || oqcCartonLot.LOTStatus == OQCLotStatus.OQCLotStatus_Passing))
                {
                    ucMessage.Add(new UserControl.Message(MessageType.Error, "$CS_RCARD_In_OQC"));
                    this.txtRCard.TextFocus(false, true);
                    return(false);
                }
            }

            //检查当前Rcard所在箱和目标箱的OQC状态是否一致,或者都不在OQC中,或者都是OQC判过,或者都是OQC判退
            DataCollectFacade dataCollectFacade   = new DataCollectFacade(this.DataProvider);
            string            sourceRCard         = dataCollectFacade.GetSourceCard(txtRCard.Value.Trim().ToUpper(), string.Empty);
            object            objSimulationReport = dataCollectFacade.GetLastSimulationReport(sourceRCard);
            string            currentlotno        = (objSimulationReport as Domain.DataCollect.SimulationReport).LOTNO;

            OQCLot oqcRcardLot = null;

            if (!string.IsNullOrEmpty(currentlotno))
            {
                oqcRcardLot = _OQCFacade.GetOQCLot(currentlotno.Trim(), OQCFacade.Lot_Sequence_Default) as OQCLot;
            }

            if (!(oqcCartonLot == null && oqcRcardLot == null))
            {
                if (oqcCartonLot == null)
                {
                    ucMessage.Add(new UserControl.Message(MessageType.Error, "$CS_RCARD_CARTON_OQC_NOT_SAME"));
                    this.txtRCard.TextFocus(false, true);
                    return(false);
                }
                if (oqcRcardLot == null)
                {
                    ucMessage.Add(new UserControl.Message(MessageType.Error, "$CS_RCARD_CARTON_OQC_NOT_SAME"));
                    this.txtRCard.TextFocus(false, true);
                    return(false);
                }
                if (oqcCartonLot.LOTStatus != oqcRcardLot.LOTStatus)
                {
                    ucMessage.Add(new UserControl.Message(MessageType.Error, "$CS_RCARD_CARTON_OQC_NOT_SAME"));
                    this.txtRCard.TextFocus(false, true);
                    return(false);
                }
            }

            #endregion

            if (obj == null)
            {
                //ucMessage.Add(new UserControl.Message(MessageType.Error,"$CS_CARTON_NOT_EXIST $CS_CARTON_NO =" + tagCarton));
                bResult            = false;
                m_NeedAddNewCarton = true;
            }
            else
            {
                Domain.Package.CARTONINFO carton = obj as Domain.Package.CARTONINFO;
                if (carton.COLLECTED >= carton.CAPACITY)
                {
                    ucMessage.Add(new UserControl.Message(MessageType.Error, "$CARTON_ALREADY_FILL_OUT $CS_CARTON_NO =" + tagCarton));
                    bResult = false;
                }
            }

            return(bResult);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        //获取批号, 实际批量/标准批量与备注值
        private void GetLotNo()
        {
            DataCollectFacade dcf        = new DataCollectFacade(this.DataProvider);
            string            rcard      = this.ucLabelEditRcard.Value.ToUpper().Trim();
            string            cartonCode = ucLabelEditCartonCode.Value.ToUpper().Trim();

            string sourceRCard = dcf.GetSourceCard(rcard, string.Empty);

            if (rcard != String.Empty)
            {
                object obj = dcf.GetSimulation(sourceRCard);
                if (obj != null)
                {
                    Simulation sim = obj as Simulation;

                    string oqcLotNo = sim.LOTNO;
                    if (String.IsNullOrEmpty(oqcLotNo))
                    {
                        ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$RCard_No_Lot"));
                        this.ucLabelEditLotNo.Value = "";
                        this.Clear();
                        this.ucLabelEditRcard.TextFocus(false, true);
                        return;
                    }

                    if (!CheckLotStatus(oqcLotNo))
                    {
                        this.ucLabelEditLotNo.Value = "";
                        this.Clear();
                        this.ucLabelEditRcard.TextFocus(false, true);
                        return;
                    }
                    LabOQCLotKeyPress();
                }
                else
                {
                    ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Error, "$NoProductInfo"));
                    this.ucLabelEditLotNo.Value = "";
                    this.Clear();
                    this.ucLabelEditRcard.TextFocus(false, true);
                }
            }
            //add by alex 2010.11.10
            else if (cartonCode != String.Empty)
            {
                OQCFacade oqcFacade = new OQCFacade(this.DataProvider);
                object    obj       = oqcFacade.GetLot2CartonByCartonNo(cartonCode);
                if (obj != null)
                {
                    Lot2Carton lot2Carton = obj as Lot2Carton;

                    string lotno = lot2Carton.OQCLot;
                    if (lotno == string.Empty)
                    {
                        Messages messages = new Messages();
                        messages.Add(new UserControl.Message(MessageType.Error, "$CS_CARTON_NOT_EXIST_LOT"));
                        ApplicationRun.GetInfoForm().Add(messages);
                        this.ucLabelEditLotNo.Value = "";
                        this.Clear();
                        this.ucLabelEditCartonCode.TextFocus(false, true);
                        return;
                    }
                    if (!CheckLotStatus(lot2Carton.OQCLot.Trim()))
                    {
                        this.ucLabelEditLotNo.Value = "";
                        this.Clear();
                        this.ucLabelEditCartonCode.TextFocus(false, true);
                        return;
                    }
                    LabOQCLotKeyPress();
                }
                else
                {
                    Messages messages = new Messages();
                    messages.Add(new UserControl.Message(MessageType.Error, "$NoLol2CartonInfo"));
                    ApplicationRun.GetInfoForm().Add(messages);
                    this.ucLabelEditLotNo.Value = "";
                    this.Clear();
                    this.ucLabelEditCartonCode.TextFocus(false, true);
                }
            }
            else
            {
                ucLabelEditRcard.TextFocus(false, true);
            }
        }