Esempio n. 1
0
        public static AllTasksForTeamViewModel Create(Business.Models.Team team,
                                                      bool isOwner,
                                                      List <Business.Models.Sprint> sprints,
                                                      List <Business.Models.Task> tasks)
        {
            var teamMemberViewModels = new List <TeamMemberViewModel>();
            var sprintViewModels     = new List <SprintViewModel>();
            var taskViewModels       = new List <TaskViewModel>();

            foreach (var teamMember in team.TeamMembers)
            {
                var teamMemberViewModel = TeamMemberViewModel.Create(teamMember);
                teamMemberViewModels.Add(teamMemberViewModel);
            }

            foreach (var sprint in sprints)
            {
                var sprintViewModel = SprintViewModel.Create(sprint, isOwner, 0);
                sprintViewModels.Add(sprintViewModel);
            }

            foreach (var task in tasks)
            {
                var taskViewModel = TaskViewModel.Create(task);
                taskViewModels.Add(taskViewModel);
            }

            return(new AllTasksForTeamViewModel(team, isOwner, teamMemberViewModels, sprintViewModels, taskViewModels));
        }
Esempio n. 2
0
        private TeamViewModel(Business.Models.Team team, bool isOwner, List <TeamMemberViewModel> teamMemberViewModels)
        {
            if (team != null)
            {
                Id       = team.Id;
                Owner    = team.Owner;
                TeamName = team.TeamName;
            }

            IsOwner     = isOwner;
            TeamMembers = teamMemberViewModels;
        }
Esempio n. 3
0
        private AllTasksForTeamViewModel(Business.Models.Team team,
                                         bool isOwner,
                                         List <TeamMemberViewModel> teamMemberViewModels,
                                         List <SprintViewModel> sprintViewModels,
                                         List <TaskViewModel> taskViewModels)
        {
            if (team != null)
            {
                TeamId   = team.Id;
                TeamName = team.TeamName;
            }

            Tasks   = taskViewModels;
            Sprints = sprintViewModels;
            Members = teamMemberViewModels;
            IsOwner = isOwner;
        }
Esempio n. 4
0
        public static TeamViewModel Create(Business.Models.Team team, bool isOwner, List <Business.Models.TeamMember> allTeamMembers)
        {
            var teamMemberViewModels = new List <TeamMemberViewModel>();

            if (allTeamMembers.Count > 0)
            {
                foreach (var teamMember in allTeamMembers)
                {
                    var newTeamMemberViewModel = TeamMemberViewModel.Create(teamMember);
                    teamMemberViewModels.Add(newTeamMemberViewModel);
                }
            }
            else
            {
                foreach (var teamMember in team.TeamMembers)
                {
                    var newTeamMemberViewModel = TeamMemberViewModel.Create(teamMember);
                    teamMemberViewModels.Add(newTeamMemberViewModel);
                }
            }

            return(new TeamViewModel(team, isOwner, teamMemberViewModels));
        }
        public static SprintAndTeamViewModel Create(Business.Models.Sprint currentSprint,
                                                    List <Business.Models.Sprint> sprints,
                                                    Business.Models.Team team,
                                                    bool isOwner,
                                                    List <Business.Models.MemberWorkingDays> memberWorkingDays)
        {
            var sprintViewModels            = new List <SprintViewModel>();
            var teamViewModel               = TeamViewModel.Create(team, isOwner, new List <Business.Models.TeamMember>());
            var memberWorkingDaysViewModels = new List <MemberWorkingDaysViewModel>();

            foreach (var sprint in sprints)
            {
                var sprintViewModel = SprintViewModel.Create(sprint, isOwner, 0);
                sprintViewModels.Add(sprintViewModel);
            }

            foreach (var memberWorkingDay in memberWorkingDays)
            {
                var memberWorkingDayViewModel = MemberWorkingDaysViewModel.Create(memberWorkingDay);
                memberWorkingDaysViewModels.Add(memberWorkingDayViewModel);
            }

            return(new SprintAndTeamViewModel(currentSprint, sprintViewModels, teamViewModel, memberWorkingDaysViewModels));
        }
Esempio n. 6
0
 public static EditSprintViewModel Create(Business.Models.Sprint sprint, string errorMessage, Business.Models.Team team) =>
 new EditSprintViewModel(sprint, errorMessage, team);
Esempio n. 7
0
        private EditSprintViewModel(Business.Models.Sprint sprint, string errorMessage, Business.Models.Team team)
        {
            if (team != null)
            {
                TeamId   = team.Id;
                TeamName = team.TeamName;
            }

            if (sprint != null)
            {
                SprintId                = sprint.Id;
                SprintName              = sprint.Name;
                SprintDaysInSprint      = sprint.DaysInSprint;
                SprintStorePointInHours = sprint.StoryPointInHours;
                Status = sprint.Status;
            }

            ErrorMessage = errorMessage;
        }