Esempio n. 1
0
        public List <HKTraderQuerySevice.HK_HistoryModifyOrderRequestInfo> QueryHKModifyOrderRequest(string entrustNumber, DateTime?startTime, DateTime?endTime, ref string strMessage
                                                                                                     , int selectType)
        {
            if (!IsServiceOk)
            {
                return(new List <HKTraderQuerySevice.HK_HistoryModifyOrderRequestInfo>());
            }
            HKTraderQuerySevice.PagingInfo pageInfo = new HKTraderQuerySevice.PagingInfo();
            pageInfo.CurrentPage = 0;
            pageInfo.IsCount     = false;
            pageInfo.PageLength  = int.MaxValue;

            List <HKTraderQuerySevice.HK_HistoryModifyOrderRequestInfo> tets = new List <HKTraderQuerySevice.HK_HistoryModifyOrderRequestInfo>();
            int icount;

            try
            {
                HKTraderQuerySevice.HKTraderQueryClient cline = new HKTraderQuerySevice.HKTraderQueryClient();

                tets = cline.PagingQueryHK_ModifyRequertByUserIDOrEntrustNo(out icount, out strMessage, traderId, entrustNumber, startTime, endTime, selectType, pageInfo);
            }
            catch (Exception ex)
            {
            }
            return(tets);
        }
Esempio n. 2
0
        public bool Initialize(string _channelID)
        {
            bool result = false;

            try
            {
                doOrderClient = new DoOrderClient();
                ICommunicationObject co1 = doOrderClient;
                co1.Faulted += CO_Faulted;

                traderFindClient = new TraderFindClient();
                ICommunicationObject co2 = traderFindClient;
                co2.Faulted += CO2_Faulted;

                OrderCallBack callBack = new OrderCallBack();
                rptClient = new OrderDealRptClient(new InstanceContext(callBack));
                ICommunicationObject co3 = rptClient;
                co3.Faulted += CO3_Faulted;

                accountClient = new AccountAndCapitalManagementClient();
                ICommunicationObject co4 = accountClient;
                co4.Faulted += co4_Faulted;

                //hkTraderQueryClient = new HKTraderQueryClient();
                //ICommunicationObject co5 = hkTraderQueryClient;
                //co5.Faulted += co5_Faulted;

                hkTraderFindClient = new HKTraderFindClient();
                ICommunicationObject co6 = hkTraderFindClient;
                co6.Faulted += co6_Faulted;

                hkTraderQueryClient = new HKTraderQuerySevice.HKTraderQueryClient();

                commonQueryClient = new TraderQueryClient();

                IsServiceOk = true;
                if (string.IsNullOrEmpty(_channelID))
                {
                    Channelid = ServerConfig.ChannelID;
                    if (string.IsNullOrEmpty(Channelid))
                    {
                        Channelid = CommUtils.GetMacAddress();
                        ServerConfig.ChannelID = Channelid;
                    }
                }
                else
                {
                    Channelid = _channelID;
                }
                result = rptClient.RegisterChannel(Channelid);

                if (result)
                {
                    string msg = "WCF Service [DoOrderService] is connected! " + DateTime.Now;
                    WriteMsg(msg);

                    string msg2 = "WCF Service [TradeFindService] is connected! " + DateTime.Now;
                    WriteMsg(msg2);

                    string msg3 = "WCF Service [DoDealRptService] is connected! " + DateTime.Now;
                    WriteMsg(msg3);

                    WriteMsg("");
                }
                else
                {
                    IsServiceOk = false;
                }

                if (IsServiceOk)
                {
                    timer          = new Timer();
                    timer.Interval = 10 * 1000;
                    timer.Elapsed += CheckRptChannel;
                    timer.Enabled  = true;
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteError(ex.Message, ex);
            }

            return(result);
        }