/// <summary> /// Create a new ProfileMember contract that can be sent to /// a remote API client. /// </summary> /// <param name="arena">The Profile object to create a contract for.</param> public ProfileMember(Core.ProfileMember arena) { Profile = new GenericReference(new Core.Profile(arena.ProfileID)); Person = new GenericReference(arena); AttendanceCount = arena.AttendanceCount; if (arena.DateActive.Year != 9999) { DateActive = arena.DateActive; } if (arena.DateDormant.Year != 9999) { DateDormant = arena.DateDormant; } if (arena.DateInReview.Year != 9999) { DateInReview = arena.DateInReview; } if (arena.DatePending.Year != 9999) { DatePending = arena.DatePending; } MemberNotes = arena.MemberNotes; Source = new Lookup(arena.Source); Status = new Lookup(arena.Status); StatusReason = arena.StatusReason; }
/// <summary> /// Create a new ProfileMemberActivity object given the contents /// of the DataRow, this is the designated initializer. /// </summary> /// <param name="dr">The DataRow as returned by GetProfileMemberActivityDetails_DT().</param> public ProfileMemberActivity(DataRow dr) { Profile = new GenericReference(new Core.Profile(Convert.ToInt32(dr["profile_id"]))); Person = new GenericReference(new Core.Person(Convert.ToInt32(dr["person_id"]))); ActivityTypeString = dr["activity_type"].ToString(); CreatedBy = dr["created_by"].ToString(); DateCreated = Convert.ToDateTime(dr["date_created"].ToString()); Notes = dr["notes"].ToString(); }
/// <summary> /// Map an Arena group occurrence to a SmallGroupOccurance Contract /// </summary> /// <param name="arena">The Occurrence from arena</param> /// <returns>A new SmallGroupOccurance</returns> public SmallGroupOccurrence FromArena(GroupOccurrence arena) { SmallGroupOccurrence occurrence = new SmallGroupOccurrence(); occurrence.OccurrenceID = arena.OccurrenceID; occurrence.Name = arena.Name; occurrence.Start = arena.StartTime; occurrence.End = arena.EndTime; occurrence.Description = arena.Description; occurrence.Attendees = new List <GenericReference>(); foreach (var attender in arena.OccurrenceAttendances) { if (attender.Attended) { GenericReference person = new GenericReference(attender.Person); occurrence.Attendees.Add(person); } } return(occurrence); }
/// <summary> /// Create a new ProfileMember contract that can be sent to /// a remote API client. /// </summary> /// <param name="arena">The Profile object to create a contract for.</param> public ProfileMember(Core.ProfileMember arena) { Profile = new GenericReference(new Core.Profile(arena.ProfileID)); Person = new GenericReference(arena); AttendanceCount = arena.AttendanceCount; if (arena.DateActive.Year != 9999) DateActive = arena.DateActive; if (arena.DateDormant.Year != 9999) DateDormant = arena.DateDormant; if (arena.DateInReview.Year != 9999) DateInReview = arena.DateInReview; if (arena.DatePending.Year != 9999) DatePending = arena.DatePending; MemberNotes = arena.MemberNotes; Source = new Lookup(arena.Source); Status = new Lookup(arena.Status); StatusReason = arena.StatusReason; }
/// <summary> /// Map an Arena group occurrence to a SmallGroupOccurance Contract /// </summary> /// <param name="arena">The Occurrence from arena</param> /// <returns>A new SmallGroupOccurance</returns> public SmallGroupOccurrence FromArena(GroupOccurrence arena) { SmallGroupOccurrence occurrence = new SmallGroupOccurrence(); occurrence.OccurrenceID = arena.OccurrenceID; occurrence.Name = arena.Name; occurrence.Start = arena.StartTime; occurrence.End = arena.EndTime; occurrence.Description = arena.Description; occurrence.Attendees = new List<GenericReference>(); foreach (var attender in arena.OccurrenceAttendances) { if (attender.Attended) { GenericReference person = new GenericReference(attender.Person); occurrence.Attendees.Add(person); } } return occurrence; }