//public static string DB_Name = GetCommonConfig.GetTCSceneryShopDataName(); /// <summary> /// 默认程序启动项 /// </summary> public static void AddJob() { try { DataTable dt = GetAllValidJob(); //if (ConvertHelper.CheckDataTable(dt)) //{ foreach (DataRow dr in dt.Rows) { IDictionary <string, string> dicParams = new Dictionary <string, string>(); dicParams.Add("type", dr["MType"].ToString()); dicParams.Add("triggerid", dr["Id"].ToString()); dicParams.Add("CronExpr", dr["CronExpr"].ToString()); dicParams.Add("TriggerUrl", dr["TriggerUrl"].ToString()); JobManagerBase.AddJob(dr["TriggerName"].ToString(), dicParams); } //} } catch (Exception ex) { Log4NetHelper.WriteExceptionLog("ShopQuartz异常", string.Format("详细信息【{0}】,发送时间【{1}】", ex.ToString(), DateTime.Now)); } }
///// <summary> ///// 暂停作业 ///// </summary> //public void Suspend() //{ // JobManagerBase.PauseJob(this.JobName); // Log4NetHelper.WriteRunLog("ShopQuartz job【" + this.JobName + "】暂停"); //} ///// <summary> ///// 恢复作业 ///// </summary> //public void Resume() //{ // JobManagerBase.ResumeJob(this.JobName); // Log4NetHelper.WriteRunLog("ShopQuartz job【" + this.JobName + "】恢复"); //} /// <summary> /// 移除作业 /// </summary> public void Remove() { JobManagerBase.RemoveJob(this.JobName); Log4NetHelper.WriteRunLog("ShopQuartz job【" + this.JobName + "】移除"); }
/// <summary> /// 停止作业 /// </summary> public void Stop() { JobManagerBase.StopJob(this.JobName); Log4NetHelper.WriteRunLog("ShopQuartz job【" + this.JobName + "】停止"); }
/// <summary> /// 运行作业 /// </summary> public void Start() { Log4NetHelper.WriteRunLog("ShopQuartz job【" + this.JobName + "】启动"); JobManagerBase.StartJob(this.JobName); }