Exemplo n.º 1
0
        public IEnumerable <TaskDto> Get(TaskListType taskListType, int?pageNo, Sort?sort = null, string sortColumn = null)
        {
            if (pageNo == null)
            {
                pageNo = 1;
            }

            return(_taskService.GetTaskList(taskListType, pageNo.Value, sort, sortColumn));
        }
 public IList <Task> GetTaskList(TaskListType taskListType)
 {
     using (var context = new BroadridgeContext())
     {
         return(context.Tasks.Where(x => taskListType == TaskListType.All ||
                                    (taskListType == TaskListType.Active && x.TimeComplete > DateTime.Now) ||
                                    (taskListType == TaskListType.Completed && x.TimeComplete <= DateTime.Now))
                .ToList());
     }
 }
        public IList <TaskDto> GetTaskList(TaskListType taskListType, int pageNo, Sort?sort = null, string sortColumn = null)
        {
            var taskBatchSize = _settingService.GetTaskBatchSize();

            IEnumerable <Task> taskList = _taskProvider.GetTaskList(taskListType);

            Func <Task, object> funcTaskKeySelector = null;

            if (sort != null &&
                !string.IsNullOrEmpty(sortColumn) &&
                _selectors.TryGetValue(sortColumn, out funcTaskKeySelector))
            {
                taskList = sort == Sort.Asc ? taskList.OrderBy(funcTaskKeySelector)
                                            : taskList.OrderByDescending(funcTaskKeySelector);
            }

            if (pageNo != Consts.AllTasks)
            {
                taskList = taskList.Skip((pageNo - 1) * taskBatchSize).Take(taskBatchSize);
            }

            return(taskList.Select(ConvertToDto).ToList());
        }
Exemplo n.º 4
0
 string ITaskListRepository.Create(string name, TaskListType listType)
 {
     var list = backend.Rtm.ListsAdd (backend.Timeline, name);
     return list.ID;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Returns information about pollers (AKA workers) that have communicated
        /// with the Cadence cluster in the last few minutes.
        /// </summary>
        /// <param name="taskList">Identifies the tasklist.</param>
        /// <param name="taskListType">
        /// Indicates whether to return information for decision (AKA workflow pollers)
        /// or activity pollers.
        /// </param>
        /// <param name="domain">Optionally specifies the Cadence domain.</param>
        /// <returns>The <see cref="TaskListDescription"/> for the pollers.</returns>
        public async Task <TaskListDescription> DescribeTaskListAsync(string taskList, TaskListType taskListType, string domain = null)
        {
            await SyncContext.ClearAsync;

            Covenant.Requires <ArgumentNullException>(!string.IsNullOrEmpty(taskList));
            EnsureNotDisposed();

            domain = ResolveDomain(domain);

            var reply = (DescribeTaskListReply) await CallProxyAsync(
                new DescribeTaskListRequest()
            {
                Name         = taskList,
                TaskListType = taskListType,
                Domain       = domain
            });

            reply.ThrowOnError();

            return(reply.Result.ToPublic());
        }
Exemplo n.º 6
0
 public string Create(string name, TaskListType listType)
 {
     throw new NotImplementedException ();
 }
Exemplo n.º 7
0
 public IList <TaskDto> GetTaskList(TaskListType taskListType)
 {
     return(_taskService.GetTaskList(taskListType, Consts.AllTasks));
 }