Esempio n. 1
0
        public void Test1()
        {
            T8TaskEntity t8Task = new T8TaskEntity();

            t8Task.TaskTitle    = "传8月采集任务";
            t8Task.GenerateTime = DateTime.Now;
            t8Task.T8TaskStatus = T8TaskStatus.Created;

            T8FileEntity fileEntity = new T8FileEntity();

            fileEntity.SqlString            = "select * from dual";
            fileEntity.SqlStartTime         = DateTimeMaster.LastMonthBegin(DateTime.Now);
            fileEntity.SqlEndTime           = DateTimeMaster.LastMonthEnd(DateTime.Now);
            fileEntity.DbFileType           = DbFileType.SQLite;
            fileEntity.GroupName            = "月数据采集组";
            fileEntity.JobName              = "月数据采集作业";
            fileEntity.QuartzCronExpression = "0/10 * * * * ?";

            t8Task.T8FileEntity = fileEntity;

            ScheduleBase.Scheduler.Start();
            T8TaskJobService jobService = new T8TaskJobService();

            jobService.T8TaskEntity = t8Task;
            ScheduleBase.AddSchedule(jobService);

            Thread.Sleep(TimeSpan.FromSeconds(120));
        }
Esempio n. 2
0
        public void Start()
        {
            //开启调度器
            ScheduleBase.Scheduler.Start();

            //把作业,触发器加入调度器
            ScheduleBase.AddSchedule(new TestJobService(), 20);
        }
Esempio n. 3
0
 protected override void OnStart(string[] args)
 {
     Logger.Info("OnStart()");
     try
     {
         //开启调度器
         ScheduleBase.Scheduler.Start();
         //把作业,触发器加入调度器
         ScheduleBase.AddSchedule(new TimeService());
         ScheduleBase.AddSchedule(new LogService());
     }
     catch (Exception ex)
     {
         Logger.Error("TestQuarzNetWin异常", ex);
     }
 }