/// <summary> /// Object initilizes using the data in the provided data object. If the data matches a user held by providers then /// restore, update, save etc will work properly. /// </summary> /// <param name="accountData">Account data object</param> /// <param name="profileData">Profile data object</param> public SiteMember(IMemberAccountData accountData, IMemberProfileData profileData) { String logMethodName = ".ctor(IMemberAccountData accountData, IMemberProfileData profileData) - "; _log.Debug(logMethodName + "Begin Method"); Init(); try { _log.Debug(logMethodName + "Loading Member Account"); _memberAccount = new MemberAccount(accountData); } catch (Exception ex) { _log.Error(logMethodName + "Unable to create member account instance from data object provided", ex); throw new WtfException("Unable to create member account instance from data object provided", ex); } //TODO - JHL: Making Profile Member Id = iKey = profileData.Id, but should it be AD Key (_memberAccount.MemberId) try { _log.Debug(logMethodName + "Loading Member Profile"); _memberProfile = new MemberProfile(profileData.Id, profileData, false); } catch (Exception ex) { _log.Error(logMethodName + "Unable to create member profile instance from data object provided", ex); throw new WtfException("Unable to create member profile instance from data object provided", ex); } _log.Debug(logMethodName + "End Method"); }
public T CreateMemberProfile <T>(IMemberProfile source) where T : IMemberProfile, new() { var target = new T(); target.MemberId = source.MemberId; target.FirstName = source.FirstName; target.LastName = source.LastName; target.MiddleName = source.MiddleName; target.Gender = source.Gender; target.SponsorId = source.SponsorId; target.Sponsor = source.Sponsor; target.StatusId = source.StatusId; target.StatusDesc = source.StatusDesc; target.BirthDate = source.BirthDate; target.ChurchId = source.ChurchId; target.ChurchName = source.ChurchName; target.Comments = source.Comments; target.PreferredName = source.PreferredName; target.DateSaved = source.DateSaved; target.DateBaptizedWater = source.DateBaptizedWater; target.DateBaptizedHolyGhost = source.DateBaptizedHolyGhost; target.Married = source.Married; target.Veteran = source.Veteran; target.StatusChangeTypeId = source.StatusChangeTypeId; target.StatusChangeTypeDesc = source.StatusChangeTypeDesc; target.MemberTypeEnumId = source.MemberTypeEnumId; return(target); }