/// <summary>
        /// 生成出库单
        /// </summary>
        private BillStoreOutVM GenerateStoreOut(int brandID)
        {
            var            bill     = this.Master;
            BillStoreOutVM storeout = new BillStoreOutVM();
            var            soMaster = storeout.Master;

            soMaster.Remark         = "零售出库";
            soMaster.BillType       = (int)BillTypeEnum.BillRetail;
            soMaster.OrganizationID = VMGlobal.CurrentUser.OrganizationID;
            soMaster.StorageID      = bill.StorageID;
            soMaster.BrandID        = brandID;

            List <BillStoreOutDetails> soDetails = new List <BillStoreOutDetails>();

            this.TraverseGridDataItems(p =>
            {
                if (p.BrandID == brandID && p.Quantity > 0)
                {
                    soDetails.Add(new BillStoreOutDetails
                    {
                        ProductID = p.ProductID,
                        Quantity  = p.Quantity
                    });
                }
            });
            storeout.Details = soDetails;
            return(storeout);
        }
Exemple #2
0
        /// <summary>
        /// 生成出库单
        /// </summary>
        private BillStoreOutVM GenerateStoreOut(DeliverySearchEntity entity)
        {
            BillStoreOutVM storeout = new BillStoreOutVM();
            var            soMaster = storeout.Master;
            int            typeid   = (int)Enum.Parse(typeof(BillTypeEnum), typeof(BillDelivery).Name);

            soMaster.Remark           = "发货出库";
            soMaster.BillType         = typeid;
            soMaster.OrganizationID   = VMGlobal.CurrentUser.OrganizationID;
            soMaster.RefrenceBillCode = entity.Code;
            soMaster.StorageID        = entity.StorageID;
            soMaster.BrandID          = entity.BrandID;
            List <BillStoreOutDetails> soDetails = new List <BillStoreOutDetails>();

            foreach (var p in entity.Details)
            {
                soDetails.Add(new BillStoreOutDetails
                {
                    ProductID = p.ProductID,
                    Quantity  = p.Quantity
                });
            }
            ;
            storeout.Details = soDetails;
            return(storeout);
        }