详解免费开源的DotNet任务调度组件Quartz.NET(.NE(3)

public class TaskBll { private readonly TaskDAL _dal = new TaskDAL(); /// <summary> /// 获取任务列表 /// </summary> /// <param></param> /// <param></param> /// <returns></returns> public PageOf<TaskModel> GetTaskList(int pageIndex, int pageSize) { return _dal.GetTaskList(pageIndex, pageSize); } /// <summary> /// 读取数据库中全部的任务 /// </summary> /// <returns></returns> public List<TaskModel> GetAllTaskList() { return _dal.GetAllTaskList(); } /// <summary> /// /// </summary> /// <param></param> /// <returns></returns> public TaskModel GetById(string taskId) { throw new NotImplementedException(); } /// <summary> /// 删除任务 /// </summary> /// <param></param> /// <returns></returns> public bool DeleteById(string taskId) { return _dal.UpdateTaskStatus(taskId, -1); } /// <summary> /// 修改任务 /// </summary> /// <param></param> /// <param></param> /// <returns></returns> public bool UpdateTaskStatus(string taskId, int status) { return _dal.UpdateTaskStatus(taskId, status); } /// <summary> /// 修改任务的下次启动时间 /// </summary> /// <param></param> /// <param></param> /// <returns></returns> public bool UpdateNextFireTime(string taskId, DateTime nextFireTime) { return _dal.UpdateNextFireTime(taskId, nextFireTime); } /// <summary> /// 根据任务Id 修改 上次运行时间 /// </summary> /// <param></param> /// <param></param> /// <returns></returns> public bool UpdateRecentRunTime(string taskId, DateTime recentRunTime) { return _dal.UpdateRecentRunTime(taskId, recentRunTime); } /// <summary> /// 根据任务Id 获取任务 /// </summary> /// <param></param> /// <returns></returns> public TaskModel GetTaskById(string taskId) { return _dal.GetTaskById(taskId); } /// <summary> /// 添加任务 /// </summary> /// <param></param> /// <returns></returns> public bool Add(TaskModel task) { return _dal.Add(task); } /// <summary> /// 修改任务 /// </summary> /// <param></param> /// <returns></returns> public bool Edit(TaskModel task) { return _dal.Edit(task); } }

3.任务实体:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjyydy.html