Exemplo n.º 1
0
        public static bool UpdateManageStartTime(string manageTaskID, DateTime startTime)
        {
            ManageModel manage = bllManage.GetModel(manageTaskID);

            if (manage == null)
            {
                return(false);
            }
            manage.Manage_Begin_Time = startTime;
            return(bllManage.Update(manage));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 更新指定管理任务状态
        /// </summary>
        /// <param name="manageTaskID">管理任务ID</param>
        /// <param name="taskStatus">管理任务状态:待执行,执行中,完成</param>
        /// <returns></returns>
        public ResposeData UpdateManageTaskStatus(string manageTaskID, string taskStatus)
        {
            ResposeData response = new ResposeData();

            try
            {
                ManageModel task = bllManage.GetModel(manageTaskID);
                if (task == null)
                {
                    response.Status   = false;
                    response.Describe = "任务状态更改失败!无此任务ID!";
                }
                task.Mange_Status = taskStatus;
                if (taskStatus == EnumManageTaskStatus.执行中.ToString())
                {
                    task.Manage_Begin_Time = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                }
                else if (taskStatus == EnumManageTaskStatus.已完成.ToString())
                {
                    task.Manage_End_Time = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                }
                bllManage.Update(task);
                response.Status   = true;
                response.Describe = "任务状态更改成功!";
                return(response);
            }
            catch (Exception ex)
            {
                response.Status   = false;
                response.Describe = "任务状态更改失败!" + ex.Message;
                return(response);
            }
        }