public void Perform() { SWIGTYPE_p_AB_JOB_LIST2 list = AB.AB_Job_List2_new(); AB.AB_Job_List2_PushBack(list, this.AqJobHandle); var ctx = AB.AB_ImExporterContext_new(); int rv = AB.AB_Banking_ExecuteJobs(abHandle, list, ctx); if (rv < 0) { throw new Exception("Aqbanking ExecuteJobs() failed with returncode: " + rv); } var accinfo = AB.AB_ImExporterContext_GetAccountInfo(ctx, Account.BankIdentifier, Account.AccountIdentifier); var accstatus = AB.AB_ImExporterAccountInfo_GetFirstAccountStatus(accinfo); if (accstatus == null) { throw new Exception("Could not get balance for account"); } var bal = AB.AB_AccountStatus_GetBookedBalance(accstatus); var val = AB.AB_Balance_GetValue(bal); this.RequestedBalance = (float)AB.AB_Value_GetValueAsDouble(val); }
public void Perform() { // narrow the timespam from which we retrieve the transactions AB.AB_JobGetTransactions_SetFromTime(AqJobHandle, AqHelper.convertToGwenTime(FromTime)); AB.AB_JobGetTransactions_SetToTime(AqJobHandle, AqHelper.convertToGwenTime(ToTime)); // create a new aqbanking job for transaction retrieving SWIGTYPE_p_AB_JOB_LIST2 list = AB.AB_Job_List2_new(); AB.AB_Job_List2_PushBack(list, this.AqJobHandle); var ctx = AB.AB_ImExporterContext_new(); int rv = AB.AB_Banking_ExecuteJobs(abHandle, list, ctx); if (rv < 0) { throw new Exception("Aqbanking ExecuteJobs() failed with return code: " + rv); } var accinfo = AB.AB_ImExporterContext_GetAccountInfo(ctx, Account.BankIdentifier, Account.AccountIdentifier); // fill our transactions list from aqbanking var trans = AB.AB_ImExporterAccountInfo_GetFirstTransaction(accinfo); while (trans != null) { AqTransaction transaction = new AqTransaction(trans); this.Transactions.Add((ITransaction)transaction); trans = AB.AB_ImExporterAccountInfo_GetNextTransaction(accinfo); } }