Syntax
Function GetTransactions (AfterID As Long)
Description
The GetTransactions operation is used to return the transactions log after the specific transaction log ID. before calling this operation you have to call GetAccountTransaction to get the id's of the transactions
Request Parameters
Name |
Description |
Required |
AfterID |
- The report will show the transactions that after this ID.
- Type: Long
- Default: 0
|
No
|
Response Elements
Name |
Description |
Result |
In case of success the following are the Transaction Data member:
In case of success, this operation returns the success code. Otherwise see Error codes.
|
Sample
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Transaction Log</title>
<script src="http://code.jquery.com/jquery-latest.js" ></script>
</head>
<script >
$(document).ready(function () {
var urlStr = "http://173.249.35.43/webtrader/webservice.svc";
jQuery.support.cors = true;
$("#progress").ajaxStart(function () { $(this).css("display", "block"); });
$("#progress").ajaxComplete(function () { $(this).css("display", "none"); });
function onSuccessResult(response) {
response = eval('(' + response + ')')
if (response.UserId == -1 || response.UserId == -207) {
$("#resultData").html("Invalid username or password");
}
else if (response == null || response == "" || response.UserId < 0) {
$("#resultData").html("Error while login.Please try later");
}
else {
$("#resultData").html("SuccessResult ... SessionID is :" + response.sessionid);
}
}
$("#resultAction").ajaxError(function (result) { $(this).html('An error occured'); });
function onErrorResult(result) {
alert('Service call faild : ' + result.status + ' ' + result.statusText);
}
$("#btnLogin").click(function () {
$.getJSON(urlStr + "/BackofficeLogin?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?", onSuccessResult);
});
$("#btnAction").click(function () {
$.getJSON(urlStr + "/GetTransactions?AfterID=" + $("#AfterID").val() + "&callback=?", onSuccessResult);
function onSuccessResult(dataResult) {
result = eval('(' + dataResult + ')');
if (result != null) {
var myTable = '<table border="1px"><thead>' +
'<tr><th>AccountID</th> <th>Amount</th><th>BuySell</th><th>ClientID</th>' +
'<th >ClosePrice</th><th>Commission</th><th>DateTime</th><th>Interest</th>' +
'<th>IP</th><th>Method</th>' +
'<th>Price</th><th>Profit</th><th>RefPrice</th>' +
'<th >SymbolID</th><th>SymbolName</th><th>Ticket</th>' +
'<th>Ticket2</th><th>TransID</th><th>TransLogSubType</th>' +
'<th >TransLogType</th><th>TransType</th><th>WhoID</th><th>WhoType</th>' +
'</tr></thead><tbody>';
for (var i = 0; i <= result.length - 1; i++) {
myTable += "<tr>"
myTable += "<td>" + result[i].AccountID + "</td>"
myTable += "<td>" + result[i].Amount + "</td>"
myTable += "<td>" + result[i].BuySell + "</td>"
myTable += "<td>" + result[i].ClientID + "</td>"
myTable += "<td>" + result[i].ClosePrice + "</td>"
myTable += "<td>" + - result[i].Commission + "</td>"
myTable += "<td>" + result[i].DateTime + "</td>"
myTable += "<td>" + result[i].Interest + "</td>"
myTable += "<td>" + result[i].IP + "</td>"
myTable += "<td>" + result[i].Method + "</td>"
myTable += "<td>" + result[i].Price + "</td>"
myTable += "<td>" + result[i].Profit + "</td>"
myTable += "<td>" + result[i].RefPrice + "</td>"
myTable += "<td>" + result[i].SymbolID + "</td>"
myTable += "<td>" + result[i].SymbolName + "</td>"
myTable += "<td>" + result[i].Ticket + "</td>"
myTable += "<td>" + result[i].Ticket2 + "</td>"
myTable += "<td>" + result[i].TransID + "</td>"
myTable += "<td>" + result[i].TransLogSubType + "</td>"
myTable += "<td>" + result[i].TransLogType + "</td>"
myTable += "<td>" + result[i].TransType + "</td>"
myTable += "<td>" + result[i].WhoID + "</td>"
myTable += "<td>" + result[i].WhoType + "</td>"
myTable += "</tr>"
}
myTable += '</tbody></table>';
}
$("#resultAction").html(myTable);
}
});
});
</script>
<body>
<table border="1px">
<tbody>
<tr>
<td>
username: <input type="text" id="txtusername" value=""/>
password: <input type="text" id="txtpassword" value=""/>
<button id="btnLogin"> Login </button>
</td>
</tr>
<tr>
<td>After ID: <input type="text" id="AfterID" value ="0" /> </td>
<td><button id="btnAction"> Transaction Log </button></td>
</tr>
</tbody>
</table>
<div id="resultData">
</div><div id="resultAction">
</div><div style="display:none" id="progress">Loading ... </div>
</body>
</html>
See Also
VertexFX Backoffice WCF Service Index
|