async Task <IEnumerable <Product> > load() { var request = new Rest(Globals.Global.apiProduct, Method.GET); var response = await SingletonClient.GetClient().Execute <IEnumerable <Product> >(request.request); return(response.Data); }
async Task <ICollection <Category> > load() { var request = new Rest(Globals.Global.apiCategories, Method.GET); var response = await SingletonClient.GetClient().Execute <ICollection <Category> >(request.request); return(response.Data); }
async void DeleteButtonOnClicked(object sender, EventArgs eventArgs) { var request = new Rest(Globals.Global.baseUrl + _product.ProductId, Method.DELETE); var response = await SingletonClient.GetClient().Execute(request.request); if (response.IsSuccess) { await Navigation.PopAsync(); } }
async void CreateButtonOnClicked(object sender, EventArgs eventArgs) { var request = new Rest(Globals.Global.apiProduct, Method.PUT); var response = SingletonClient.GetClient().Execute(request); if (response.Result.IsSuccess) { await Navigation.PopAsync(); } }
async void SaveButtonOnClicked(object sender, EventArgs eventArgs) { var request = new Rest(Globals.Global.apiProduct, Method.PUT); var response = await SingletonClient.GetClient().Execute(request.request.AddBody(_product)); if (response.IsSuccess) { await Navigation.PopAsync(); } }
async void OnButtonClicked(object sender, EventArgs e) { var email = user.Email; var password = user.Password; var connect = new Rest(Globals.Global.apiApiKey + email + Globals.Global.passwordQuery + password, Method.GET); var response = await SingletonClient.GetClient().Execute <User>(connect.request); user = response.Data; await Navigation.PushAsync(new ProductsPage(user)); }