예제 #1
0
        protected override TraderResult internalGetTodayTradeList()
        {
            GetTodayTradeRequest t = new GetTodayTradeRequest
            {
                branch_no     = this.resAccountInfo.branch_no,
                custid        = this.resAccountInfo.fund_account,
                fund_account  = this.resAccountInfo.fund_account,
                op_branch_no  = this.resAccountInfo.branch_no,
                op_station    = this.resAccountInfo.op_station,
                password      = this.resAccountInfo.trdpwd,
                uid           = this.resAccountInfo.uid,
                exchange_type = ""
            };

            GetTodayTradeResponse resp = getResp <GetTodayTradeResponse, GetTodayTradeRequest>(t);
            TraderResult          ret  = new TraderResult();

            ret.Result = resp;
            if (resp.cssweb_code == SuccessCode)
            {
                ret.Code = TraderResultEnum.SUCCESS;
            }
            else
            {
                ret.Code    = TraderResultEnum.ERROR;
                ret.Message = String.Format("错误代码{0}, 错误内容{1}", resp.cssweb_code, resp.cssweb_msg);
            }

            return(ret);
        }
예제 #2
0
        protected override TraderResult internalGetTodayTradeList()
        {
            GetTodayTradeRequest t = new GetTodayTradeRequest
            {
                branch_no     = this.resAccountInfo.branch_no,
                custid        = this.resAccountInfo.fund_account,
                fund_account  = this.resAccountInfo.fund_account,
                op_branch_no  = this.resAccountInfo.branch_no,
                op_station    = this.resAccountInfo.op_station,
                password      = this.resAccountInfo.trdpwd,
                uid           = this.resAccountInfo.uid,
                exchange_type = ""
            };

            GetTodayTradeResponse resp = getResp <GetTodayTradeResponse, GetTodayTradeRequest>(t);
            TraderResult          ret  = new TraderResult();

            if (resp.cssweb_code == SuccessCode)
            {
                ret.Code = TraderResultEnum.SUCCESS;
                TradingList tradingList = new TradingList();
                foreach (GetTodayTradeResponse.GetTodayTradeRespItem item in resp.Item)
                {
                    tradingList.Add(new TradingList.TradingItem
                    {
                        StockName       = item.stock_name,
                        StockCode       = item.stock_code,
                        SerialNo        = item.serial_no,
                        BusinessAmount  = item.business_amount,
                        BusinessPrice   = item.business_price,
                        BusinessBalance = item.business_balance,
                        EntrustNo       = item.entrust_no,
                        Remark          = item.remark,
                        StockAccount    = item.stock_code,
                        ExchangeType    = item.exchange_type,
                        bs_name         = item.bs_name,
                        Date            = item.date
                    });
                }
                ret.Result = tradingList;
            }
            else
            {
                ret.Code    = TraderResultEnum.ERROR;
                ret.Message = String.Format("错误代码{0}, 错误内容{1}", resp.cssweb_code, resp.cssweb_msg);
            }

            return(ret);
        }