<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></span></p><p><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><html xmlns="http://www.w3.org/1999/xhtml"></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><head></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><title>GetChartScrollData</title></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><script src="http://code.jquery.com/jquery-latest.js"></script></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"></head></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><script ></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">$(document).ready(function () {</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">var urlStr = "http://5.10.64.199/vertexweb10/WebService.svc";</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">jQuery.support.cors = true;</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">$("#progress").ajaxStart(function () { $(this).css("display", "block"); });</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">$("#progress").ajaxComplete(function () { $(this).css("display", "none"); });</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">function onSuccessResult(response) {</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">response = eval('(' + response + ')')</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">if (response.UserId == -1 || response.UserId == -207) {</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">$("#resultData").html("Invalid username or password");</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">}</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">else if (response.UserId == -231) {</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">$("#resultData").html("You must have at least one account");</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">}</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">else if (response == null || response == "" || response.UserId < 0) {</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">$("#resultData").html("Error while login.Please try later");</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">}</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">else {</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">$("#resultData").html("SuccessResult ... UserId is :" + response.UserId);</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">}</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">}</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">$("#resultAction").ajaxError(function (result) { $(this).html('An error occured'); });</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">function onErrorResult(result) {</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">alert('Service call failed : ' + result.status + ' ' + result.statusText);</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">}</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">$("#btnLogin").click(function () {</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">$.getJSON(urlStr + "/Login?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?" , onSuccessResult);</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">});</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">$("#btnAction").click(function () {</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">$.getJSON(urlStr + "/GetChartScrollData?Symbol=" + $("#txtSymbol").val() + "&PeriodID=" + $("#txtPeriodID").val() + "&BeforeDate=" + $("#txtBeforeDate").val() + "&RowsNumber=" + $("#txtRowsNumber").val() + "&callback=?" , onSuccessResultOrder);</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">function onSuccessResultOrder(dataResult) {</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">dataResult = eval('(' + dataResult + ')');</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">var posRows ="<table><caption>Chart Data </caption><thead><tr ><th>Symbol ID</span></th><th>Open Price</th><th>High Price</th><th>low price</th>"</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">+ "<th>CLose Price</th><th>Volum</th>"</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">+ "<th >Symbolname</th></thead><tbody>";</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">for (var i = 0; i < dataResult.length; i++) {</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">posRows += "<tr>"</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">posRows += "<td>" + dataResult[i].SymID + "</td>";</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">posRows += "<td>" + dataResult[i].OpenPrice + "</td>";</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">posRows += "<td>" + dataResult[i].HighPrice + "</td>";</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">posRows += "<td>" + dataResult[i].LowPrice + "</td>";</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">posRows += "<td>" + dataResult[i].ClosePrice + "</td>";</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">posRows += "<td>" + dataResult[i].Volume + "</td>";</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">posRows += "<td>" + dataResult[i].CandleSym + "</td>";</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">posRows += "</tr>";</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">}</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">posRows += "</tbody></table>";</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">$("#resultAction").html(posRows);</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">}</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">});</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">});</span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"></script></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><body></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><table border="1px"></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><tbody></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><tr></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><td></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">Username: <input type="text" id="txtusername" value=""/></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;">Password: <input type="text" id="txtpassword" value=""/></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><button id="btnLogin"> Login </button></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"></td></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"></tr></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><tr></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><td>Symbol : <input type="text" id="txtSymbol" value ="" /> </td> </span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><td>Period Id: <input type="text" id="txtPeriodID" value ="" /> </td> </span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><td>Before Date: <input type="text" id="txtBeforeDate" value ="" /> </td></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><td>Rows Number: <input type="text" id="txtRowsNumber" value ="" /> </td> </span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><td><button id="btnAction"> GetChartScrollData </button></td></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"></tr></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"></tbody></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"></table></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><div id="resultData"> </div></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><div id="resultAction"> </div></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"><div style="display:none" id="progress">Loading ... </div></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"></body></span><br /><span style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"></html>
|