public void SetExhibitors(ExhibitorGroup _exhibitor)
        {
            currentExhibitor = _exhibitor;
            var exhibitorCompany = currentExhibitor.company;

            if (!string.IsNullOrEmpty(exhibitorCompany.companyLogo))
            {
                companyLogo.IsVisible = true;
                companyLogo.Source    = exhibitorCompany.companyLogo;
                //logoGrid.BackgroundColor = Color.Transparent;
                Regex  initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?");
                string init     = initials.Replace(exhibitorCompany.CompanyName, "$1");
                if (init.Length > 3)
                {
                    init = init.Substring(0, 3);
                }
                logoText.Text = init.ToUpper();
            }
            else
            {
                companyLogo.IsVisible = false;
                companyLogo.Source    = "";
                //logoGrid.BackgroundColor = Color.FromHex("#31c3ee");
                Regex  initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?");
                string init     = initials.Replace(exhibitorCompany.CompanyName, "$1");
                if (init.Length > 3)
                {
                    init = init.Substring(0, 3);
                }
                logoText.Text = init.ToUpper();
            }
            if (!string.IsNullOrEmpty(exhibitorCompany.CompanyName))
            {
                companyName.Text = exhibitorCompany.CompanyName;
            }
            else
            {
                companyName.Text = "";
            }
            id = _exhibitor.exhibitor.exhibitorID;
            //CheckBookmark(((HomeLayout)App.Current.MainPage).currentUser.userBookmarks.isBookmarked(currentExhibitor));
        }
Esempio n. 2
0
        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, "");
        }
Esempio n. 3
0
        public async void ExhibitorDetials(ExhibitorGroup _exhibitor, ExhibitorsTemplate parentEx)
        {
            await((HomeLayout)App.Current.MainPage).SetLoading(true, "loading exhibitor...");
            currentExhibitor = _exhibitor;
            parentExhibitor  = parentEx;
            VcardContact c_user = new VcardContact();

            c_user.FirstName   = currentExhibitor.company.CompanyName;
            c_user.LastName    = currentExhibitor.company.CompanyName;
            c_user.company     = currentExhibitor.company.CompanyName;
            c_user.phoneNumber = currentExhibitor.company.companyPhone;
            c_user.email       = currentExhibitor.company.companyEmail;
            App.contactuser    = c_user;
            if (currentExhibitor.company != null && currentExhibitor != null)
            {
                CheckSocialVisiblilty();
                if (!string.IsNullOrEmpty(currentExhibitor.company.companyLogo))
                {
                    exhibitorLogo.Source = currentExhibitor.company.companyLogo;
                    Regex  initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?");
                    string init     = initials.Replace(currentExhibitor.company.CompanyName, "$1");
                    if (init.Length > 3)
                    {
                        init = init.Substring(0, 3);
                    }
                    logoText.Text = init.ToUpper();
                }
                else
                {
                    exhibitorLogo.Source = "";
                    Regex  initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?");
                    string init     = initials.Replace(currentExhibitor.company.CompanyName, "$1");
                    if (init.Length > 3)
                    {
                        init = init.Substring(0, 3);
                    }
                    logoText.Text = init.ToUpper();
                }
                if (!string.IsNullOrEmpty(currentExhibitor.company.CompanyName))
                {
                    exhibitorName.Text = currentExhibitor.company.CompanyName;
                }
                if (currentExhibitor.exhibitor.exhibitorFields.Count > 0)
                {
                    BaseFunctions.GetCustomFields(customFieldsLayout, currentExhibitor.exhibitor.exhibitorFields);
                }
                id = currentExhibitor.exhibitor.exhibitorID;
                if (!string.IsNullOrEmpty(currentExhibitor.company.companyDescription))
                {
                    description.Text    = currentExhibitor.company.companyDescription;
                    emptyList.IsVisible = false;
                }
                else
                {
                    ((ContentView)description.Parent).IsVisible = false;
                    emptyList.IsVisible = true;
                }
                CheckBookmark(App.serverData.mei_user.currentUser.userBookmarks.isBookmarked(currentExhibitor));
            }
            await Task.Delay(1000);

            await((HomeLayout)App.Current.MainPage).SetLoading(false, "loading exhibitor...");
        }