public WebApiResult <string> Pause <T>(TaskStop request) { var entity = Log <T> .GetThreadLogEntity(request.GUID); if (entity == null) { return new WebApiResult <string> { success = 0, msg = "该任务不存在" } } ; if (entity.Status == "已完成") { return new WebApiResult <string> { success = 0, msg = "该任务已完成" } } ; entity.IsPaused = true; entity.TStatus = 4; new Log <T>(entity); return(new WebApiResult <string>() { success = 1, msg = "暂停成功" }); } } }
protected virtual void OnTaskStop(TaskStopEventArg e) { TaskStop?.Invoke(this, e); }
/// <summary> /// 暂停 /// </summary> /// <param name="request"></param> /// <returns></returns> public WebApiResult <string> Any(TaskStop request) { TaskService service = new TaskService(); return(service.Pause <BaiduMapTileDownloadRequest>(request)); }