﻿var CallStockHelper = function()
{
    this.currentprice = null;
    this.currentfloat = null;
    this.stockname = null;
    this.LoadCurrentPrice = function(code)
    {
        var _OnCompleted=Function.createDelegate(this,this.LoadCurrentPriceCompleted);
        var _ErrorHandler=Function.createDelegate(this,this.OnError);
        zrweb.WebService.CallStockServices.GetCurrentPrice(code,_OnCompleted,_ErrorHandler);
    }
    
    this.LoadCurrentPriceCompleted = function(result)
    {
        if(result)
        {
            //alert("ok");
            document.getElementById("gupiaoPrice").innerHTML = result +　"&nbsp&nbsp&nbsp";
        }
    }
    
    this.OnError = function(result)
    {
        alert("失败"+result._message);
    }
    
    this.LoadCurrentFloat = function(code)
    {
        var _OnCompleted=Function.createDelegate(this,this.LoadCurrentFloatCompleted);
        var _ErrorHandler=Function.createDelegate(this,this.OnError);
        zrweb.WebService.CallStockServices.GetCurrentFloat(code,_OnCompleted,_ErrorHandler);
    }
    
    this.LoadCurrentFloatCompleted = function(result)
    {
        if(result)
        {
            //alert("ok");
            document.getElementById("gupiaoFloat").innerHTML = result +　"&nbsp&nbsp&nbsp";
        }
    }
    
    this.LoadStockName = function(code)
    {
        var _OnCompleted=Function.createDelegate(this,this.LoadStockNameCompleted);
        var _ErrorHandler=Function.createDelegate(this,this.OnError);
        zrweb.WebService.CallStockServices.GetStockName(code,_OnCompleted,_ErrorHandler);
    }
    
    this.LoadStockNameCompleted = function(result)
    {
        if(result)
        {
            //alert("ok");
            document.getElementById("gupiaoName").innerHTML = result　+　"&nbsp&nbsp&nbsp"; 
;
        }
    }
    
    
}
