private List <ProductProperty> getProductProperties(long productId) { var data = _productApi.GetProperties(productId); var list = JArrayToList.Convert <ProductProperty>(data.Data); return(list); }
private ProductProperty getCheaperProductProperty(long productId) { var data = _productAPI.GetProperties(productId); var list = JArrayToList.Convert <ProductProperty>(data.Data); list.Sort((x, y) => x.Price.CompareTo(y.Price)); return(list[0]); }
private void setProductImages() { if (Selected == null) { throw new Exception("No Property Property"); } var data = _productApi.GetPropertyImages(Selected.ProductPropertyId); this.ProductImages = JArrayToList.Convert <ProductImage>(data.Data); this.SelectedProductImageUrl = ProductImages[0].Url; }
private List <ProductImage> getImages() { if (cheaperProductProperty == null) { throw new Exception("No Product Property"); } var data = _productAPI.GetPropertyImages(cheaperProductProperty.ProductPropertyId); var list = JArrayToList.Convert <ProductImage>(data.Data); return(list); }
public List <ProductDetail> GetProductDetails(long productId) { var res = Get("product/properties/" + productId); if (res == null) { return(null); } if (res.Data == null) { return(null); } return(JArrayToList.Convert <ProductDetail>(res.Data)); }
public List <Product> GetProductsByCategoryId(long id) { var res = Get("product/category/" + id); if (res == null) { return(null); } if (res.Data == null) { return(null); } return(JArrayToList.Convert <Product>(res.Data)); }
public List <Category> getCategories() { var res = Get("category/all"); if (res == null) { return(null); } if (res.Data == null) { return(null); } return(JArrayToList.Convert <Category>(res.Data)); }
private void setCategories() { var result = _categoryApi.GetCategories(); if (result.Count > 0) { var list = JArrayToList.Convert <Category>(result.Data); MainCategoriesPanel.Children.Clear(); foreach (var item in list) { var label = new Label(); label.Content = item.Title; label.FontSize = 20; label.Tag = item.Id; label.MouseLeftButtonUp += MainCategoryOnClicked; MainCategoriesPanel.Children.Add(label); } } }
public List <Product> GetAllProducts() { var res = Get("product/all"); if (res == null) { return(null); } if (res.Data == null) { return(null); } var list = JArrayToList.Convert <Product>(res.Data); foreach (var item in list) { string image = GetProductImage(item.ProductId); item.ImageUrl = image; double price = getProductPrice(item.ProductId); item.Price = price; } return(list); }