async void getInfo() { if (Xamarin.Essentials.Connectivity.NetworkAccess != Xamarin.Essentials.NetworkAccess.Internet) { Device.BeginInvokeOnMainThread(async() => await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorNoInternet, "OK")); return; } ItemsList <AccountAccountingInfo> info = await _server.GetAccountingInfo(); if (info.Error == null) { _accountingInfo = info.Data; _accountingInfos = _accountingInfo; /*viewModel.*/ LoadAccounts.Execute(info.Data); //this.BindingContext = this; } else { await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorCountersNoData, "OK"); } }
private async Task RefreshData() { if (Xamarin.Essentials.Connectivity.NetworkAccess != Xamarin.Essentials.NetworkAccess.Internet) { Device.BeginInvokeOnMainThread(async() => await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorNoInternet, "OK")); return; } ItemsList <AccountAccountingInfo> info = await _server.GetAccountingInfo(); if (info.Error == null) { Accounts = info.Data; additionalList.ItemsSource = null; additionalList.ItemsSource = setPays(Accounts[Picker.SelectedIndex]); } else { await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorPayInfo, "OK"); } }
private async Task RefreshData() { if (Xamarin.Essentials.Connectivity.NetworkAccess != Xamarin.Essentials.NetworkAccess.Internet) { Device.BeginInvokeOnMainThread(async() => await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorNoInternet, "OK")); return; } ItemsList <AccountAccountingInfo> info = await _server.GetAccountingInfo(); if (info.Error == null) { SetBills(info.Data); isSortDate = !isSortDate; SortDate(); // additionalList.ItemsSource = null; // additionalList.ItemsSource = BillInfos; } else { await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorInfoBills, "OK"); } }