UpdateAccount
Posted by Angham Al-Banawien, Last modified by Diab Mansour on 19 July 2021 09:52 PM

 Syntax

 Public Function UpdateAccount(ClientID As Integer, AccountId As Long, Islocked As Boolean, DoNotLiquidate As Boolean, isDemo As Boolean, AccountType As String, ismargin  As String, DefinedDate As String)  As String

Description

The UpdateAccount operation is used to update account information for a specific given account ID. Use GetAccountsIDs to get list of account ID that
belongs to specific client

Request Parameters

Name Description  Required
 ClientID
  • Client ID whom you want to update account for
  • Type :Integer
  • Default : None
  • Constraints : Must be valid client ID and accessible by logged in dealer

 

Yes

 AccountID
  • account number to be updated 
  • Type Long.
  • Default : None

 

 Yes

 IsLocked
  • To Indicate if the account will be locked
  • Type : Boolean
  • Default : None

 

 Yes

 DoNotLiquidate
  • Don’t liquidate when reaching Liquidation Point
  • Type : Boolean
  • Default :None

 

 Yes

 IsDemo
  • To indicate if the office is a demo or not.
  • Type : Boolean
  • Default : None

 

 Yes

 AccountType
  •  The account type
  • Type : String.
  • Default : None
  • Must be one of the defined AccountType

 

 Yes

 IsMargin  
  • To indicate if the account is margin account or physical account
  • Type : Boolean , true means is margin account
  • Default :None

 

 Yes

 DefinedDate
  • Creation account date
  • Type : String
  • Default : None
  • Constraints : must be in this format “DD/MM/YYYY HH:NN:SS

 

 Yes


Response Elements

Name Description 
 Result

The operation return updated account identifier in case success, otherwise an 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>UpdateAccount</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 ... Account ID is :" + 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 + "/UpdateAccount?ClientID=" + $("#txtClientID").val() + "&AccountID=" + $("#txtAccountID").val() + "&IsLocked=" + $("#txtIsLocked").val() + "&DoNotLiquidate=" + $("#txtDoNotLiquidate").val() + "&IsDemo=" + $("#txtIsDemo").val() + "&AccountType=" + $("#txtAccountType").val() + "&ismargin=" + $("#txtIsMargin").val() + "&DefinedDate=" + $("#txtDefinedDate").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=""/>
AccountID: <input type="text" id="txtAccountID" value=""/>
IsLocked: <input type="text" id="txtIsLocked" value=""/>
</td>
</tr>
<tr>
<td>
DonotLiquidate: <input type="text" id="txtDoNotLiquidate" value=""/>
isDemo: <input type="text" id="txtIsDemo" value=""/>
AccountType: <input type="text" id="txtAccountType" value=""/>
<tr>
<td>
isMargin: <input type="text" id="txtIsMargin" value=""/>
DefinedDate: <input type="text" id="txtDefinedDate" value=""/>
<button id="btnAction"> UpdateAccount </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

(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