private DateTime GetLastModificationDate() { try { return(SapBatchService.GetLastModificationDate()); } catch { return(DateTime.Today.AddYears(-10)); } }
private long GetSapAuctionId(string pStrAuctFolio) { try { return(SapBatchService.GetAuctIdByFolio(pStrAuctFolio)); } catch { return(0); } }
private long GetNextBatchId() { try { return(SapBatchService.GetNextBatchId()); } catch { return(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())); } }
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); } } }
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); } } } }
private long GetBatchId(string pStrFolio, int pIntNumber) { long lLonId = SapBatchService.GetBatchId(pIntNumber, pStrFolio); return(lLonId != 0 ? lLonId : GetNextBatchId()); }