private async void GetLastInvoice() { try { InvoiceDetailsProperty.IsLoading = true; var modelGetSalesInvoice = new BLL.M.Mobile.GetSalesInvoiceByEmail { Email = AppStatics.UserProfile.Email, PageSize = 1, CurrentPage = 0 }; var responseProducts = await new Services.HttpExtension <List <BLL.M.Mobile.Invoice> >().Post("SalesInvoice/GetInvoicesByEMail", modelGetSalesInvoice); if (responseProducts != null) { InvoiceDetailsProperty.Invoice = responseProducts.SingleOrDefault(); } } catch (Exception ex) { if (Xamarin.Essentials.Connectivity.NetworkAccess != Xamarin.Essentials.NetworkAccess.Internet) { await App._nav.DisplayAlert(MultiLanguage.MLResource.InternetConnectionTitle, MultiLanguage.MLResource.InternetConnectionMessage, MultiLanguage.MLResource.Ok); } else #if DEBUG { await App._nav.DisplayAlert(MultiLanguage.MLResource.Error, ex.ToString(), MultiLanguage.MLResource.Ok); } #elif RELEASE { await App._nav.DisplayAlert(MultiLanguage.MLResource.Error, MultiLanguage.MLResource.FailedMessage, MultiLanguage.MLResource.Ok); } #endif } InvoiceDetailsProperty.IsLoading = false; }
public MyOrdersPage() { InitializeComponent(); modelGetSalesInvoice = new BLL.M.Mobile.GetSalesInvoiceByEmail { Email = AppStatics.UserProfile.Email, PageSize = 5, CurrentPage = 0 }; BindingContext = this; }