Beispiel #1
0
        public async Task <SearchProductsViewModel> SearchFilter(string parameters, string email, string customerToken)
        {
            string resultContent;
            HttpResponseMessage     httpResponseMessage;
            SearchProductsViewModel searchProductsViewModel;

            httpResponseMessage = await HttpClientRequest.GetAsyncParam(ApiEndpoints.SearchFilter, parameters, email, customerToken);

            resultContent           = httpResponseMessage.Content.ReadAsStringAsync().Result;
            searchProductsViewModel = JsonConvert.DeserializeObject <SearchProductsViewModel>(resultContent);

            return(searchProductsViewModel);
        }
Beispiel #2
0
        public async Task <ProductsTopViewModel> GetTopViewAsync()
        {
            string resultContent;
            HttpResponseMessage  httpResponseMessage;
            ProductsTopViewModel productsTopViewModel;

            httpResponseMessage = await HttpClientRequest.GetAsync(ApiEndpoints.ProductTopView);

            resultContent        = httpResponseMessage.Content.ReadAsStringAsync().Result;
            productsTopViewModel = JsonConvert.DeserializeObject <ProductsTopViewModel>(resultContent);

            return(productsTopViewModel);
        }
Beispiel #3
0
        public async Task <ProductDetailBaseModel> GetAsyncParamDetailLogin(string parameters, string email, string customerToken)
        {
            string resultContent;
            HttpResponseMessage    httpResponseMessage;
            ProductDetailBaseModel productDetailModel;

            httpResponseMessage = await HttpClientRequest.GetAsyncParam(ApiEndpoints.ProductDetail, parameters, email, customerToken);

            resultContent      = httpResponseMessage.Content.ReadAsStringAsync().Result;
            productDetailModel = JsonConvert.DeserializeObject <ProductDetailBaseModel>(resultContent);

            return(productDetailModel);
        }
Beispiel #4
0
        public async Task <CategoriesModel> GetAsync()
        {
            string resultContent;
            HttpResponseMessage httpResponseMessage;
            CategoriesModel     categoriesModel;

            httpResponseMessage = await HttpClientRequest.GetAsync(ApiEndpoints.AllCategories);

            resultContent   = httpResponseMessage.Content.ReadAsStringAsync().Result;
            categoriesModel = JsonConvert.DeserializeObject <CategoriesModel>(resultContent);

            return(categoriesModel);
        }
        public async Task <NewsletterModel> GetAsync()
        {
            string resultContent;

            HttpResponseMessage httpResponseMessage;
            NewsletterModel     newsletterModel;

            httpResponseMessage = await HttpClientRequest.GetAsync(ApiEndpoints.Newsletter);

            resultContent   = httpResponseMessage.Content.ReadAsStringAsync().Result;
            newsletterModel = JsonConvert.DeserializeObject <NewsletterModel>(resultContent);

            return(newsletterModel);
        }
        public async Task <BrandsModel> GetAsync()
        {
            string resultContent;
            HttpResponseMessage httpResponseMessage;
            BrandsModel         brandsModel;

            httpResponseMessage = await HttpClientRequest.GetAsync(ApiEndpoints.AllBrands);

            resultContent = httpResponseMessage.Content.ReadAsStringAsync().Result;
            brandsModel   = JsonConvert.DeserializeObject <BrandsModel>(resultContent);
            brandsModel.data.Add(new ObjectBrands {
                productBrandDescription = "ALL BRANDS"
            });

            return(brandsModel);
        }