private void CheckRescueOperation(object sender, ElapsedEventArgs e)
        {
            if (isChecking)
            {
                return;
            }

            bool isConnect = DaoUtil.TestConnection();

            if (!isConnect)
            {
                return;
            }

            isChecking = true;

            List <BD_RescueTableInfo> ooList = LoadResuceObject();

            if (!Utils.IsNullOrEmpty(ooList))
            {
                foreach (var ro in ooList)
                {
                    DoResuce(ro);
                }
            }
            else
            {
                DeleteAllFile();
            }

            isChecking = false;
        }
Example #2
0
 public TranData(string datapath, string zippath, string tranSql, string hostname, string uid, string pwd, string ftpdir)
 {
     this.datapath = datapath;
     FileUtil.createPath(datapath);
     this.zippath = zippath;
     FileUtil.createPath(zippath);
     this.tranSql = tranSql;
     dao          = new DaoUtil();
     ftputil      = new FtpUtil(hostname, uid, pwd, ftpdir);
 }
Example #3
0
        /// <summary>
        /// 在应用程序由最终用户正常启动时进行调用。
        /// 将在启动应用程序以打开特定文件等情况下使用。
        /// </summary>
        /// <param name="e">有关启动请求和过程的详细信息。</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            DaoUtil.InitializeDatabase();

            // 不要在窗口已包含内容时重复应用程序初始化,
            // 只需确保窗口处于活动状态
            if (rootFrame == null)
            {
                // 创建要充当导航上下文的框架,并导航到第一页
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: 从之前挂起的应用程序加载状态
                }

                // 将框架放在当前窗口中
                Window.Current.Content = rootFrame;
            }

            if (e.PrelaunchActivated == false)
            {
                if (rootFrame.Content == null)
                {
                    // 当导航堆栈尚未还原时,导航到第一页,
                    // 并通过将所需信息作为导航参数传入来配置
                    // 参数
                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
                }
                // 确保当前窗口处于活动状态
                Window.Current.Activate();
                ExtendAcrylicIntoTitleBar();
            }
        }
        /// <summary>
        /// 开始启动,进行初始化
        /// </summary>
        public static bool Start(ref string errMsg)
        {
            if (scheduler != null)
            {
                if (scheduler.IsStarted)
                {
                    return(true);
                }
            }

            //DaoUtil.Initialize();
            //删除正常退出标志
            //DaoUtil.DeleteNormalFlag();
            bool isConnectionOk = DaoUtil.TestConnection();

            if (!isConnectionOk)
            {
                errMsg = "无法连接数据库,请检查配置文件!";
                LogHelper.WriteDebug("ScheduleManager.Start" + errMsg);
                return(false);
            }

            stockOpenJob   = new StockOpenProcessJob();
            stockCloseJob  = new StockCloseProcessJob();
            futureOpenJob  = new FutureOpenProcessJob();
            futureCloseJob = new FutureCloseProcessJob();

            stockMelonCutting = new StockMelonCuttingJob();
            try
            {
                //启动内存表管理器
                //MemoryDataManager.Start();

                //===回推故障数据导入 Start===
                FailureRecoveryFactory.QHReaderToDB();
                FailureRecoveryFactory.XHReaderToDB();
                FailureRecoveryFactory.HKReaderToDB();
                //===回推故障数据导入 End===

                ISchedulerFactory schedFact = new StdSchedulerFactory();
                scheduler = schedFact.GetScheduler();

                MCService.CommonPara.Reset();
                MCService.CommonPara.Initialize();

                InitializeTriggers();

                LogHelper.WriteInfo("ScheduleManager.Start");
                scheduler.Start();

                DoOpenProcess();
                DoCloseProcess();

                #region 已经在DoOpenProcess中期货中有执行不再处理
                ////add 2010-03-16 添加对期货的清算判断,如果发现前一日没有清算完成则设置期货是否清算异常系统暂停交易,使用期台不能下单
                //DateTime ReckoningDateTime;
                //bool isReckoning = false;
                //isReckoning = StatusTableChecker.IsFutureReckoningFaultRecovery(out ReckoningDateTime, out errMsg);
                //if (isReckoning)
                //{
                //    IList<CM_BreedClass> list = MCService.CommonPara.GetAllBreedClass();
                //    foreach (var item in list)
                //    {
                //        if (item.BreedClassTypeID.Value == (int)GTA.VTS.Common.CommonObject.Types.BreedClassTypeEnum.CommodityFuture ||
                //            item.BreedClassTypeID.Value == (int)GTA.VTS.Common.CommonObject.Types.BreedClassTypeEnum.StockIndexFuture)
                //        {
                //            IsFutureReckoningErrorStopTrade = true;
                //            break;
                //        }
                //    }
                //}
                #endregion
                //==================

                IsStartSuccess = true;
            }
            catch (Exception ex)
            {
                LogHelper.WriteInfo("ScheduleManger start failure!");
                LogHelper.WriteError(ex.ToString(), ex);

                IsStartSuccess = false;
                return(false);
            }

            LogHelper.WriteInfo("ScheduleManger start success!");
            return(true);
        }
Example #5
0
        public string actualizarValor(string tabla, string columna_where, object valor_where, string columna_update, object valor_update)
        {
            DaoUtil d_util = new DaoUtil();

            return(d_util.updateValue(tabla, columna_where, valor_where, columna_update, valor_update));
        }
Example #6
0
        public string getDescTurno(string turno)
        {
            DaoUtil d_util = new DaoUtil();

            return(d_util.getDescTurno(turno));
        }
Example #7
0
        public string getLastId(string tabla, string columna)
        {
            DaoUtil d_util = new DaoUtil();

            return(d_util.getLastId(tabla, columna));
        }
Example #8
0
        public string getValueByIds(string tabla, string columna, string columna_where_1, object valor_where_1, string columna_where_2, object valor_where_2)
        {
            DaoUtil d_util = new DaoUtil();

            return(d_util.getValueByIds(tabla, columna, columna_where_1, valor_where_1, columna_where_2, valor_where_2));
        }
Example #9
0
        public string getValueById(string tabla, string columna, string columna_where, object valor_where)
        {
            DaoUtil d_util = new DaoUtil();

            return(d_util.getValueById(tabla, columna, columna_where, valor_where));
        }
Example #10
0
 public CtrPersona()
 {
     dao_persona = new DaoPersona();
     d_util      = new DaoUtil();
 }