public void TestLoadEOD() { DailyTransactionRange range = es.getTransactionRangeFor(new DateTime(2012, 10, 15)); Assert.AreEqual(247486, range.FromTxn); Assert.AreEqual(247733, range.ToTxn); }
public void TestLoadEOD() { DailyTransactionRange range = es.getTransactionRangeFor(new DateTime(2013, 9, 18)); Assert.AreEqual(range.FromTxn, 290082); Assert.AreEqual(range.ToTxn, 290293); }
private void LoadEaglesoftDataWorker_DoWork(object sender, DoWorkEventArgs e) { Eaglesoft es = new Eaglesoft(); DailyDeposit dailyDeposit = new DailyDeposit(Date); try { if (CancellationPending) { e.Cancel = true; return; } es.Connect(); DailyTransactionRange range = es.getTransactionRangeFor(Date); if (range == null) { ReportProgress(100, "No data available"); return; } queryCount = 0; totalQueryCount = es.getPaymentCount(range) + es.getRefundCount(range); List <EaglesoftBulkPayment> bulkPaymentsProcessed = new List <EaglesoftBulkPayment>(); List <Int32> paymentTxnIds = es.getPaymentTransactionIds(range); List <Int32> refundTxnIds = es.getRefundTransactionIds(range); e.Result = dailyDeposit; foreach (Int32 paymentTxnId in paymentTxnIds) { EaglesoftPayment payment = es.getPayment(paymentTxnId); EaglesoftBulkPayment bulkPayment = payment as EaglesoftBulkPayment; queryCount++; if (bulkPayment == null) { dailyDeposit.addPayment(payment); ReportProgress(calculatePercentageComplete(), String.Format("{0}", payment)); } else if (bulkPayment != null && bulkPaymentsProcessed.Contains(bulkPayment) == false) { dailyDeposit.addPayment(payment); ReportProgress(calculatePercentageComplete(), String.Format("{0}", payment)); } if (bulkPayment != null) { bulkPaymentsProcessed.Add(bulkPayment); } if (CancellationPending) { e.Cancel = true; return; } } foreach (Int32 refundTxnId in refundTxnIds) { EaglesoftRefund refund = es.getRefund(refundTxnId); dailyDeposit.addRefund(refund); queryCount++; ReportProgress(calculatePercentageComplete(), String.Format("{0}", refund)); if (CancellationPending) { e.Cancel = true; return; } } } finally { if (es != null) { es.Disconnect(); } } }