public async void SetPeopleCheck(ServerUser user, PeopleSpeakerTemplate parentPep) { await((HomeLayout)App.Current.MainPage).SetLoading(true, "loading user..."); currentUser = user; if (parentPep != null) { parentPeople = parentPep; } VcardContact c_user = new VcardContact(); c_user.FirstName = currentUser.userFirstName; c_user.LastName = currentUser.userLastName; c_user.company = currentUser.userCompany; c_user.phoneNumber = currentUser.userPhone; c_user.email = currentUser.userEmail; App.contactuser = c_user; if (currentUser != null) { CheckSocialVisiblilty(); if (!string.IsNullOrEmpty(user.userImage)) { peopleImage.Source = user.userImage; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(currentUser.userFirstName + " " + currentUser.userLastName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } else { peopleImage.Source = ""; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(currentUser.userFirstName + " " + currentUser.userLastName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } if (!string.IsNullOrEmpty(user.userFirstName)) { fullNameText.Text = user.userFirstName + " " + user.userLastName; } else { fullNameText.Text = ""; } if (!string.IsNullOrEmpty(user.userPosition)) { positionText.Text = user.userPosition; } else { positionText.Text = ""; } if (!string.IsNullOrEmpty(user.userCompany)) { companyText.Text = user.userCompany; } else { companyText.Text = ""; } if (!string.IsNullOrEmpty(user.userDescription)) { bioView.IsVisible = true; emptyList.IsVisible = false; bioDescriptionText.Text = user.userDescription; } else { bioView.IsVisible = false; emptyList.IsVisible = true; //bioDescriptionText.Text = "Bio unavailable"; } } CheckBookmark(App.serverData.mei_user.currentUser.userBookmarks.isBookmarked(currentUser)); await Task.Delay(1000); await((HomeLayout)App.Current.MainPage).SetLoading(false, ""); }
public async void SponsorDetials(SponsorGroup _sponsor, SponsorsTemplate parentSponsor) { await((HomeLayout)App.Current.MainPage).SetLoading(true, "loading sponsor..."); currentSponsor = _sponsor; sponsorTemp = parentSponsor; VcardContact c_user = new VcardContact(); c_user.FirstName = currentSponsor.company.CompanyName; c_user.LastName = currentSponsor.company.CompanyName; c_user.company = currentSponsor.company.CompanyName; c_user.phoneNumber = currentSponsor.company.companyPhone; c_user.email = currentSponsor.company.companyEmail; App.contactuser = c_user; if (currentSponsor.company != null) { CheckSocialVisiblilty(); if (!string.IsNullOrEmpty(currentSponsor.company.companyLogo)) { sponsorLogo.Source = currentSponsor.company.companyLogo; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(currentSponsor.company.CompanyName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } else { sponsorLogo.Source = ""; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(currentSponsor.company.CompanyName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } if (!string.IsNullOrEmpty(currentSponsor.company.CompanyName)) { sponsorName.Text = currentSponsor.company.CompanyName; } else { sponsorName.Text = ""; } if (currentSponsor.sponsor.sponsorFields.Count > 0) { BaseFunctions.GetCustomFields(customFieldsLayout, currentSponsor.sponsor.sponsorFields); } if (!string.IsNullOrEmpty(currentSponsor.company.companyWebsite)) { websiteURL = currentSponsor.company.companyWebsite; } id = _sponsor.sponsor.sponsorID; if (!string.IsNullOrEmpty(currentSponsor.company.companyDescription)) { description.Text = currentSponsor.company.companyDescription; emptyList.IsVisible = false; } else { emptyList.IsVisible = true; description.ParentView.IsVisible = false; } } CheckBookmark(App.serverData.mei_user.currentUser.userBookmarks.isBookmarked(currentSponsor)); await Task.Delay(1000); await((HomeLayout)App.Current.MainPage).SetLoading(false, ""); }
public async void SetSpeakerDetail(ServerSpeaker speaker, SpeakerTemplate parentSpeaker) { await((HomeLayout)App.Current.MainPage).SetLoading(true, "loading speaker..."); currentSpeaker = speaker; speakerTemp = parentSpeaker; VcardContact c_user = new VcardContact(); c_user.FirstName = currentSpeaker.speakerFirstName; c_user.LastName = currentSpeaker.speakerLastName; c_user.company = currentSpeaker.speakerCompany; c_user.phoneNumber = currentSpeaker.speakerPhone; c_user.email = currentSpeaker.speakerEmail; App.contactuser = c_user; if (speaker != null) { CheckSocialVisiblilty(); if (!string.IsNullOrEmpty(speaker.speakerFirstName) || !string.IsNullOrEmpty(speaker.speakerLastName)) { speakerFullNameText.Text = speaker.speakerFirstName + " " + speaker.speakerLastName; } else { speakerFullNameText.Text = ""; } if (!string.IsNullOrEmpty(speaker.speakerPosition)) { positionText.Text = speaker.speakerPosition; } else { positionText.Text = ""; } if (!string.IsNullOrEmpty(speaker.speakerCompany)) { companyText.Text = speaker.speakerCompany; } else { companyText.Text = ""; } if (!string.IsNullOrEmpty(speaker.speakerImage)) { speakerIcon.Source = speaker.speakerImage; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(speaker.speakerFirstName + " " + speaker.speakerLastName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } else { speakerIcon.Source = ""; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(speaker.speakerFirstName + " " + speaker.speakerLastName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } } if (((HomeLayout)App.Current.MainPage).bookmarksPage != null) { if (!((HomeLayout)App.Current.MainPage).bookmarksPage.IsVisible) { CreateSessionList(await BaseFunctions.GetSpeakerCurrentEventSessions(((HomeLayout)App.Current.MainPage).GetCurrentDomainEvent().sessionList, speaker.speakerID)); } else { CreateSessionList(await App.serverData.GetSpeakerAllEventsSessions(speaker.speakerID)); } } else { CreateSessionList(await BaseFunctions.GetSpeakerCurrentEventSessions(((HomeLayout)App.Current.MainPage).GetCurrentDomainEvent().sessionList, speaker.speakerID)); } CheckBookmark(App.serverData.mei_user.currentUser.userBookmarks.isBookmarked(currentSpeaker)); await Task.Delay(1000); await((HomeLayout)App.Current.MainPage).SetLoading(false, ""); }