示例#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();
        }