public async Task CreateAsync(TaskQueueEntity task)
        {
            using (var connection = new SqlConnection(DBConnectionString))
            {
                await connection.OpenAsync();

                task.Id = await connection.QueryFirstOrDefaultAsync <int>("InsertTask", new { jobId = task.JobId, taskUrl = task.TaskUrl }, commandType : CommandType.StoredProcedure);

                task.IsCompleted = false;
            }
        }
Пример #2
0
        public void Send(TaskQueueEntity task)
        {
            switch (task.TaskType)
            {
            case (int)TaskType.InRecognizingData:
                //SendParkPlaceRemainCount(task);
                break;

            default:
                break;
            }
        }
Пример #3
0
        /// <summary>
        /// Marks the passed in Task as complete
        /// </summary>
        /// <param name="task">The task to mark as complete</param>
        /// <returns>bool: True = success</returns>
        public async Task <bool> MarkTaskCompleteAsync(TaskQueueEntity task)
        {
            var sucessful = await _taskRepository.UpdateToCompleteAsync(task.Id);

            if (sucessful)
            {
                task.IsCompleted = true;

                return(true);
            }

            return(false);
        }
Пример #4
0
 /// <summary>
 /// 推送剩余车位数
 /// </summary>
 /// <param name="task"></param>
 private void SendParkPlaceRemainCount(TaskQueueEntity task)
 {
     Api_Channel content = task.Content.FromXML <Api_Channel>();
     //推送至第三方
 }