Exemplo n.º 1
0
        private BindingList <PreGoodsBalanceData> GetPreOrderList()
        {
            if (_currentOrderHeader != null)
            {
                using (var oc = UnityContainer.Resolve <OrderDataContext>())
                {
                    var orders       = oc.DataBaseContext.sp_sel_PreOrderGoodsByHeader(_currentOrderHeader.IdOrderHeader).ToList();
                    var commitOrders = oc.DataBaseContext.sp_sel_PreOrderCommitGoodsByHeader(_currentOrderHeader.IdOrderHeader).ToList();

                    var balance = new BindingList <PreGoodsBalanceData>
                    {
                        AllowEdit = _currentOrderHeader.IdOrderState == 1
                    };

                    foreach (var vo in orders)
                    {
                        var bl = new PreGoodsBalanceData
                        {
                            Barcode        = vo.Barcode,
                            Code           = vo.Code,
                            Date           = vo.Date,
                            FreeBalance    = vo.FreeBalance.GetValueOrDefault(),
                            Group          = vo.GoodsGroup,
                            id             = vo.id_GoodsBalance,
                            Measure        = vo.Measure,
                            MinOrder       = vo.MinOrder.GetValueOrDefault(),
                            Name           = vo.Name,
                            Price          = vo.Price.GetValueOrDefault(),
                            ReqQuantity    = vo.ReqQuantity,
                            Ordered        = vo.Ordered,
                            Quantity       = vo.Balance,
                            QuantityInPack = vo.QuantityInPack.GetValueOrDefault(),
                            Reserved       = vo.Reserved.GetValueOrDefault(),
                            Supplier       = vo.Supplier,
                            SelfImport     = vo.SelfImport.GetValueOrDefault(false),
                            CommitList     = GetCommitList(commitOrders, vo.id_PreOrder)
                        };
                        balance.Add(bl);
                    }
                    return(balance);
                }
            }
            return(null);
        }
Exemplo n.º 2
0
        private BindingList<PreGoodsBalanceData> GetPreOrderList()
        {
            if (_currentOrderHeader != null)
            {
                using (var oc = UnityContainer.Resolve<OrderDataContext>())
                {
                    var orders = oc.DataBaseContext.sp_sel_PreOrderGoodsByHeader(_currentOrderHeader.IdOrderHeader).ToList();
                    var commitOrders = oc.DataBaseContext.sp_sel_PreOrderCommitGoodsByHeader(_currentOrderHeader.IdOrderHeader).ToList();

                    var balance = new BindingList<PreGoodsBalanceData>
                    {
                        AllowEdit = _currentOrderHeader.IdOrderState == 1
                    };

                    foreach (var vo in orders)
                    {
                        var bl = new PreGoodsBalanceData
                        {
                            Barcode = vo.Barcode,
                            Code = vo.Code,
                            Date = vo.Date,
                            FreeBalance = vo.FreeBalance.GetValueOrDefault(),
                            Group = vo.GoodsGroup,
                            id = vo.id_GoodsBalance,
                            Measure = vo.Measure,
                            MinOrder = vo.MinOrder.GetValueOrDefault(),
                            Name = vo.Name,
                            Price = vo.Price.GetValueOrDefault(),
                            ReqQuantity = vo.ReqQuantity,
                            Ordered = vo.Ordered,
                            Quantity = vo.Balance,
                            QuantityInPack = vo.QuantityInPack.GetValueOrDefault(),
                            Reserved = vo.Reserved.GetValueOrDefault(),
                            Supplier = vo.Supplier,
                            SelfImport = vo.SelfImport.GetValueOrDefault(false),
                            CommitList = GetCommitList(commitOrders, vo.id_PreOrder)
                        };
                        balance.Add(bl);
                    }
                    return balance;
                }
            }
            return null;
        }