Live Chat Software by Hybrid Solutions
GetChatOrder
Posted by Angham Banawien on 15 December 2017 11:39 AM

 Syntax

 Public Function GetChatOrder() As String

Description

The GetChatOrder operation is used get the new chat orders that received to the logged in dealer web session . 

Request Parameters

No requested parameter 


Response Elements

Name Description 
 Result

The operation returns list of type ChatOrder, otherwise an explicit error code is returned if ClientID  is less than 0 .

The Following are the ChatOrder data member:

    1– OrderID : new chat order number 

    2– ChatOrderType : can be one of the following

             1 : for marketOrderType
             2 : for LimitOrderType

             3 : for SLOrderType
             4 : for TPOrderType

   3- AccountID : Account number which chat order is belongs

  4- ClientID : client number which the chat order belongs to 

  5- SymbolID  : Trading symbol identifier. 

  6- BuySell : Chat order Type can be one of the
following:

            1 : for Buy or Buy Limit
           -1 : for sell or Sell Limit

  7- NewLiq : Close or open Type can be one of the following  :

             1 : for new Type
             2 : for close Type

  8- lot : chat amount of lot  

  9- price  : the requested price

  10- OpenPrice : open price when the newLiq was liquidate Type

  11- HitPrice : order hit price when the chat type is pending order (Limit order , SL/TP order)

  12- RefHitPrice : Reference symbol hit price when the chat type is pending order (Limit order , SL/TP order)

  13- Status : can be one of the following :

             10 : for request new buy
             11 : for request new Sell
             12 : for request liq buy
             13 : for request liq sell

  14- WhoID : the ID for whom made the transaction 

  15- IP : the IP address for whom made thetransaction

  16- OpenLot : the whole amount of lots

  17- OpenTicket : ticket number which the order that had been received to chat screen.

  18- Note : String that send with the order to mark it


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>GetChatOrder</title>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script type="text/javascript" >
  var ChatTable;
$(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 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 + "/BackofficeLogin",
  dataType: "jsonp",
  data: { "username": $("#txtusername").val(), "password": $("#txtpassword").val() },
  ProcessData: false,
  success: onSuccessResult,
  error: onErrorResult
});
});

$("#btnAction").click(function () {
$.ajax({
  type: 'GET',
  url: urlStr + "/GetChatOrder",
  dataType: "jsonp",
  data: {},
success: function (Chat) {
Chat = eval('(' + Chat + ')');
var result;
 if (Chat == undefined || Chat == null || Chat.length == 0) {
   result = "No data found";
   $("#resultAction").html(result);
}
 else if (Chat[0].OrderID < 0 && Chat[0].ID > -1000) {
   result = "No data found";
   $("#resultAction").html(result);
}
 else if (Chat[0].OrderID > 0) {
   ChatTableHeader();
   for (var i = 0; i < Chat.length; i++) {
   fillChatTable(Chat[i]);
}
  ChatTable += "</tbody></table>";
}
  $("#resultData").html(ChatTable);
},
  error: onErrorResult
});
});
});

function SettledTableHeader() {
ChatTable = "";
ChatTable = "<table border='1px'><thead><tr>";
ChatTable += "<th> OrderID </th> <th>ChatOrderType</th><th >AccountID</th><th >ClientID</th>";
ChatTable += "<th>SymbolID</th><th>BuySell</th><th>lot</th><th>price</th>";
ChatTable += "<th>OpenPrice</th><th>HitPrice</th><th>RefHitPrice</th><th>NewLiq</th><th>Status</th><th>WhoID</th><th>IP</th><th>OpenLot/th><th>ClientSessionId</th><th>OpenTicket</th>";
ChatTable += "<th>DeliveryItem </th><th>Note </th>";
ChatTable += "</thead><tbody>";
}

function fillSettledTable(Chat) {

ChatTable += "<tr><td>" + Chat.OrderID + "</td>";
ChatTable += "<td>" + Chat.ChatOrderType + "</td>";
ChatTable += "<td>" + Chat.AccountID + "</td>";
ChatTable += "<td>" + Chat.ClientID + "</td>";
ChatTable += "<td>" + Chat.SymbolID + "</td>";
ChatTable += "<td>" + Chat.BuySell + "</td>";
ChatTable += "<td>" + Chat.lot + "</td>";
ChatTable += "<td>" + Chat.price + "</td>";
ChatTable += "<td>" + Chat.OpenPrice + "</td>";
ChatTable += "<td>" + Chat.HitPrice + "</td>";
ChatTable += "<td>" + Chat.RefHitPrice + "</td>";
ChatTable += "<td>" + Chat.NewLiq + "</td>";
ChatTable += "<td>" + Chat.Status + "</td>";
ChatTable += "<td>" + Chat.WhoID + "</td>";
ChatTable += "<td>" + Chat.IP + "</td>";
ChatTable += "<td>" + Chat.OpenLot + "</td>";
ChatTable += "<td>" + Chat.ClientSessionId + "</td>";
ChatTable += "<td>" + Chat.OpenTicket + "</td>";
ChatTable += "<td>" + Chat.DeliveryItem + "</td>";
ChatTable += "<td>" + Chat.Note + "</td>";

}

</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"> GetDealerSymbol </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