Пример #1
0
 /// <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 выполнен");
 }
Пример #2
0
        /// <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));
        }
Пример #3
0
 /// <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 });
         }
     }
 }
Пример #4
0
 public classThreadProgrammProject(JobEntity Job)
     : base(Job)
 {
 }
Пример #5
0
 public classThreadAccessUser(JobEntity Job)
     : base(Job)
 {
 }
Пример #6
0
 public classThreadStepProject(JobEntity Job)
     : base(Job)
 {
 }
Пример #7
0
        /// <summary>
        /// Метод StatusProgramm
        /// </summary>
        /// <param name="je"></param>
        public void StatusProgramm(JobEntity je)
        {
            classThreadProgrammProject pp = new classThreadProgrammProject(je);

            pp.Start();
        }
Пример #8
0
        /// <summary>
        /// Метод StepProject
        /// </summary>
        /// <param name="je"></param>
        public void StepProject(JobEntity je)
        {
            classThreadStepProject sp = new classThreadStepProject(je);

            sp.Start();
        }
Пример #9
0
        /// <summary>
        /// Метод AccessUser
        /// </summary>
        /// <param name="je"></param>
        public void AccessUser(JobEntity je)
        {
            classThreadAccessUser au = new classThreadAccessUser(je);

            au.Start();
        }