Example #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));
 }
Example #2
0
 public void RemoveTeamMember(TeamMember teamMember)
 {
     AssertValidTeamMember(teamMember);
     var existingTeamMember = GetTeamMemberByUserName(teamMember.Username);
     if (existingTeamMember != null)
     {
         this.teamMembers.Remove(existingTeamMember);
     }
 }
Example #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);
     }
 }
        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));
        }
 public void AssignTaskVolunteer(TaskId taskId, TeamMember volunteer)
 {
     var task = LoadTask(taskId);
     task.AssignVolunteer(volunteer);
 }
Example #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.");
 }
Example #8
0
 public bool IsTeamMember(TeamMember teamMember)
 {
     AssertValidTeamMember(teamMember);
     return(GetTeamMemberByUserName(teamMember.Username) != null);
 }
Example #9
0
 public void AssignTeamMember(TeamMember teamMember)
 {
     AssertValidTeamMember(teamMember);
     this.teamMembers.Add(teamMember);
 }
Example #10
0
 public bool IsTeamMember(TeamMember teamMember)
 {
     AssertValidTeamMember(teamMember);
     return GetTeamMemberByUserName(teamMember.Username) != null;
 }
Example #11
0
 public void AssignTeamMember(TeamMember teamMember)
 {
     AssertValidTeamMember(teamMember);
     this.teamMembers.Add(teamMember);
 }
Example #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.");
 }