Knowledgebase:
DeliverSymbol
Posted by Fouad Faraj Allah, Last modified by Angham Al-Banawien on 18 July 2018 12:20 PM

Syntax 

Function DeliverSymbol(AccountId As Integer, Symbol As Integer, BuySell As Integer, Items As  String, TotalAmount As Double, TicketID As Integer, DeptID As Integer, Optional ByVal note As String = "") As String

Description

The DeliverSymbol operation is used to request the delivery order for a specific given account number.

Request Parameters

Name Description  Required
 AccountId
  • The intended account identifier.
  • Type: Integer.
  • Constraints: Must be a valid account ID and accessible by logged in client.
Yes
 Symbol
  • The identifier of the symbol which the required parameter value belongs to.
  • Type: Integer.
  • Constraints: Must be a valid symbol identifier.
Yes
BuySell 
  • The delivery operation type
  • Type : Integer
  • Default :  None
  • Constrains : must be one of the following 
      1 = Buy type
     -1 = Sell type
 Yes
 Items
  • Name of the physical item.
  • Type: String.
  • Constraints: Must be a valid name.
Yes
TotalAmount
  • Order amount Lots.
  • Type: Double.
Yes
TicketID  
  • The Ticket  identifier to be delivered
  • Type : Integer
 Yes
 Note
  • String Used to mark your order.
  • Type: String.
No
DeptID
  • The department id that will received the delivery order
  • Type : Integer
  •  Must be a Brach department Type
 Yes

Response Elements

Name Description 
Result

This method returns the array that contains:

1- Order identifier/Success code in case of success, otherwise see Error Codes.
2- Operation Time.

3- Amount.
4- Symbol ID.
5- Position status (Only in case of success).
    1= Filled. 

    2= pended.
6- Note.

Type: JSON as a type of string.

 Sample

Download sample as text file.

<!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>Deliver Symbol </title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script >
$(document).ready(function () {
var urlStr = "http://5.10.64.199/vertexweb10/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);
}
}
function onErrorResult(result) {
alert('Service call faild : ' + result.status + ' ' + result.statusText);
}
$("#btnLogin").click(function () {
$.ajax({
type: 'GET',
url: urlStr + "/Login",
dataType: "jsonp",
data: { "username": $("#txtusername").val(), "password": $("#txtpassword").val() },
success: onSuccessResult,
error: onErrorResult
});
});
$("#btnAction").click(function () {
$.ajax({
type: 'Get',
url: urlStr + "/DeliverSymbol",
dataType: "jsonp",
data: { "AccountId": $("#txtAccount").val(), "Symbol": $("#txtSymbol").val(), "BuySell ": $("#txtBuySell").val(),"Items": $("#txtItems").val(), "TotalAmount": $("#txtTotalAmount").val(),"TicketID": $("#txtTicketID").val(), "DeptID": $("#txtDeptID").val(), "Note": $("#txtNote").val() },
success: function (dataResult) {
dataResult = eval(dataResult);
if (dataResult > 0) {
$("#resultAction").html("Order has been cancelled successfully!");
}
else {
$("#resultAction").html("Error Code : " + dataResult + "<br/>" + " for more details see the follwing link: http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1964");
}
},
error: onErrorResult
});
});
});
</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>
AccountId : <input type="text" id="txtAccount" value ="" /> Symbol:<input type="text" id="txtSymbol" value ="" />
BuySell: <input type="text" id="txtBuySell" value ="" /> Items: <input type="text" id="txtItems" value ="" />
Amount:<input type="text" id="txtTotalAmount" value ="" /> TicketID : <input type="text" id="txtTicketID" value ="" />
DeptID : <input type="text" id="txtDeptID" value ="" /> Note: <input type="text" id="txtNote" value ="" />
<button id="btnAction"> Deliver Symbol </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 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