private async void HandleTradeStatus() { try { var query = await CrossCloudFirestore.Current .Instance .Collection("requests").WhereEqualsTo("owner_id", item.user_id) .WhereEqualsTo("user_id", DependencyService.Get <IAuth>().getCurrentUserUID()) .GetAsync(); if (query.ToObjects <TradeRequestItem>().Count() > 0) { TradeRequestItem req_item = query.ToObjects <TradeRequestItem>().First(); tradeStatusText.IsVisible = true; TradeButton.IsVisible = false; if (req_item.is_declined) { tradeStatusText.Text = "Trade Request Denied by user"; } if (req_item.is_approved) { contactText.Text = user.contact; addressText.Text = user.address; tradeStatusText.Text = "Trade Request Approved"; } } }catch (Exception e) { } }
async void LoadRequestId(string requestId) { try { var document = await CrossCloudFirestore.Current .Instance .Collection("requests") .Document(requestId) .GetAsync(); request = document.ToObject <TradeRequestItem>(); if (request == null) { await DisplayAlert("Oh! Oh!", "Invalid Request", "OK"); return; } ProfilePicHolder.Source = request.user_photo_url; userNameText.Text = request.user_name; requestedTimeText.Text = request.request_time; itemText.Text = request.item_name; }catch (Exception e) { } }