Exemple #1
0
        private void OnAddOrderLine(object obj)
        {
            SelBFEPurchaseOrderLineDTO = new BFEPurchaseOrderLineDTO
            {
                Id = RandomHelper.Next(),
                Amount = 1,
                EstimateDeliveryDate = DateTime.Now,
            };

            SelBFEPurchaseOrderDTO.BFEPurchaseOrderLines.Add(SelBFEPurchaseOrderLineDTO);
        }
Exemple #2
0
 private void OnAddOrder(object obj)
 {
     if (SelBFEPurchaseOrderDTO == null)
     {
         SelBFEPurchaseOrderDTO = new BFEPurchaseOrderDTO
         {
             Id = RandomHelper.Next(),
             OrderDate = DateTime.Now,
             TradeId = _selTradeDTO.Id,
             SourceGuid = Guid.NewGuid(),
             SupplierId = _selTradeDTO.SupplierId,
             OperatorName = StatusData.curUser
         };
         var currency = Currencies.FirstOrDefault();
         if (currency != null)
             SelBFEPurchaseOrderDTO.CurrencyId = currency.Id;
         ViewBFEPurchaseOrderDTO.AddNew(SelBFEPurchaseOrderDTO);
         SelTradeDTO.Status = (int) TradeStatus.进行中;
     }
     else
     {
         var order =
             ViewBFEPurchaseOrderDTO.Where(o => o.TradeId == _selTradeDTO.Id)
                 .OrderBy(o => o.Version)
                 .LastOrDefault();
         if (order == null) return;
         SelBFEPurchaseOrderDTO = new BFEPurchaseOrderDTO
         {
             Id = RandomHelper.Next(),
             OrderDate = DateTime.Now,
             TradeId = order.TradeId,
             Name = order.Name,
             CurrencyId = order.CurrencyId,
             LinkmanId = order.LinkmanId,
             SourceGuid = Guid.NewGuid(),
             SupplierId = order.SupplierId,
             OperatorName = StatusData.curUser
         };
         var currency = Currencies.FirstOrDefault();
         if (currency != null)
             SelBFEPurchaseOrderDTO.CurrencyId = currency.Id;
         ViewBFEPurchaseOrderDTO.AddNew(SelBFEPurchaseOrderDTO);
         order.BFEPurchaseOrderLines.ToList().ForEach(line =>
         {
             var newLine = new BFEPurchaseOrderLineDTO
             {
                 Id = RandomHelper.Next(),
                 UnitPrice = line.UnitPrice,
                 Amount = line.Amount,
                 Discount = line.Discount,
                 EstimateDeliveryDate = line.EstimateDeliveryDate,
                 Note = line.Note,
                 Status = line.Status
             };
             SelBFEPurchaseOrderDTO.BFEPurchaseOrderLines.Add(newLine);
         });
     }
     RefreshCommandState();
 }