public void SetSponsorDetails(SponsorGroup _company) { currentSponsor = _company; var company = _company.company; //this.ImageSource = company.companyLogo; //this.Text = company.companyName; if (!string.IsNullOrEmpty(company.companyName)) { companyName.Text = company.companyName; } else { companyName.Text = ""; } if (!string.IsNullOrEmpty(company.companyLogo)) { companyLogo.Source = company.companyLogo; //logoGrid.BackgroundColor = Color.Transparent; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(company.CompanyName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } else { companyLogo.Source = ""; //logoGrid.BackgroundColor = Color.FromHex("#31c3ee"); Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(company.CompanyName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } id = _company.sponsor.sponsorID; //CheckBookmark(((HomeLayout)App.Current.MainPage).currentUser.userBookmarks.isBookmarked(currentSponsor)); }
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 SessionDetails(ServerSession _session, ScheduleItem parentSes) { await((HomeLayout)App.Current.MainPage).SetLoading(true, "loading session..."); currentSession = _session; parentSession = parentSes; id = _session.sessionID; if (_session.eventID.Contains(":")) { sessionEvent.Text = (await App.serverData.GetSingleEventData(_session.eventID)).eventName; } else { sessionEvent.Text = _session.eventID; } if (!string.IsNullOrEmpty(_session.sessionTrack)) { sessionCategory.Text = _session.sessionTrack; } else { sessionCategory.Text = "category not specified"; } if (!string.IsNullOrEmpty(_session.sessionName)) { sessionName.Text = _session.sessionName; } else { sessionName.Text = ""; } if (!string.IsNullOrEmpty(_session.sessionLocation)) { location.Text = _session.sessionLocation; } else { location.Text = "not specified"; } DateTime start = DateTime.ParseExact((await App.serverData.GetSingleEventData(_session.eventID)).eventStartDate, "MM-dd-yyyy", CultureInfo.CurrentCulture.DateTimeFormat); time.Text = start.AddDays(_session.sessionDay).ToString("MM-dd-yyyy") + " / " + _session.sessionStartTime + " - " + _session.sessionEndTime; if (!string.IsNullOrEmpty(_session.sessionDescription)) { emptyList.IsVisible = false; description.Text = _session.sessionDescription; } else { description.IsVisible = false; emptyList.IsVisible = true; } CheckBookmark(App.serverData.mei_user.currentUser.userBookmarks.isBookmarked(currentSession)); if (_session.sessionSpeakers.Count > 0) { sessionSpeakers.Text = ""; for (int i = 0; i < _session.sessionSpeakers.Count; i++) { ServerSpeaker company = await App.serverData.GetOneSpeaker(_session.sessionSpeakers[i]); if (company != null) { sessionSpeakers.Text = sessionSpeakers.Text + (i + 1).ToString() + ". " + company.speakerFirstName + " " + company.speakerLastName + "<br>"; } } } speakersLoading.IsVisible = false; sessionSpeakers.IsVisible = true; if (_session.sessionExhibitors.Count > 0) { sessionExhibitors.Text = ""; for (int i = 0; i < _session.sessionExhibitors.Count; i++) { ExhibitorGroup company = await App.serverData.GetOneExhibitor(_session.sessionExhibitors[i]); if (company != null) { sessionExhibitors.Text = sessionExhibitors.Text + (i + 1).ToString() + ". " + company.company.CompanyName + "<br>"; } } } exhibitorsLoading.IsVisible = false; sessionExhibitors.IsVisible = true; if (_session.sessionSponsors.Count > 0) { sessionSponsors.Text = ""; for (int i = 0; i < _session.sessionSponsors.Count; i++) { SponsorGroup company = await App.serverData.GetOneSponsor(_session.sessionSponsors[i]); if (company != null) { sessionSponsors.Text = sessionSponsors.Text + (i + 1).ToString() + ". " + company.company.CompanyName + "<br>"; } } } sponsorsLoading.IsVisible = false; sessionSponsors.IsVisible = true; await Task.Delay(1000); await((HomeLayout)App.Current.MainPage).SetLoading(false, ""); }