Пример #1
0
 internal void AssignVolunteer(TeamMember teamMember)
 {
     AssertionConcern.AssertArgumentNotNull(teamMember, "A volunteer must be provided.");
     this.Volunteer = teamMember.TeamMemberId;
     DomainEventPublisher.Instance.Publish(
         new TaskVolunteerAssigned(this.TenantId, this.BacklogItemId, this.TaskId, teamMember.TeamMemberId.Id));
 }
Пример #2
0
 public void RemoveTeamMember(TeamMember teamMember)
 {
     AssertValidTeamMember(teamMember);
     var existingTeamMember = GetTeamMemberByUserName(teamMember.Username);
     if (existingTeamMember != null)
     {
         this.teamMembers.Remove(existingTeamMember);
     }
 }
Пример #3
0
 public Task(
     TenantId tenantId, 
     BacklogItemId backlogItemId, 
     TaskId taskId, 
     TeamMember teamMember, 
     string name, 
     string description, 
     int hoursRemaining, 
     TaskStatus status)
 {
     this.TenantId = tenantId;
     this.BacklogItemId = backlogItemId;
     this.TaskId = taskId;
     this.Volunteer = teamMember.TeamMemberId;
     this.Name = name;
     this.Description = description;
     this.HoursRemaining = hoursRemaining;
     this.Status = status;
     this.estimationLog = new List<EstimationLogEntry>();
 }
 public void EnableTeamMember(EnableTeamMemberCommand command)
 {
     var tenantId = new TenantId(command.TenantId);
     ApplicationServiceLifeCycle.Begin();
     try
     {
         var teamMember = this.teamMemberRepository.Get(tenantId, command.Username);
         if (teamMember != null)
         {
             teamMember.Enable(command.OccurredOn);
         }
         else
         {
             teamMember = new TeamMember(tenantId, command.Username, command.FirstName, command.LastName, command.EmailAddress, command.OccurredOn);
             this.teamMemberRepository.Save(teamMember);
         }
         ApplicationServiceLifeCycle.Success();
     }
     catch (Exception ex)
     {
         ApplicationServiceLifeCycle.Fail(ex);
     }
 }
Пример #5
0
        public void DefineTask(TeamMember volunteer, string name, string description, int hoursRemaining)
        {
            var task = new Task(
                this.TenantId,
                this.BacklogItemId,
                new TaskId(),
                volunteer,
                name,
                description,
                hoursRemaining,
                TaskStatus.NotStarted);

            this.tasks.Add(task);

            DomainEventPublisher.Instance.Publish(
                new TaskDefined(this.TenantId, this.BacklogItemId, task.TaskId, volunteer.TeamMemberId.Id, name, description));
        }
Пример #6
0
 public void AssignTaskVolunteer(TaskId taskId, TeamMember volunteer)
 {
     var task = LoadTask(taskId);
     task.AssignVolunteer(volunteer);
 }
Пример #7
0
 void AssertValidTeamMember(TeamMember teamMember)
 {
     AssertionConcern.AssertArgumentNotNull(teamMember, "A team member must be provided.");
     AssertionConcern.AssertArgumentEquals(this.TenantId, teamMember.TenantId, "Team member must be of the same tenant.");
 }
Пример #8
0
 public bool IsTeamMember(TeamMember teamMember)
 {
     AssertValidTeamMember(teamMember);
     return(GetTeamMemberByUserName(teamMember.Username) != null);
 }
Пример #9
0
 public void AssignTeamMember(TeamMember teamMember)
 {
     AssertValidTeamMember(teamMember);
     this.teamMembers.Add(teamMember);
 }
Пример #10
0
 public bool IsTeamMember(TeamMember teamMember)
 {
     AssertValidTeamMember(teamMember);
     return GetTeamMemberByUserName(teamMember.Username) != null;
 }
Пример #11
0
 public void AssignTeamMember(TeamMember teamMember)
 {
     AssertValidTeamMember(teamMember);
     this.teamMembers.Add(teamMember);
 }
Пример #12
0
 void AssertValidTeamMember(TeamMember teamMember)
 {
     AssertionConcern.AssertArgumentNotNull(teamMember, "A team member must be provided.");
     AssertionConcern.AssertArgumentEquals(this.TenantId, teamMember.TenantId, "Team member must be of the same tenant.");
 }