public async void PullToRefresh() { sessionParent.IsRefreshing = true; await((HomeLayout)App.Current.MainPage).SetLoading(true, "loading your bookmarked sessions..."); if (bookMarked) { sessionParent.IsVisible = true; peopleSearch.BackgroundColor = Color.FromHex("#31c3ee"); sessionParent.IsPullToRefreshEnabled = false; sessionParent.IsGroupingEnabled = false; dayScrollView.IsVisible = false; peopleSearch.IsVisible = false; sessionParent.ChildRemoved += (s, e) => { if (App.serverData.mei_user.b_sessionList.Count > 0) { sessionParent.IsVisible = true; emptyList.IsVisible = false; //ListParent.IsVisible = true; } else { emptyList.IsVisible = true; sessionParent.IsVisible = false; //ListParent.IsVisible = false; } }; sessionParent.ItemsSource = App.serverData.mei_user.b_sessionList; await Task.Delay(1000); await((HomeLayout)App.Current.MainPage).SetLoading(false, ""); //CreateBookmarkList(App.serverData.b_sessionList.ToList()); } else { sessionParent.IsVisible = false; DomainEvent current = await((HomeLayout)App.Current.MainPage).GetCurrentEventAfterSyncingSessions(true); if (!current.s_event.eventStartDate.Equals(current.s_event.eventEndDate)) { if (BaseFunctions.GetMonth(current.s_event.eventStartDate) == BaseFunctions.GetMonth(current.s_event.eventEndDate)) { SetEventDateHeader(BaseFunctions.getMonthDay(current.s_event.eventStartDate) + " - " + BaseFunctions.getDayYear(current.s_event.eventEndDate)); } else { SetEventDateHeader(BaseFunctions.getMonthDay(current.s_event.eventStartDate) + " - " + BaseFunctions.getMonthDay(current.s_event.eventEndDate) + ", " + BaseFunctions.getYear(current.s_event.eventEndDate)); } } else { SetEventDateHeader(BaseFunctions.getMonthDay(current.s_event.eventStartDate) + ", " + BaseFunctions.getYear(current.s_event.eventEndDate)); } CreateList(current.s_event.eventStartDate, current.s_event.eventEndDate, current.sessionList); } sessionParent.IsRefreshing = false; }
public void SetEventDetails(DomainEvent currentEvent) { if (!string.IsNullOrEmpty(currentEvent.s_event.eventVenueName)) { currentCenter.Text = currentEvent.s_event.eventVenueName; } else { currentCenter.Text = ""; } if (!string.IsNullOrEmpty(currentEvent.s_event.eventName)) { currentEventName.Text = currentEvent.s_event.eventName; } else { currentEventName.Text = ""; } if (!string.IsNullOrEmpty(currentEvent.s_event.eventVenueMap.venueAddress)) { currentCityState.Text = currentEvent.s_event.eventVenueMap.venueAddress; } else { currentCityState.Text = ""; } if (!string.IsNullOrEmpty(currentEvent.s_event.eventLogo)) { eventIcon.Source = currentEvent.s_event.eventLogo; } else { eventIcon.Source = "eventicon.png"; } if (currentEvent.s_event.eventStartDate.Equals(currentEvent.s_event.eventEndDate)) { currentSchedule.Text = BaseFunctions.getMonthDay(currentEvent.s_event.eventStartDate) + ", " + BaseFunctions.getFullYear(currentEvent.s_event.eventStartDate); } else { if (BaseFunctions.GetMonth(currentEvent.s_event.eventStartDate) == BaseFunctions.GetMonth(currentEvent.s_event.eventEndDate)) { currentSchedule.Text = BaseFunctions.getMonthDay(currentEvent.s_event.eventStartDate) + " - " + BaseFunctions.getDayYear(currentEvent.s_event.eventStartDate); } else { currentSchedule.Text = BaseFunctions.getMonthDay(currentEvent.s_event.eventStartDate) + " - " + BaseFunctions.getMonthDay(currentEvent.s_event.eventEndDate) + ", " + BaseFunctions.getYear(currentEvent.s_event.eventEndDate); } } }
public async void OnSearchTextChange(object sender, EventArgs e) { if (canSearch) { current = await((HomeLayout)App.Current.MainPage).GetCurrentEventAfterSyncingSessions(false); if (!current.s_event.eventStartDate.Equals(current.s_event.eventEndDate)) { if (BaseFunctions.GetMonth(current.s_event.eventStartDate) == BaseFunctions.GetMonth(current.s_event.eventEndDate)) { SetEventDateHeader(BaseFunctions.getMonthDay(current.s_event.eventStartDate) + " - " + BaseFunctions.getDayYear(current.s_event.eventEndDate)); } else { SetEventDateHeader(BaseFunctions.getMonthDay(current.s_event.eventStartDate) + " - " + BaseFunctions.getMonthDay(current.s_event.eventEndDate) + ", " + BaseFunctions.getYear(current.s_event.eventEndDate)); } } else { SetEventDateHeader(BaseFunctions.getMonthDay(current.s_event.eventStartDate) + ", " + BaseFunctions.getYear(current.s_event.eventEndDate)); } CreateList(current.s_event.eventStartDate, current.s_event.eventEndDate, current.sessionList); } }
public async void SetAbout() { eventDescription.IsVisible = true; emptyList.IsVisible = false; await((HomeLayout)App.Current.MainPage).SetLoading(true, "Syncing event RSVP status..."); currentEvent = await((HomeLayout)App.Current.MainPage).GetCurrentDomainEventFromServer(); if (currentEvent.s_event.eventType != "Subscription") { cancelSubscription.IsVisible = false; } else { subscription = App.serverData.mei_user.userSubscriptionList.Find(x => x.planID == currentEvent.s_event.eventSubscriptionPlanID); if (subscription != null) { await((HomeLayout)App.Current.MainPage).SetLoading(true, "Syncing event RSVP status..."); string subStatus = await App.serverData.GetSubscriptionStatus(subscription.subscriptionID, "sub_status"); cancelSubscription.IsVisible = true; if ((subStatus.Equals("Canceled") || subStatus.Equals("Expired")) && currentEvent.s_event.eventSubscriptionType != "Single") { cancelSubscription.IsEnabled = false; if (subStatus.Equals("Canceled")) { cancelSubscription.Text = "Subscription Canceled"; } else { cancelSubscription.Text = "Subscription Expired"; } } else if (currentEvent.s_event.eventSubscriptionType != "Single") { cancelSubscription.IsVisible = false; } } } if (!string.IsNullOrEmpty(currentEvent.s_event.eventName)) { eventName.Text = currentEvent.s_event.eventName; } else { eventName.Text = "No event name"; } if (!string.IsNullOrEmpty(currentEvent.s_event.eventLogo)) { aboutEventLogo.Source = currentEvent.s_event.eventLogo; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(currentEvent.s_event.eventName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } else { aboutEventLogo.Source = ""; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(currentEvent.s_event.eventName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } if (!string.IsNullOrEmpty(currentEvent.s_event.eventVenueName)) { eventVenueName.Text = currentEvent.s_event.eventVenueName; } else { eventVenueName.Text = ""; } if (!string.IsNullOrEmpty(currentEvent.s_event.eventAbout)) { eventDescription.Text = currentEvent.s_event.eventAbout; } else { eventDescription.IsVisible = false; emptyList.IsVisible = true; if (!string.IsNullOrEmpty(currentEvent.s_event.eventDescription)) { eventDescription.Text = currentEvent.s_event.eventDescription; } else { eventDescription.IsVisible = false; emptyList.IsVisible = true; } } if (!string.IsNullOrEmpty(currentEvent.s_event.eventAddress)) { eventCityState.Text = currentEvent.s_event.eventAddress; } else { eventCityState.Text = ""; } if (currentEvent.s_event.eventStartDate.Equals(currentEvent.s_event.eventEndDate)) { eventDays.Text = BaseFunctions.getMonthDay(currentEvent.s_event.eventStartDate) + ", " + BaseFunctions.getYear(currentEvent.s_event.eventEndDate); } else { if (BaseFunctions.GetMonth(currentEvent.s_event.eventStartDate) == BaseFunctions.GetMonth(currentEvent.s_event.eventEndDate)) { eventDays.Text = BaseFunctions.getMonthDay(currentEvent.s_event.eventStartDate) + " - " + BaseFunctions.getDayYear(currentEvent.s_event.eventEndDate); } else { eventDays.Text = BaseFunctions.getMonthDay(currentEvent.s_event.eventStartDate) + " - " + BaseFunctions.getMonthDay(currentEvent.s_event.eventEndDate) + ", " + BaseFunctions.getYear(currentEvent.s_event.eventEndDate); } } var k = await rsvpTemplate.CheckRSVP(); await((HomeLayout)App.Current.MainPage).SetLoading(false, "Loading event sessions..."); }
public async void setEventITem(DomainEvent dEvent, EventHandler _clickEvent, int _eventIndex) { loading.IsVisible = true; await CheckLock(dEvent); if (!string.IsNullOrEmpty(dEvent.s_event.eventName)) { eventName.Text = dEvent.s_event.eventName; } else { eventName.Text = ""; } if (dEvent.s_event.eventStartDate.Equals(dEvent.s_event.eventEndDate)) { date.Text = BaseFunctions.getMonthDay(dEvent.s_event.eventStartDate) + ", " + BaseFunctions.getYear(dEvent.s_event.eventEndDate); } else { if (BaseFunctions.GetMonth(dEvent.s_event.eventStartDate) == BaseFunctions.GetMonth(dEvent.s_event.eventEndDate)) { date.Text = BaseFunctions.getMonthDay(dEvent.s_event.eventStartDate) + " - " + BaseFunctions.getDayYear(dEvent.s_event.eventEndDate); } else { date.Text = BaseFunctions.getMonthDay(dEvent.s_event.eventStartDate) + " - " + BaseFunctions.getMonthDay(dEvent.s_event.eventEndDate) + ", " + BaseFunctions.getYear(dEvent.s_event.eventEndDate); } } //if (!string.IsNullOrEmpty(DomainEvent.venueName)) // centerName.Text = DomainEvent.venueName; //else // centerName.Text = ""; if (!string.IsNullOrEmpty(dEvent.s_event.eventVenueMap.venueAddress)) { place.Text = dEvent.s_event.eventVenueMap.venueAddress; } else { place.Text = ""; } if (!string.IsNullOrEmpty(dEvent.s_event.eventLogo)) { eventImage.Source = dEvent.s_event.eventLogo; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(dEvent.s_event.eventName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } else { eventImage.Source = ""; Regex initials = new Regex(@"(\b[a-zA-Z])[a-zA-Z]* ?"); string init = initials.Replace(dEvent.s_event.eventName, "$1"); if (init.Length > 3) { init = init.Substring(0, 3); } logoText.Text = init.ToUpper(); } eventid = dEvent.s_event.eventID; eventIndex = _eventIndex; clickEvent.Tapped += _clickEvent; this.GestureRecognizers.Add(clickEvent); //switch (DomainEvent.eventStatus) //{ // case EventStatus.Current: // eventActiveStatus.Text = "Current"; // eventActiveStatus.TextColor = Color.FromHex("00a651"); // break; // case EventStatus.Expired: // eventActiveStatus.Text = "Expired"; // eventActiveStatus.TextColor = Color.FromHex("ef4300"); // break; // case EventStatus.UpComing: // eventActiveStatus.Text = "Upcoming"; // eventActiveStatus.TextColor = Color.FromHex("ffac4e"); // break; //} loading.IsVisible = false; }