Exemple #1
0
        public async Task <StatusOutput> GetStatus(int todoId)
        {
            var status  = _todoManager.GetStatuses(todoId);
            var message = _localizationManager.GetString(SapConsts.LocalizationSourceName, "StatusChangedByUser");
            var list    = new List <StatusDto>();

            foreach (var historyStatus in status)
            {
                var user = new User();
                if (historyStatus.CreatorUserId != null)
                {
                    user = await _userManager.GetUserByIdAsync((long)historyStatus.CreatorUserId);
                }
                var resolvedStatus  = _statusResolver.ResolveIntToStatus(historyStatus.StatusType);
                var resolvedName    = _statusResolver.GetStatusName(resolvedStatus);
                var resolvedMessage = string.Format(message, user.FullName, resolvedName);

                list.Add(new StatusDto()
                {
                    Member     = user,
                    Message    = resolvedMessage,
                    StatusType = historyStatus.StatusType
                });
            }
            return(new StatusOutput()
            {
                StatusDtos = list
            });
        }
Exemple #2
0
        public void ChangeListStatus(int listId, int statusCode)
        {
            var status = _statusResolver.ResolveIntToStatus(statusCode);

            _toDoListManager.ChangeStatus(listId, status);
        }