95 lines
1.7 KiB
C#
95 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Epost.DAL.Cache
|
|
{
|
|
public class WorkIngCacheDAL
|
|
{
|
|
private static object lockobj = new object();
|
|
public static string workingstate = string.Empty;
|
|
|
|
|
|
#region 获取计划任务列表
|
|
public string GetWorkState()
|
|
{
|
|
|
|
|
|
|
|
//读取数据库 处理异常断电等情况------待开发
|
|
return workingstate;
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
#region 初始化任务列表
|
|
public void ClearWork()
|
|
{
|
|
|
|
|
|
workingstate = "";
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
#region Job缓存处理方法
|
|
/// <summary>
|
|
/// Job缓存处理方法
|
|
/// </summary>
|
|
/// <param name="JobParam"></param>
|
|
/// <param name="CommendType"></param>
|
|
/// <returns></returns>
|
|
public bool UpdateWorkModel(WorkEcommendType CommendType)
|
|
{
|
|
|
|
lock (lockobj)
|
|
{
|
|
|
|
if (CommendType.Equals(WorkEcommendType.Create))
|
|
{
|
|
workingstate = "Start";
|
|
}
|
|
|
|
else if (CommendType.Equals(WorkEcommendType.Complete))
|
|
{
|
|
|
|
workingstate = "";
|
|
|
|
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|
|
public enum WorkEcommendType
|
|
{
|
|
/// <summary>
|
|
/// 开始作业
|
|
/// </summary>
|
|
[Description("开始作业")]
|
|
Create,
|
|
|
|
|
|
/// <summary>
|
|
/// 结束作业
|
|
/// </summary>
|
|
[Description("结束作业")]
|
|
Complete
|
|
|
|
|
|
}
|
|
}
|