Ejemplo n.º 1
0
 private ServingTime NewServingTime(MpGroupServingParticipant record)
 {
     return(new ServingTime
     {
         Index = record.RowNumber,
         ServingTeams = new List <ServingTeam> {
             NewServingTeam(record)
         },
         Time = record.EventStartDateTime.TimeOfDay.ToString()
     });
 }
Ejemplo n.º 2
0
 private ServeRole NewServingRole(MpGroupServingParticipant record)
 {
     return(new ServeRole
     {
         Name = record.OpportunityTitle + " " + record.OpportunityRoleTitle,
         RoleId = record.OpportunityId,
         Room = record.Room,
         Minimum = record.OpportunityMinimumNeeded,
         Maximum = record.OpportunityMaximumNeeded,
         ShiftEndTime = record.OpportunityShiftEnd.FormatAsString(),
         ShiftStartTime = record.OpportunityShiftStart.FormatAsString()
     });
 }
Ejemplo n.º 3
0
 private ServeRsvp NewServeRsvp(MpGroupServingParticipant record)
 {
     if (record.Rsvp != null && !((bool)record.Rsvp))
     {
         return(new ServeRsvp {
             Attending = false, RoleId = 0
         });
     }
     else if (record.Rsvp != null && ((bool)record.Rsvp))
     {
         return(new ServeRsvp {
             Attending = (bool)record.Rsvp, RoleId = record.OpportunityId
         });
     }
     return(null);
 }
Ejemplo n.º 4
0
 private ServingTeam NewServingTeam(MpGroupServingParticipant record)
 {
     return(new ServingTeam
     {
         Index = record.RowNumber,
         EventId = record.EventId,
         EventType = record.EventType,
         EventTypeId = record.EventTypeId,
         GroupId = record.GroupId,
         Members = new List <TeamMember> {
             NewTeamMember(record)
         },
         Name = record.GroupName,
         PrimaryContact = record.GroupPrimaryContactEmail,
         PastDeadline = (record.OpportunitySignUpDeadline != null) && (record.EventStartDateTime.AddDays(0 - record.OpportunitySignUpDeadline.Value) < DateTime.Today),
         PastDeadlineMessage = record.DeadlinePassedMessage.Value
     });
 }
Ejemplo n.º 5
0
        private TeamMember NewTeamMember(MpGroupServingParticipant record)
        {
            // new team member
            var member = new TeamMember
            {
                ContactId    = record.ContactId,
                EmailAddress = record.ParticipantEmail,
                Index        = record.RowNumber,
                LastName     = record.ParticipantLastName,
                Name         = record.ParticipantNickname,
                Participant  = new MpParticipant {
                    ParticipantId = record.ParticipantId
                }
            };

            member.Roles.Add(NewServingRole(record));

            member.ServeRsvp = NewServeRsvp(record);
            return(member);
        }