Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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();
            }
        }
Пример #4
0
        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();
            }
        }
Пример #5
0
        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();
            }
        }
Пример #6
0
        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));
        }