private BriefProfileModel ToBriefProfileModel(Staff profile) { var briefProfileModel = new BriefProfileModel(); var preferredMail = profile.StaffElectronicMails.FirstOrDefault(x => x.PrimaryEmailAddressIndicator.HasValue && x.PrimaryEmailAddressIndicator.Value)?.ElectronicMailAddress; var mail = profile.StaffElectronicMails.FirstOrDefault(); var selectedMail = mail != null ? mail.ElectronicMailAddress : null; briefProfileModel.FirstName = profile.FirstName; briefProfileModel.MiddleName = profile.MiddleName; briefProfileModel.LastSurname = profile.LastSurname; briefProfileModel.Usi = profile.StaffUsi; briefProfileModel.UniqueId = profile.StaffUniqueId; briefProfileModel.PersonTypeId = ChatLogPersonTypeEnum.Staff.Value; briefProfileModel.Role = "Staff"; briefProfileModel.Email = preferredMail != null ? preferredMail : selectedMail; return(briefProfileModel); }
private BriefProfileModel ToBriefProfileModel(StaffProfileModel profile) { var briefProfileModel = new BriefProfileModel(); var preferredMail = profile.Profile.StaffProfileElectronicMails.FirstOrDefault(x => x.PrimaryEmailAddressIndicator.HasValue && x.PrimaryEmailAddressIndicator.Value).ElectronicMailAddress; var mail = profile.Profile.StaffProfileElectronicMails.FirstOrDefault(); var selectedMail = mail != null ? mail.ElectronicMailAddress : null; briefProfileModel.FirstName = profile.Profile.FirstName; briefProfileModel.MiddleName = profile.Profile.MiddleName; briefProfileModel.LastSurname = profile.Profile.LastSurname; briefProfileModel.Usi = profile.Staff.StaffUsi; briefProfileModel.UniqueId = profile.Staff.StaffUniqueId; briefProfileModel.LanguageCode = profile.Profile.LanguageCode; briefProfileModel.PersonTypeId = ChatLogPersonTypeEnum.Staff.Value; briefProfileModel.Role = "Staff"; briefProfileModel.Email = preferredMail != null ? preferredMail : selectedMail; briefProfileModel.IdentificationCode = profile.Staff.StaffIdentificationCodes.FirstOrDefault(x => x.AssigningOrganizationIdentificationCode == "LASID")?.IdentificationCode; return(briefProfileModel); }
private BriefProfileModel ToBriefProfileModel(ParentProfileModel profile) { var briefProfileModel = new BriefProfileModel(); var preferredMail = profile.ParentProfile.ParentProfileElectronicMails.FirstOrDefault(x => x.PrimaryEmailAddressIndicator.HasValue && x.PrimaryEmailAddressIndicator.Value)?.ElectronicMailAddress; var mail = profile.ParentProfile.ParentProfileElectronicMails.FirstOrDefault(); var selectedMail = mail != null ? mail.ElectronicMailAddress : null; briefProfileModel.FirstName = profile.ParentProfile.FirstName; briefProfileModel.MiddleName = profile.ParentProfile.MiddleName; briefProfileModel.LastSurname = profile.ParentProfile.LastSurname; briefProfileModel.Usi = profile.Parent.ParentUsi; briefProfileModel.UniqueId = profile.Parent.ParentUniqueId; briefProfileModel.LanguageCode = profile.ParentProfile.LanguageCode; briefProfileModel.PersonTypeId = ChatLogPersonTypeEnum.Parent.Value; briefProfileModel.Role = "Parent"; briefProfileModel.Email = preferredMail != null ? preferredMail : selectedMail; briefProfileModel.DeliveryMethodOfContact = profile.ParentProfile.PreferredMethodOfContactTypeId; briefProfileModel.LanguageCode = profile.ParentProfile.LanguageCode; return(briefProfileModel); }