Beispiel #1
0
        //检查此Rcard所属栈板下Rcard在同一垛位下
        private bool CheckRcardIsInTheSameStack(string pallet, string stackCode)
        {
            InventoryFacade   inventoryFacade   = new InventoryFacade(this.DataProvider);
            PackageFacade     packageFacade     = new PackageFacade(this.DataProvider);
            DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider);

            object[] pallet2RCardList = packageFacade.GetPallet2RCardListByPallet(pallet);
            if (pallet2RCardList == null)
            {
                return(true);
            }

            for (int i = 0; i < pallet2RCardList.Length; i++)
            {
                string           cartonCode       = string.Empty;
                SimulationReport simulationReport = (SimulationReport)dataCollectFacade.GetLastSimulationReport(((Pallet2RCard)pallet2RCardList[i]).RCard);
                if (simulationReport != null)
                {
                    cartonCode = simulationReport.CartonCode;
                }

                object[] stack2RcardList = inventoryFacade.QueryStacktoRcardByRcardAndCarton(((Pallet2RCard)pallet2RCardList[i]).RCard, cartonCode);
                if (stack2RcardList != null && !((StackToRcard)stack2RcardList[0]).StackCode.Equals(stackCode))
                {
                    ApplicationRun.GetInfoForm().Add(
                        new UserControl.Message(MessageType.Error, "$CS_RCARD_IS_NOT_INSAME_STACK:" + ((StackToRcard)stack2RcardList[0]).StackCode));
                    return(false);
                }
            }

            return(true);
        }
Beispiel #2
0
        private bool CheckPalletInput(string palletCode, bool needAddToGrid)
        {
            //if (!this.CheckSelecetedStackAndStorage(this.SelectedStorage, this.SelectedStack, Convert.ToString(this.ucLabelComboxINVType.SelectedItemValue)))
            //{
            //    return false;
            //}
            if (Convert.ToString(this.ucLabelComboxINVType.SelectedItemValue).Trim().Length == 0)
            {
                //请输入库位
                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Error, "$CS_STORAGE_NOT_INPUT"));
                return(false);
            }

            if (!this.SelectedStorage.Equals(Convert.ToString(this.ucLabelComboxINVType.SelectedItemValue)))
            {
                InventoryFacade inventoryFacade  = new InventoryFacade(this.DataProvider);
                int             stack2RCardCount = inventoryFacade.GetStack2RCardCount(this.SelectedStack, Convert.ToString(this.ucLabelComboxINVType.SelectedItemValue));

                if (stack2RCardCount > 0)
                {
                    //垛位和库别不对应
                    ApplicationRun.GetInfoForm().Add(
                        new UserControl.Message(MessageType.Error, "$CS_STACK_STORAGE_NOT_SAME"));
                    return(false);
                }
            }

            PackageFacade objPFFacade = new PackageFacade(this.DataProvider);

            //判断栈板号是否存在
            object[] objPallet2RCardS = objPFFacade.GetPallet2RCardListByPallet(palletCode);
            if (objPallet2RCardS == null)
            {
                //该栈板号不存在
                ApplicationRun.GetInfoForm().Add(
                    new UserControl.Message(MessageType.Error, "$CS_PALLETNO_IS_NOT_EXIT"));
                return(false);
            }

            foreach (Pallet2RCard pallet2RCard in objPallet2RCardS)
            {
                string strRcard = pallet2RCard.RCard;

                InventoryFacade objInvFacade = new InventoryFacade(this.DataProvider);
                DataTable       dtInfo       = objInvFacade.GetSimulationReportInfo(strRcard, packRcard);

                if (dtInfo == null)
                {
                    //该序列号不存在
                    ApplicationRun.GetInfoForm().Add(
                        new UserControl.Message(MessageType.Error, "$CS_RCARD_IS_NOT_EXIT"));
                    return(false);
                }

                if (!CheckRule(strRcard))
                {
                    return(false);
                }

                //foreach (DataRow dr in dtInfo.Rows)
                DataRow dr = dtInfo.Rows[0];//{
                if (!this.CheckStackAndRcardInfo(strRcard, this.ucLabelEditStock.Value.Trim(), dr["itemcode"].ToString(), palletCode, this.ucLabelComboxCompany.SelectedItemValue.ToString(), this.ucLabelComboxINVType.SelectedItemValue.ToString()))
                {
                    return(false);
                }
                else
                {
                    if (needAddToGrid)
                    {
                        if (CheckDuplicateInput(dr["rcard"].ToString(), packRcard))
                        {
                            //重复输入
                            ApplicationRun.GetInfoForm().Add(
                                new UserControl.Message(MessageType.Error, "$CS_IDRepeatCollect $CS_Param_RunSeq=" + dr["rcard"].ToString()));
                            continue;
                        }

                        if (objInvFacade.CheckStackIsOnlyAllowOneItem(this.ucLabelEditStock.Value.Trim()) && CheckExistItem(dr["itemcode"].ToString()))
                        {
                            ApplicationRun.GetInfoForm().Add(
                                new UserControl.Message(MessageType.Error, "$CS_ONLY_ONE_ITEM_IN_STACK"));
                            return(false);
                        }


                        DataRow drNew = this.m_dtRcard.NewRow();
                        drNew["palletcode"] = palletCode;
                        drNew["cartoncode"] = dr["cartoncode"];
                        drNew["rcard"]      = dr["rcard"];
                        drNew["mocode"]     = dr["mocode"];
                        drNew["itemcode"]   = dr["itemcode"];
                        drNew["itemdesc"]   = dr["itemdesc"];
                        drNew["inputtype"]  = packPallet;
                        drNew["sscode"]     = dr["sscode"];

                        this.m_dtRcard.Rows.Add(drNew);

                        this.ucLabelEditQty.Value = Convert.ToString(Convert.ToInt32(this.ucLabelEditQty.Value) + 1);
                    }
                }
                //}
            }

            return(true);
        }