예제 #1
0
        public async void Get()
        {
            var jData = await DataService.Get($"Masjeed/{Preferences.Get("TeamId", "")}");

            if (jData == "ConnectionError")
            {
                StandardMessagesDisplay.NoConnectionToast();
            }
            else if (jData == "null")
            {
                StandardMessagesDisplay.NoDataDisplayMessage();
            }
            else if (jData == "Error")
            {
                StandardMessagesDisplay.Error();
            }
            else if (jData == "ErrorTracked")
            {
                StandardMessagesDisplay.ErrorTracked();
            }
            else
            {
                try
                {
                    var data = JsonConvert.DeserializeObject <Dictionary <string, MasjeedModel> >(jData);

                    if (data != null)
                    {
                        foreach (KeyValuePair <string, MasjeedModel> item in data)
                        {
                            Masjeeds?.Add(
                                new MasjeedModel
                            {
                                FId           = item.Key.ToString(),
                                Id            = item.Value.Id,
                                MasjeedName   = item.Value.MasjeedName,
                                KeyInfluencer = item.Value.KeyInfluencer,
                                DoYouHavePermissionForAdsInMasjeed = item.Value.DoYouHavePermissionForAdsInMasjeed,
                                DoesImamSupportsVaccine            = item.Value.DoesImamSupportsVaccine,
                                Latitude  = item.Value.Latitude,
                                Longitude = item.Value.Longitude,
                                IsActive  = item.Value.IsActive
                            }
                                );
                        }
                    }
                }
                catch (Exception ex)
                {
                    Crashes.TrackError(ex);
                    StandardMessagesDisplay.InputToast(ex.Message);
                }
            }
        }
예제 #2
0
 void Clear()
 {
     Masjeeds?.Clear();
 }