/// <summary> /// Минутный тригер /// </summary> /// <param name="je"></param> public void Test(JobEntity je) { chfdb.SaveStatus(je.IDJob, "Job запущен"); je.Start = DateTime.Now; je.Stop = DateTime.Now; chfdb.UpdateTimeRunJob(je); chfdb.SaveStatus(je.IDJob, "Job выполнен"); }
/// <summary> /// Обновить состояние выполнения задания /// </summary> /// <param name="job"></param> /// <returns></returns> public int UpdateTimeRunJob(JobEntity job) { if (job == null) { return(0); } string sql = "UPDATE " + this._NameTableHangFireListJobs + " SET [Start] = CONVERT(DATETIME, '" + ((DateTime)job.Start).ToString("yyyy-MM-dd HH:mm:ss") + "', 102) ,[Stop] = CONVERT(DATETIME, '" + ((DateTime)job.Stop).ToString("yyyy-MM-dd HH:mm:ss") + "', 102) WHERE [IDJob] = " + job.IDJob.ToString(); return(Update(sql)); }
/// <summary> /// Запустить задачу /// </summary> /// <param name="je"></param> public void StartJob(JobEntity je) { MethodInfo[] methods = typeof(classHangfireJobs).GetMethods(); foreach (MethodInfo info in methods) { // Call Win method. if (info.Name == je.Metod) { info.Invoke(this, new object[] { (object)je }); } } }
public classThreadProgrammProject(JobEntity Job) : base(Job) { }
public classThreadAccessUser(JobEntity Job) : base(Job) { }
public classThreadStepProject(JobEntity Job) : base(Job) { }
/// <summary> /// Метод StatusProgramm /// </summary> /// <param name="je"></param> public void StatusProgramm(JobEntity je) { classThreadProgrammProject pp = new classThreadProgrammProject(je); pp.Start(); }
/// <summary> /// Метод StepProject /// </summary> /// <param name="je"></param> public void StepProject(JobEntity je) { classThreadStepProject sp = new classThreadStepProject(je); sp.Start(); }
/// <summary> /// Метод AccessUser /// </summary> /// <param name="je"></param> public void AccessUser(JobEntity je) { classThreadAccessUser au = new classThreadAccessUser(je); au.Start(); }