Syntax
Public Function GetClient() As String
Description
The GetClient operation is used to return the client information which is under the logged in dealer.
Request Parameters
No request parameters.
Response Elements
Name |
Description |
Result |
The operation returns 1 in case successfully otherwise an explicit error code is returned.
The following are the Client data members
- ClientID : client identifier .
- ParentID : parent identifier which the client is belong to .
- UserName : client username.
- FirstName : client first name.
- SecondName : client second name.
- ThirdName : client third name.
- LastName : client last name.
- Phone : client phone.
- Email : client Email.
- Address : client address.
- Country : client country.
- Mobile : client mobile phone.
- TelFax : client telefax.
- Pop : Client pop.
- Fax : client fax number.
- Demo : Boolean value which detects if the client is demo or not.
- Read_Only : Boolean value which detects if the client is read only or not.
- ClientType(1 = Client Type, 2 = Office type , 3 = Group Type)
- ForceChangePW : Boolean value which detects if the client will force change password after first login.
- List of type Account which contains the following
- AccountID : account identifier
- AccountType : (1 = normal account , 2= coverage account)
- IsMargin : Boolean value to detect if the account is margin or not.
- DemoAccount : Boolean value to detect if the account is demo or not.
- LockLiquidate : Boolean value to detect if the account is locked or not.
- ChildClients : List of type Client
- EnableInterest : Boolean value to detect if the Interest is enable or not.
- FullName : full client name
- LiqPoint : liquidation point value
- LiqType : (1 = EQUITY_LIQUIDATION , 2 = MARGIN_LEVEL_LIQUIDATION )
- ClientParams as type of ClientParam which contains the following:
- AskWithSpread
- BidWithSpread
- Commission
- LimitOffset
- MaxLots
- MinLots
- Parent : of list of type client
- PriceWithSpread
- Spread
- StopOffset
- Symbol
|
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>GetClient</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script type="text/javascript" >
var ClientInfoTable;
$(document).ready(function () {
var urlStr = "http://5.10.64.199/vertexweb10/WebService.svc";
$.support.cors = true;
$.ajaxSetup({ cash: false });
function onSuccessResult(response) {
response = eval('(' + response + ')')
if (response.UserId == -1 || response.UserId == -207) {
$("#resultData").html("Invalid username or password");
}
else if (response.UserId == -231) {
$("#resultData").html("You must have at least one Client");
}
else if (response == null || response == "" || response.UserId < 0) {
$("#resultData").html("Error while login.Please try later");
}
else {
$("#resultData").html("SuccessResult ... UserId is :" + response.UserId);
}
}
function onErrorResult(result) {
alert('Service call faild : ' + result.status + ' ' + result.statusText);
}
$("#btnLogin").click(function () {
$.ajax({
type: 'GET',
url: urlStr + "/BackofficeLogin",
dataType: "jsonp",
data: { "username": $("#txtusername").val(), "password": $("#txtpassword").val() },
ProcessData: false,
success: onSuccessResult,
error: onErrorResult
});
});
$("#btnAction").click(function () {
$.ajax({
type: 'GET',
url: urlStr + "/GetClient",
dataType: "jsonp",
data: {},
success: function (ClientInfo) {
ClientInfo = eval('(' + ClientInfo + ')');
var result;
if (ClientInfo == undefined || ClientInfo == null || ClientInfo.length == 0) {
result = "No data found";
$("#resultAction").html(result);
}
else if (ClientInfo.ClientID < 0 && ClientInfo.ClientID > -1000) {
result = "No data found error code " + ClientInfo.ClientID ;
$("#resultAction").html(result);
}
else if (ClientInfo.ClientID > 0 || ClientInfo.ClientID == -1200) {
ClientInfoTableHeader();
for (var i = 0; i < ClientInfo.length; i++) {
fillClientInfoTable(ClientInfo[i]);
}
ClientInfoTable += "</tbody></table>";
}
$("#resultData").html(ClientInfoTable);
},
error: onErrorResult
});
});
});
function ClientInfoTableHeader() {
ClientInfoTable = "";
ClientInfoTable = "<table border='1px'><thead><tr>";
ClientInfoTable += "<th> ClientID </th> <th>ParentID </th><th >UserName </th><th >FirstName </th>";
ClientInfoTable += "<th>SecondName </th><th>ThirdName</th><th>LastName</th><th>Demo /SL</th>";
ClientInfoTable += "<th>Read_Only </th><th>ClientType</th>";
ClientInfoTable += "</thead><tbody>";
}
function fillClientInfoTable(ClientInfoo) {
ClientInfoTable += "<tr><td>" + ClientInfoo.ClientID + "</td>";
ClientInfoTable += "<td>" + ClientInfoo.ParentID + "</td>";
ClientInfoTable += "<td>" + ClientInfoo.Username + "</td>";
ClientInfoTable += "<td>" + ClientInfoo.FirstName + "</td>";
ClientInfoTable += "<td>" + ClientInfoo.SecondName + "</td>";
ClientInfoTable += "<td>" + ClientInfoo.ThirdName + "</td>";
ClientInfoTable += "<td>" + ClientInfoo.LastName + "</td>";
ClientInfoTable += "<td>" + ClientInfoo.Demo + "</td>";
ClientInfoTable += "<td>" + ClientInfoo.Read_Only + "</td>";
ClientInfoTable += "<td>" + ClientInfoo.ClientType + "</td></tr>";
}
</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>
<button id="btnAction"> GetClient </button>
</td>
</tr>
</tbody>
</table>
<div id="resultData"> </div>
<div id="resultAction"> </div>
</body>
</html>
See Also
VertexFX Backoffice WCF Service Index
|