Exemplo n.º 1
0
        private async Task ProcessCreatorName(ProjectManageDto projectDetails, long?creatorUserId)
        {
            if (creatorUserId != null)
            {
                var user = await _userManager.GetUserByIdAsync(creatorUserId.Value);

                projectDetails.CreatorName = user.FullName;
            }
        }
Exemplo n.º 2
0
        private void ProcessBudget(ProjectManageDto projectDetails, int idProject)
        {
            var budget = _budgetManager.GetBudget(idProject);

            if (budget != null)
            {
                projectDetails.InitialBudget   = budget.Initial;
                projectDetails.AvailableBudget = budget.Available;
            }
            else
            {
                projectDetails.IsBudgetDefined = false;
            }
        }
Exemplo n.º 3
0
        private void ProcessLeader(ProjectManageDto projectDetails, int idProject)
        {
            var leader = _membersManager.GetLeader(idProject);

            if (leader != null)
            {
                projectDetails.HasLeader = true;
                projectDetails.Leader    = leader.MapTo <LeaderDto>();
            }
            else
            {
                projectDetails.HasLeader = false;
            }
        }
Exemplo n.º 4
0
        private void ProcessClientCompany(ProjectManageDto projectDetails, int idProject)
        {
            var clientCompany = _clientsManager.GetClientCompanyFromProject(idProject);

            if (clientCompany != null)
            {
                projectDetails.ClientCompany    = clientCompany.MapTo <ClientCompanyDto>();
                projectDetails.HasClientCompany = true;
            }
            else
            {
                projectDetails.HasClientCompany = false;
            }
        }
Exemplo n.º 5
0
        private void ProcessTaskLists(ProjectManageDto projectDetails, int projectId)
        {
            var lists     = _toDoListManager.GeToDoLists(projectId);
            var toDoLists = lists as IList <ToDoList> ?? lists.ToList();

            if (toDoLists.Any())
            {
                var todoLists = toDoLists.Select(toDoList => toDoList.MapTo <ToDoListDto>()).ToList();
                projectDetails.ToDoLists    = todoLists;
                projectDetails.HasTodoTasks = true;
            }
            else
            {
                projectDetails.HasTodoTasks = false;
            }
        }
Exemplo n.º 6
0
        private async Task ProcessCollaborators(ProjectManageDto projectDetails, int idProject)
        {
            var collaborators = await _membersManager.GetAllMembers(idProject);

            var collaboratorsList = collaborators as IList <User> ?? collaborators.ToList();

            if (collaboratorsList.Any())
            {
                projectDetails.Collaborators    = collaboratorsList.Select(a => a.MapTo <MemberDto>());
                projectDetails.HasCollaborators = true;
            }
            else
            {
                projectDetails.HasCollaborators = false;
            }
        }