Пример #1
0
        public BaseResults.EmptyResult TaskCancel([FromQuery] string sid,
                                                  [FromBody] string taskToken)
        {
            var result = new BaseResults.EmptyResult();

            try
            {
                var taskm = RiportTaskManager.Get(taskToken, sid);
                taskm.Cancel();
            }
            catch (Exception ex)
            {
                result.Error = ex.InmostMessage();
            }

            return(result);
        }
Пример #2
0
        public RiportResult TaskCheck([FromQuery] string sid, [FromBody] string taskToken)
        {
            var result = new RiportResult();

            try
            {
                var taskm      = RiportTaskManager.Get(taskToken, sid);
                var taskresult = taskm.Check();

                result.Status = taskresult.Status;
                result.Error  = taskresult.Error;

                if (taskresult.Status == RiportTaskStates.Completed)
                {
                    result.Riport = taskresult.Result;
                }
            }
            catch (Exception ex)
            {
                result.Error = ex.InmostMessage();
            }

            return(result);
        }