Пример #1
0
        public void StartStatistics()
        {
            List <Sys_Line> lstLine;
            string          strLocalServerIP = ConfigurationManager.AppSettings["LocalServerIP"];
            String          libAddress       = "net.tcp://lib.kingrocket.com:8066/TransferService.svc";
            object          objLib           = CallRemoteServerMethod(libAddress, "Yqun.BO.BusinessManager.dll", "GetStatisticsLinesByIP",
                                                                      new Object[] { strLocalServerIP });

            if (objLib != null)
            {
                lstLine = objLib as List <Sys_Line>;
                foreach (Sys_Line line in lstLine)
                {
                    Logger.Info("开始同步线路 " + line.LineName + " 的数据");
                    Console.WriteLine("开始同步线路 " + line.LineName + " 的数据");
                    var service = new StatisticsRunner(line);
                    service.StartApplyQueue();

                    Thread.Sleep(1000);
                }
            }
            else
            {
                Logger.Info(string.Format("没有需要同步的线路"));
            }
        }
Пример #2
0
        private void StartStatistics()
        {
            List <Sys_Line> lstLine;
            string          strLocalServerIP = ConfigurationManager.AppSettings["LocalServerIP"];
            String          libAddress       = "net.tcp://lib.kingrocket.com:8066/TransferService.svc";
            object          objLib           = CallRemoteServerMethod(libAddress, "Yqun.BO.BusinessManager.dll", "GetStatisticsLinesByIP",
                                                                      new Object[] { strLocalServerIP });

            if (objLib != null)
            {
                lstLine = objLib as List <Sys_Line>;
                foreach (Sys_Line line in lstLine)
                {
                    Logger.Info("开始同步线路 " + line.LineName + " 的数据");

                    ThreadPool.QueueUserWorkItem(delegate
                    {
                        var runner = new StatisticsRunner(line);
                        runner.Start();
                    });
                }
            }
            else
            {
                Logger.Info(string.Format("没有需要同步的线路"));
            }
        }