GetClient
Posted by Angham Al-Banawien, Last modified by Ismail Moamer on 13 December 2019 01:06 PM

 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
  1.  AccountID : account identifier
  2.  AccountType : (1 = normal account , 2=  coverage account)
  3.  IsMargin : Boolean value to detect if the account is margin or not.
  4.  DemoAccount : Boolean value to detect if the account is demo or not.
  5.  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:
  1.  AskWithSpread
  2.  BidWithSpread
  3.  Commission
  4.  LimitOffset
  5.  MaxLots
  6.  MinLots
  7.  Parent : of list of type client
  8.  PriceWithSpread
  9.  Spread
  10.  StopOffset
  11.  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

 

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Hybrid Solutions