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

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

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

            au.Start();
        }