//******************************************************************************************************************//

        public void LoadData()
        {
            if (StoreInfoModel.MaterialInfo.GetMaterialDetail.IsZhuDuanJian)
            {
                if (StoreInfoModel.MaterialInfo.GetPart == null)
                {
                    throw new Exception("本体为铸件锻件,但是在part表查不到信息!");
                }

                if (StoreInfoModel.MaterialInfo.GetMaterialDetail.PartAlreadyScanQuantity < StoreInfoModel.MaterialInfo.GetMaterialDetail.PartQuantity)
                {
                    LeftData.Add(new MaterialScanModel()
                    {
                        PartCode           = StoreInfoModel.MaterialInfo.GetPart.InventoryCode ?? "",
                        PartFigureCode     = StoreInfoModel.MaterialInfo.GetPart.Model ?? "",
                        BarCode            = StoreInfoModel.MaterialInfo.GetPart.CorrespondingBarcode ?? "",
                        DemandScanQuantity = StoreInfoModel.MaterialInfo.GetMaterialDetail.PartQuantity - StoreInfoModel.MaterialInfo.GetMaterialDetail.PartAlreadyScanQuantity,
                        IsCrux             = StoreInfoModel.MaterialInfo.GetProcessBom.IsCrux ?? 0
                    });
                }
                else
                {
                    CenterData.Add(new MaterialScanModel()
                    {
                        PartCode       = StoreInfoModel.MaterialInfo.GetPart.InventoryCode ?? "",
                        PartFigureCode = StoreInfoModel.MaterialInfo.GetPart.Model ?? "",
                        BarCode        = StoreInfoModel.MaterialInfo.GetPart.CorrespondingBarcode ?? "",
                        IsCrux         = StoreInfoModel.MaterialInfo.GetProcessBom.IsCrux ?? 0
                    });
                }
            }

            foreach (var item in StoreInfoModel.MaterialChildInfos)
            {
                if (item.GetMaterialDetail.PartAlreadyScanQuantity < item.GetMaterialDetail.PartQuantity)
                {
                    LeftData.Add(new MaterialScanModel()
                    {
                        PartCode           = item.GetMaterialDetail.PartCode,
                        PartFigureCode     = item.GetMaterialDetail.PartFigureCode,
                        BarCode            = item.GetPart.CorrespondingBarcode ?? "",
                        DemandScanQuantity = item.GetMaterialDetail.PartQuantity - item.GetMaterialDetail.PartAlreadyScanQuantity,
                        IsCrux             = item.GetProcessBom.IsCrux ?? 0
                    });
                }
                else
                {
                    CenterData.Add(new MaterialScanModel()
                    {
                        PartCode       = item.GetMaterialDetail.PartCode,
                        PartFigureCode = item.GetMaterialDetail.PartFigureCode,
                        BarCode        = item.GetPart.CorrespondingBarcode ?? "",
                        IsCrux         = item.GetProcessBom.IsCrux ?? 0
                    });
                }
            }

            RightData.Clear();
        }
예제 #2
0
        //******************************************************************************************************************//

        public void LoadData()
        {
            if (StoreInfo.MaterialOneSelf.IsCastingOrForging)
            {
                MaterialScanModel model = new MaterialScanModel()
                {
                    PartCode       = StoreInfo.MaterialOneSelf.MaterialInfo.PartCode ?? "",
                    PartFigureCode = StoreInfo.MaterialOneSelf.MaterialInfo.FigureNo ?? "",
                    BarCode        = StoreInfo.MaterialOneSelf.MaterialInfo.ExtraInfo.PartInfo.CorrespondingBarcode ?? "",
                    IsCrux         = StoreInfo.MaterialOneSelf.MaterialInfo.ExtraInfo.BomInfo.IsCrux ?? 0
                };

                if (StoreInfo.MaterialOneSelf.MaterialInfo.AlreadyScanQuantity < StoreInfo.MaterialOneSelf.MaterialInfo.TotalQuantity)
                {
                    model.DemandScanQuantity = StoreInfo.MaterialOneSelf.MaterialInfo.TotalQuantity - StoreInfo.MaterialOneSelf.MaterialInfo.AlreadyScanQuantity;
                    LeftData.Add(model);
                }
                else
                {
                    CenterData.Add(model);
                }
            }

            foreach (var item in StoreInfo.MaterialChild.MaterialInfos)
            {
                MaterialScanModel model = new MaterialScanModel()
                {
                    PartCode       = item.PartCode ?? "",
                    PartFigureCode = item.FigureNo ?? "",
                    BarCode        = item.ExtraInfo.PartInfo.CorrespondingBarcode ?? "",
                    IsCrux         = item.ExtraInfo.BomInfo.IsCrux ?? 0
                };

                if (item.AlreadyScanQuantity < item.TotalQuantity)
                {
                    model.DemandScanQuantity = item.TotalQuantity - item.AlreadyScanQuantity;
                    LeftData.Add(model);
                }
                else
                {
                    CenterData.Add(model);
                }
            }

            RightData.Clear();
        }