Esempio n. 1
0
        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);
        }