Esempio n. 1
0
        public void UpdateBatches(DateTime pDtAuctionDate)
        {
            DateTime lDtmAuctOrLastModification = pDtAuctionDate != DateTime.MinValue ? pDtAuctionDate : GetLastCreationDate();

            //lDtmAuctOrLastModification = Convert.ToDateTime("2019-02-10 12:00:00");

            foreach (UGRS.Core.Auctions.Entities.Auctions.Batch lObjBatch in LocalBatchService.GetList().Where(x => x.ModificationDate >= lDtmAuctOrLastModification).ToList())
            {
                if (SapBatchService.HasBeenUpdated(lObjBatch.Number, lObjBatch.Auction.Folio, lObjBatch))
                {
                    UpdateBatch(lObjBatch);
                }
            }
        }
Esempio n. 2
0
        public void ExportBatches(DateTime pDtAuctionDate)
        {
            DateTime lDtmAuctOrLastDate = pDtAuctionDate != DateTime.MinValue ? pDtAuctionDate : GetLastCreationDate();
            var      lLstCardCodes      = SapBusinessPartnerService.GetCardCodesList().ToList();

            foreach (UGRS.Core.Auctions.Entities.Auctions.Batch lObjBatch in LocalBatchService.GetList().Where(x => x.CreationDate >= lDtmAuctOrLastDate).ToList())
            {
                if (lLstCardCodes.Contains(lObjBatch.Seller != null ? lObjBatch.Seller.Code : string.Empty) &&
                    lObjBatch.Buyer != null ? lLstCardCodes.Contains(lObjBatch.Buyer.Code) : true)
                {
                    if (!SapBatchService.HasBeenImported(lObjBatch.Auction.Folio, lObjBatch.Number))
                    {
                        ExportBatch(lObjBatch);
                    }
                }
            }
        }
Esempio n. 3
0
 private void UpdateAllDocuments(long pLonCurrentPartnerId, long pLonNewPartnerId)
 {
     try
     {
         //Update batches
         foreach (UGRS.Core.Auctions.Entities.Auctions.Batch lObjBatch in LocalBatchService.GetList().Where(x => x.SellerId == pLonCurrentPartnerId))
         {
             lObjBatch.SellerId = pLonNewPartnerId;
             LocalBatchService.SaveOrUpdate(lObjBatch);
         }
         foreach (UGRS.Core.Auctions.Entities.Auctions.Batch lObjBatch in LocalBatchService.GetList().Where(x => x.BuyerId == pLonCurrentPartnerId))
         {
             lObjBatch.BuyerId = pLonNewPartnerId;
             LocalBatchService.SaveOrUpdate(lObjBatch);
         }
         //Update goods receipts
         foreach (UGRS.Core.Auctions.Entities.Inventory.GoodsReceipt lObjGoodsReceipt in LocalGoodsReceiptService.GetList().Where(x => x.CustomerId == pLonCurrentPartnerId))
         {
             lObjGoodsReceipt.CustomerId = pLonNewPartnerId;
             LocalGoodsReceiptService.SaveOrUpdate(lObjGoodsReceipt);
         }
         //Update goods issues
         foreach (UGRS.Core.Auctions.Entities.Inventory.GoodsIssue lObjGoodsIssue in LocalGoodsIssueService.GetList())
         {
             LocalGoodsIssueService.SaveOrUpdate(lObjGoodsIssue);
         }
         //Update goods return
         foreach (UGRS.Core.Auctions.Entities.Inventory.GoodsReturn lObjGoodsReturn in LocalGoodsReturnService.GetList())
         {
             LocalGoodsReturnService.SaveOrUpdate(lObjGoodsReturn);
         }
     }
     catch (Exception lObjException)
     {
         LogUtility.Write(string.Format("[ERROR] {0}", lObjException.ToString()));
     }
 }