private async void OnConfirmOrderClicked(object sender, EventArgs e)
        {
            var current = Connectivity.NetworkAccess;

            if (current == NetworkAccess.Internet)
            {
                // Connection to internet is available
                var client      = new HttpClient(new HttpClientHandler());
                var url         = "https://10.0.2.2:5001/TshirtOrder";
                var TShirttable = new TShirtTable();
                var json        = JsonConvert.SerializeObject(TShirttable);
                var content     = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
                try
                {
                    var response = await client.PostAsync(url, content);
                    await DisplayAlert("Response Message", response.ReasonPhrase, "ok");
                }
                catch (Exception)
                {
                    await DisplayAlert("Exceptions", "Try Again", "ok");
                }
            }
            else
            {
                await DisplayAlert("CHECK YOUR DATA NOOB", "Please check internet connection", "Thank you");
            }
        }
        protected override void OnAppearing()
        {
            base.OnAppearing();

            var tShirttable = new TShirtTable();

            BindingContext = tShirttable;
        }
Ejemplo n.º 3
0
 public Task <int> SaveItemAsync(TShirtTable item)
 {
     if (item.ID != 0)
     {
         return(database.UpdateAsync(item));
     }
     else
     {
         return(database.InsertAsync(item));
     }
 }
Ejemplo n.º 4
0
 public Task <int> DeleteItemAsync(TShirtTable item)
 {
     return(database.DeleteAsync(item));
 }
 private void SelectedTShirtOrder(object sender, SelectedItemChangedEventArgs e)
 {
     Orders = e.SelectedItem as TShirtTable;
 }