Example #1
0
        private ProductDetailInfo GetProduct()
        {
            var svc     = new CatalogServicesClient();
            var product = svc.GetProductDetailInformationsAsync(this.ProductId).Result;

            return(product);
        }
Example #2
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            string queryText = (string)e.Parameter;
            var    svc       = new CatalogServicesClient();
            var    result    = svc.SearchInCatalogAsync(queryText).Result;

            var categoriesGroup = new SampleDataGroup("1", "Categories", "Product categories", string.Empty, string.Empty);
            var categories      = from c in result.Categories
                                  orderby c.Name
                                  select new SampleDataItem(c.Id.ToString(), c.Name, string.Empty, svc.GetImageUrlByCategoryIdAsync(c.Id).Result, c.Description, string.Empty, categoriesGroup)
            {
            };

            categoriesGroup.SetItems(categories);

            var productsGroup = new SampleDataGroup("2", "Products", "Products", string.Empty, string.Empty);
            var products      = from c in result.Products
                                orderby c.Name
                                select new SampleDataItem(c.Id.ToString(), c.Name, string.Empty, string.Empty, string.Empty, string.Empty, productsGroup)
            {
            };

            productsGroup.SetItems(products);

            var groups = new ObservableCollection <SampleDataGroup>()
            {
                categoriesGroup,
                productsGroup
            };

            this.DefaultViewModel["Groups"] = groups;
            //RefreshData();
        }
Example #3
0
        private async void RefreshData()
        {
            var svc = new CatalogServicesClient();
            Task <ObservableCollection <ProductCategoryInfo> > categoryFetcher = svc.GetProductCategoriesAsync();
            var categories = await categoryFetcher;

            this.DefaultViewModel["Items"] = from c in categories
                                             orderby c.Name
                                             select new SampleDataItem(
                c.Id.ToString(),
                c.Name,
                c.Description,
                svc.GetImageUrlByCategoryIdAsync(c.Id).Result,
                c.Description,
                string.Empty,
                null
                );
        }
Example #4
0
 private void RefreshData()
 {
     if (categoryId.HasValue)
     {
         var svc      = new CatalogServicesClient();
         var products = from p in svc.GetProductsByCategoryIdAsync(categoryId.Value).Result
                        orderby p.Name
                        select new SampleDataItem(
             p.Id.ToString(),
             p.Name,
             p.UnitPrice.ToString(),
             string.Empty,
             string.Empty,
             string.Empty,
             null
             );
         this.DefaultViewModel["Items"] = products;
     }
 }
Example #5
0
        public SoapCatalogServices()
        {
            Contract.Ensures(this.Service != null);

            this.Service = new CatalogServicesClient();
        }
Example #6
0
        private void btnSearchS_Click(object sender, EventArgs e)
        {
            var svc = new CatalogServicesClient();

            svc.SearchInCatalog("c");
        }
Example #7
0
        private void btnProductsByCategoryS_Click(object sender, EventArgs e)
        {
            var svc = new CatalogServicesClient();

            svc.GetProductsByCategoryId(1);
        }
Example #8
0
        private void btnCategorieSoap_Click(object sender, EventArgs e)
        {
            var svc = new CatalogServicesClient();

            svc.GetProductCategories();
        }