Hi,
The problem is either with my mind or with ILSMARTLINKAGE or C#!
Why doesn't this code generate the TransactionRecord object while the complier does generated it for another classes!?
program-id. ExecuteTransactionas"CoreBanking.Transactions.ExecuteTransaction".
datadivision.
working-storagesection.
77 debit-account-balance pic S9(10)V9(03) comp-3.
88 internal-accounti-id values 1 thru 7.
77 temp-credit-account pic 9(10).
linkagesection.
copy'Records\TransactionRecord'.
* Transaction Record, this is the view using Go To Definition in VisCob 2.2
01 tansaction-record.
03 transaction-id pic 9(10).
03 debit-account pic 9(10).
03 credit-account pic 9(10).
03 transaction-date pic X(10).
03 transaction-amount pic 9(10)V9(03).
03 reference-number pic 9(10).
77 operation-code pic X(10).
77 result-code pic X(50).
proceduredivisionusingbyvalueoperation-code, byreferencetansaction-recordreturningresult-code.
copy'DatabaseConnection'.
performcheck-credit-account.
ifinternal-accounti-idthen
performdebit-internal-account
else
performdebit-customer-account
end-if.
goback.
check-credit-account.
execsql
selectaccount_id
into :temp-credit-account
fromaccount
wherecredit-account = :credit-account
end-exec.
iftemp-credit-accountnotequaltocredit-accountthen
move'credit account does not exist'toresult-code
goback
end-if.
debit-internal-account.
execsql
insertintobank_transaction(DEBIT_ACCOUNT, CREDIT_ACCOUNT, AMOUNT)
values(:debit-account, :credit-account, :transaction-amount)
end-exec.
execsql
commit
end-exec.
move'Transaction completed'toresult-code.
debit-customer-account.
execsql
selectbalance
into :debit-account-balance
from
(
selectsum(credit), sum(debit), sum(credit) - sum(debit) asbalancefrom
(
selecttransaction_idasvoucher,transaction_date, amountascredit, 0 asdebit
frombank_transaction
wherecredit_account = :credit-account
union
selecttransaction_id,transaction_date, 0 ascredit, amountasdebit
frombank_transaction
wheredebit_account = :credit-account
)
)
end-exec.
ifdebit-account-balance<= transaction-amountthen
execsql
insertintobank_transaction(DEBIT_ACCOUNT, CREDIT_ACCOUNT, AMOUNT)
values(:debit-account, :credit-account, :transaction-amount)
end-exec
execsql
commit
end-exec
move'Transaction Was Successfuly Completed'toresult-code
else
move'Insufficient Funds!'toresult-code
end-if.
execsql
disconnectcurrent
end-exec.
sql-error-routine.
move'internal error'toresult-code.
endprogramExecuteTransaction.