public async Task GetAttendees() { wrapLayout.Children.Clear(); Attendees = new ObservableRangeCollection <AttendeeListItem>(); var cloudService = ServiceLocator.Instance.Resolve <ICloudService>(); var AttendeeTable = cloudService.GetTable <AttendeeDetails>(); var Table = cloudService.GetTable <UserDetails>(); List <AttendeeListItem> temp = new List <AttendeeListItem>(); ICollection <AttendeeDetails> attendeeDetails = await AttendeeTable.GetTable().ToListAsync(); //Only Get accepted attendees if (attendeeDetails == null) { return; } attendeeDetails = SortAttendeeDetails(attendeeDetails).ToList(); foreach (var att in attendeeDetails) { UserDetails tempDetails = await Table.ReadItemAsync(att.userId); tempDetails.Id = att.chargeId; tempDetails.partyID = att.partyId; tempDetails.attendeeID = att.Id; AttendeeListItem attitem = new AttendeeListItem(tempDetails); attitem.Accepted = att.accepted; attitem.Declined = att.declined; attitem.Paid = att.paid; attitem.userDetails = tempDetails; wrapLayout.Children.Add(new AttendeeView(attitem)); } }
private void InitializeAttendeeCard(AttendeeListItem attendeeListItem) { //Icon = //partyDetailsItem.hostpicture; BackgroundImage = attendeeListItem.picture; Title = attendeeListItem.name; subTitle = attendeeListItem.rating.ToString(); //LeftDetail = "Current Location From me"; //RightDetail = "DKK" + partyDetailsItem.price; }
public Task SaveAttendeeListItem(AttendeeListItem attendee) { var collection = Database().GetCollection <AttendeeListItem>("AttendeeList"); if (attendee.Id == ObjectId.Empty) { return(collection.InsertOneAsync(attendee)); } else { var filter = Builders <AttendeeListItem> .Filter.Eq(s => s.Id, attendee.Id); return(collection.ReplaceOneAsync(filter, attendee)); } }
public static async Task Handle(NewRegistrationEvent newRegistrationEvent) { var dl = new HandlerDataLayer(); var item = await dl.GetAttendeeListItemByEmail(newRegistrationEvent.Email); if (item == null) { item = new AttendeeListItem { Email = newRegistrationEvent.Email, Count = 0 }; } item.Name = newRegistrationEvent.Name; item.FirstName = newRegistrationEvent.FirstName; item.Company = newRegistrationEvent.Company; item.Count++; await dl.SaveAttendeeListItem(item); }
public AttendeeView(AttendeeListItem valueSource) { attendee = valueSource; attendeeImage = valueSource.picture; BindingContext = this; Content = new CircleImage() { HeightRequest = ImageSize, Source = attendeeImage, WidthRequest = ImageSize, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center }; var gesture = new TapGestureRecognizer() { Command = new Command(async() => await ExecuteTappedCommand().ConfigureAwait(false)) }; this.GestureRecognizers.Add(gesture); }
public UserCardView(AttendeeListItem item) { InitializeComponent(); Attendee = item; BindingContext = this;// new UserCardViewModel(item); }
public async Task Refresh() { Attendees = new ObservableRangeCollection <AttendeeListItem>(); var cloudService = ServiceLocator.Instance.Resolve <ICloudService>(); var AttendeeTable = cloudService.GetTable <AttendeeDetails>(); var Table = cloudService.GetTable <UserDetails>(); List <AttendeeListItem> temp = new List <AttendeeListItem>(); ICollection <AttendeeDetails> attendeeDetails = await AttendeeTable.ReadAllItemsAsync(); if (attendeeDetails == null || attendeeDetails.Count <= 0) { return; } foreach (var att in attendeeDetails) { try { UserDetails tempDetails = await Table.ReadItemAsync(att.userId); tempDetails.Id = att.chargeId; tempDetails.partyID = att.partyId; tempDetails.attendeeID = att.Id; AttendeeListItem attitem = new AttendeeListItem(tempDetails); attitem.Accepted = att.accepted; attitem.Declined = att.declined; attitem.Paid = att.paid; attitem.userDetails = tempDetails; switch (attendeeType) { case AttendeeType.Pending: if (attitem.Accepted == false && attitem.Declined == false) { temp.Add(attitem); } break; case AttendeeType.Accepted: if (attitem.Accepted == true) { temp.Add(attitem); } break; case AttendeeType.Declined: if (attitem.Declined == true) { temp.Add(attitem); } break; } } catch (Exception ex) { await Application.Current.MainPage.DisplayAlert("Alert", att.Id + ": " + ex.Message + " You have been alerted", "OK"); return; //throw new NullReferenceException(); } } ImageHelper.LoadedImages.Clear(); Attendees.AddRange(temp); }
public UserCardViewModel(AttendeeListItem item) { attendee = item; }