/// <summary> /// 主页面加载事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { ManagementCenter.BLL.WCFService_Out.TransactionManageService Tms = new TransactionManageService(); Tms.StartUpdateService();//每次启动管理中心服务时更新同步数据 try { commonParaHost = new ServiceHost(typeof(CommonParaService)); commonParaHost.Open(); spotTradeRulesHost = new ServiceHost(typeof(SpotTradeRulesService)); spotTradeRulesHost.Open(); futuresTradeRulesHost = new ServiceHost(typeof(FuturesTradeRulesService)); futuresTradeRulesHost.Open(); transactionManageHost = new ServiceHost(typeof(TransactionManageService)); transactionManageHost.Open(); hkTradeRulesHost = new ServiceHost(typeof(HKTradeRulesService)); hkTradeRulesHost.Open(); } catch (Exception ex) { this.Text = "管理中心服务开启失败"; LogHelper.WriteError("管理中心服务开启失败", ex); //ex.InnerException); throw ex; } StartTestConn(); StartUpdate(); }
/// <summary> /// 开始启动更新服务 /// </summary> private static void StartUpdate() { ManagementCenter.BLL.WCFService_Out.TransactionManageService Tms = new TransactionManageService(); Tms.Start(); }