/// <summary> /// 创建一个空任务 /// </summary> /// <returns></returns> public static CTimerMission CreateAEmptyMission() { CTimerEmptyMission empty = new CTimerEmptyMission(); empty.CreateTime = DateTime.Now; //empty.Save(); return(empty); }
/// <summary> /// 根据Timer_Jobs创建相应的对象 /// </summary> /// <param name="job"></param> /// <returns></returns> public static CTimerMission CreateTimerMission(Timer_Jobs job) { if (job == null) { return(null); } CTimerMission J_val; switch (job.Job_Type) { case TIMER_JOB_TYPE.CREATE_WORKFLOW: CTimerCreateWF J_create = new CTimerCreateWF(); J_create.Load(job); J_val = J_create; break; case TIMER_JOB_TYPE.CHANGE_STATUS: CTimerWFStatus J_status = new CTimerWFStatus(); J_status.Load(job); J_val = J_status; break; case TIMER_JOB_TYPE.TIME_OUT: CTimerTimeout J_timeout = new CTimerTimeout(); J_timeout.Load(job); J_val = J_timeout; break; case TIMER_JOB_TYPE.EMPTY: CTimerEmptyMission J_empty = new CTimerEmptyMission(); J_empty.Load(job); J_val = J_empty; break; case TIMER_JOB_TYPE.Normal: CTimerNormalMission J_Normal = new CTimerNormalMission(); J_Normal.Load(job); J_val = J_Normal; break; default: J_val = null; break; } return(J_val); }