Syntax
Public Function ChangeClientParam(ClientID As Integer, ParamType As Integer, InheritValue As Boolean, NewValue As String, Optional ByVal SymbolIDs As String = "-1") As String
Description
This function is used to change the Symbols and the general parameters value for the given client ID which the logged in dealer has privilege on.
Parameters
Name |
Description |
Required |
ClientID |
- The client number to get his parameters
- Type: Integer
- Default: None
|
Yes |
ParamType |
- The parameter that want to change its value
- Type : Can Be one of the ParamTypeEnum
- Default : None
|
Yes |
InheritValue |
- To indicate if the value will be inherit from the client parent or not
- Type : Boolean
- Default : None
|
Yes |
NewValue |
- The new value which want to be set if the inherit is false
- Type: String
- Default : None
|
Yes |
SymbolIDs |
- The Symbol IDs which want to change its value separated by comma(“,”).
- Type : String
- Default = “-1”
- Note : set this value (-1) when changing the client general parameter
|
No |
Response Elements
Name |
Description |
Result |
The The operation return 1 in case success , otherwise and explicit error code is returned |
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>ChangeClientParam</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script >
var hisTable;
$(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.UserId == -231) {
$("#resultData").html("You must have at least one account");
}
else if (response == null || response == "" || response.UserId < 0) {
$("#resultData").html("Error while login.Please try later");
}
else {
$("#resultData").html("SuccessResult ... UserId is :" + response.UserId);
}
}
$("#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);
});
function onSuccessResultAction(dataResult) {
dataResult = eval('(' + dataResult + ')');
$("#resultData").html(dataResult);
if (dataResult > 0) {
$("#resultData").html("SuccessResult ... :" + dataResult);
}
else {
var errDetail = "https://support.hybridsolutions.com//index.php?/Knowledgebase/Article/View/4603"
$("#resultData").html("Error Code : " + dataResult + "<br/>" + " for more details see the follwing link: " + errDetail.link(errDetail));
}
}
$("#btnAction").click(function () {
$.getJSON(urlStr + "/ChangeClientParam?ClientID=" + $("#txtClientID").val() + "&ParamType=" + $("#txtParamType").val() + "&InheritValue=" + $("#txtInheritValue").val() + "&NewValue=" + $("#txtNewValue").val() + "&SymbolIDs=" + $("#txtSymbolID").val() + "&callback=?" , onSuccessResultAction);
});
});
</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>
ClientID: <input type="text" id="txtClientID" value=""/>
ParamType: <input type="text" id="txtParamType" value=""/>
InheritValue: <input type="text" id="txtInheritValue" value=""/>
</td>
</tr>
<tr>
<td>
NewValue: <input type="text" id="txtNewValue" value=""/>
SymbolIDs: <input type="text" id="txtSymbolID" value="-1"/>
</td>
</tr>
<tr>
<td>
<button id="btnAction"> ChangeClientParam </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
|