public static void AttachMemberMedicalInformation(Member member, MemberDisplay mem)
 {
     if (member.MedicalInformation != null)
     {
         MedicalInformation meds = new MedicalInformation();
         meds.AdditionalDetailsText = member.MedicalInformation.AdditionalDetailsText;
         meds.AsthmaBronchitis = member.MedicalInformation.AsthmaBronchitis;
         meds.BackNeckPain = member.MedicalInformation.BackNeckPain;
         meds.Concussion = member.MedicalInformation.Concussion;
         meds.ContactLenses = member.MedicalInformation.ContactLenses;
         meds.HardSoftLensesEnum = (ContactLensesEnum)Enum.Parse(typeof(ContactLensesEnum), member.MedicalInformation.HardSoftLensesEnum.ToString());
         meds.Diabetes = member.MedicalInformation.Diabetes;
         meds.Dislocation = member.MedicalInformation.Dislocation;
         meds.LastModified = member.MedicalInformation.Created;
         if (member.MedicalInformation.LastModified != null)
             meds.LastModified = member.MedicalInformation.LastModified.GetValueOrDefault();
         meds.MedicalId = member.MedicalInformation.MedicalId;
         meds.RegularMedsText = member.MedicalInformation.RegularMedsText;
         meds.ReoccurringPain = member.MedicalInformation.ReoccurringPain;
         meds.ReoccurringPainText = member.MedicalInformation.ReoccurringPainText;
         meds.SportsInjuriesText = member.MedicalInformation.SportsInjuriesText;
         meds.TreatedForInjury = member.MedicalInformation.TreatedForInjury;
         meds.WearGlasses = member.MedicalInformation.WearGlasses;
         meds.DislocationText = member.MedicalInformation.DislocationText;
         meds.DoAnyConditionsAffectPerformanceText = member.MedicalInformation.DoAnyConditionsAffectPerformanceText;
         meds.Epilepsy = member.MedicalInformation.Epilepsy;
         meds.FractureInThreeYears = member.MedicalInformation.FractureInThreeYears;
         meds.FractureText = member.MedicalInformation.FractureText;
         meds.HeartMurmur = member.MedicalInformation.HeartMurmur;
         meds.HeartProblems = member.MedicalInformation.HeartProblems;
         meds.Hernia = member.MedicalInformation.Hernia;
         mem.Medical = meds;
     }
     else
     {
         mem.Medical = new MedicalInformation();
     }
 }
Beispiel #2
0
 public static string ExtractEmailFromContactCard(Member member)
 {
     if (member.ContactCard.Emails.Count > 0)
         return member.ContactCard.Emails.Where(x => x.IsDefault == true).FirstOrDefault().EmailAddress;
     return String.Empty;
 }
Beispiel #3
0
 private static void UpdatePhoneNumberForMember(MemberDisplay mem, ManagementContext dc, Member member)
 {
     int phoneType = Convert.ToInt32(CommunicationTypeEnum.PhoneNumber);
     var phone = member.ContactCard.Communications.Where(x => x.CommunicationTypeEnum == (byte)CommunicationTypeEnum.PhoneNumber).FirstOrDefault();
     if (phone != null)
         phone.Data = mem.PhoneNumber;
     else
     {
         member.ContactCard.Communications.Add(new Communication
         {
             Data = mem.PhoneNumber,
             IsDefault = true,
             //CommunicationType = dc.CommunicationType.Where(x => x.CommunicationTypeId == phoneType).FirstOrDefault()
             CommunicationTypeEnum = (byte)CommunicationTypeEnum.PhoneNumber
         });
     }
 }
Beispiel #4
0
 private static void UpdateEmailForMember(MemberDisplay mem, Member member)
 {
     var email = member.ContactCard.Emails.Where(x => x.IsDefault == true).FirstOrDefault();
     if (email != null)
         email.EmailAddress = mem.Email;
     else
         member.ContactCard.Emails.Add(new RDN.Library.DataModels.ContactCard.Email { EmailAddress = mem.Email, IsDefault = true });
 }
Beispiel #5
0
 /// <summary>
 /// adds a insurance provider to a member
 /// </summary>
 /// <param name="insuranceNumber"></param>
 /// <param name="member"></param>
 /// <param name="other"></param>
 private static void AddInsuranceProvider(string insuranceNumber, DateTime? expires, Member member, int other)
 {
     MemberInsurance insure = new MemberInsurance();
     insure.InsuranceNumber = insuranceNumber;
     insure.InsuranceType = other;
     insure.Member = member;
     insure.Expires = expires;
     member.InsuranceNumbers.Add(insure);
 }
Beispiel #6
0
        private static SkaterJson DisplaySkaterJson(Member mem)
        {
            SkaterJson m = new SkaterJson();
            var photos = mem.Photos.OrderByDescending(x => x.Created).Where(x => x.IsPrimaryPhoto == true).FirstOrDefault();
            if (photos != null)
            {
                m.photoUrl = photos.ImageUrl;
                m.ThumbUrl = photos.ImageUrlThumb;
            }
            else if (mem.Gender == (int)GenderEnum.Female)
            {
                m.photoUrl = ServerConfig.WEBSITE_DEFAULT_LOCATION + "/content/roller-girl.jpg";
                m.ThumbUrl = m.photoUrl;
                m.Gender = GenderEnum.Female.ToString();
            }
            else if (mem.Gender == (int)GenderEnum.Male)
            {
                m.photoUrl = ServerConfig.WEBSITE_DEFAULT_LOCATION + "/content/roller-person.gif";
                m.ThumbUrl = m.photoUrl;
                m.Gender = GenderEnum.Male.ToString();
            }
            m.DerbyNameUrl = ServerConfig.WEBSITE_DEFAULT_LOCATION + "/roller-derby-skater/" + RDN.Utilities.Strings.StringExt.ToSearchEngineFriendly(mem.DerbyName) + "/" + mem.MemberId.ToString().Replace("-", "");
            m.DerbyName = mem.DerbyName;
            m.DerbyNumber = mem.PlayerNumber;
            m.MemberId = mem.MemberId.ToString().Replace("-", "");
            if (!String.IsNullOrEmpty(mem.Bio))
                m.Bio = htmlStrip.Replace(mem.Bio, String.Empty);
            m.DOB = mem.DateOfBirth.GetValueOrDefault();
            if (mem.HeightInches != 0)
            {
                m.HeightFeet = (int)(mem.HeightInches / 12);
                m.HeightInches = (int)(mem.HeightInches % 12);
            }
            m.Weight = mem.WeightInLbs.ToString();
            m.FirstName = mem.Firstname;

            var leag = mem.Leagues.Where(x => x.League.LeagueId == mem.CurrentLeagueId).FirstOrDefault();
            if (leag != null)
            {
                m.LeagueUrl = ServerConfig.WEBSITE_DEFAULT_LOCATION + "/roller-derby-league/" + RDN.Utilities.Strings.StringExt.ToSearchEngineFriendly(leag.League.Name) + "/" + mem.CurrentLeagueId.ToString().Replace("-", "");
                m.LeagueName = leag.League.Name;
                m.LeagueId = leag.League.LeagueId.ToString().Replace("-", "");
                if (leag.League.Logo != null)
                    m.LeagueLogo = leag.League.Logo.ImageUrl;
            }
            return m;
        }