示例#1
0
 private DateTime GetLastModificationDate()
 {
     try
     {
         return(SapBatchService.GetLastModificationDate());
     }
     catch
     {
         return(DateTime.Today.AddYears(-10));
     }
 }
示例#2
0
 private long GetSapAuctionId(string pStrAuctFolio)
 {
     try
     {
         return(SapBatchService.GetAuctIdByFolio(pStrAuctFolio));
     }
     catch
     {
         return(0);
     }
 }
示例#3
0
 private long GetNextBatchId()
 {
     try
     {
         return(SapBatchService.GetNextBatchId());
     }
     catch
     {
         return(0);
     }
 }
示例#4
0
 private void ExportBatch(UGRS.Core.Auctions.Entities.Auctions.Batch pObjBatch)
 {
     try
     {
         if (SapBatchService.Add(GetSAPBatch(pObjBatch)) != 0)
         {
             LogUtility.Write(string.Format("[ERROR] {0}", DIApplication.Company.GetLastErrorDescription()));
         }
     }
     catch (Exception lObjException)
     {
         LogUtility.Write(string.Format("[ERROR] {0}", lObjException.ToString()));
     }
 }
示例#5
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);
                }
            }
        }
示例#6
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);
                    }
                }
            }
        }
示例#7
0
        private long GetBatchId(string pStrFolio, int pIntNumber)
        {
            long lLonId = SapBatchService.GetBatchId(pIntNumber, pStrFolio);

            return(lLonId != 0 ? lLonId : GetNextBatchId());
        }