private async Task CountProducts() { UpdateProgress("Counting Products...", true); product product = new product(); int count = ShopifyRequests.GetProductCount(thisApp.api_key, thisApp.password, thisApp.GetFullUrl(""), "https://ashishstoretrex.myshopify.com/admin/products/count.json"); txtCount.Text = "Total Prducts : " + Convert.ToString(count); UpdateProgress("Counting Products...", false); }
private void DeleteProduct(Products product, int indexOf) { UpdateProgress("Deleting...", true); bool isCreated = ShopifyRequests.DeleteProduct(thisApp.api_key, thisApp.password, thisApp.GetFullUrl(""), product); if (isCreated == true) { thisApp.productsCollection.RemoveAt(indexOf); } thisApp.productsCollection.OrderBy(v => v.title); UpdateProgress("Deleted", false); }
public ProductViewModel() { List <product> models = ShopifyRequests.GetAllProducts(thisApp.api_key, thisApp.password, thisApp.GetFullUrl("")); if (models != null) { List <product> recrods = models as List <product>; ShopifyProductViewModel = new ObservableCollection <product>(); foreach (var record in recrods) { ShopifyProductViewModel.Add(record); } } }
private void UpdateProduct(Products product, int productIndex) { UpdateProgress("Updating product...", true); var updateRecrod = ShopifyRequests.UpdateProduct(thisApp.api_key, thisApp.password, thisApp.GetFullUrl(""), product); if (updateRecrod) { thisApp.productsCollection.RemoveAt(productIndex); thisApp.productsCollection.Add(product.product); thisApp.productsCollection.OrderBy(v => v.title); //await InitialServerCall(); } UpdateProgress("Updated", false); }
private async Task LoadProducts() { UpdateProgress("Getting Products...", true); List <product> newRecords = new List <product>(); newRecords = ShopifyRequests.GetAllProducts(thisApp.api_key, thisApp.password, thisApp.GetFullUrl("")); if (newRecords != null) { thisApp.productsCollection.Clear(); foreach (var x in newRecords) { thisApp.productsCollection.Add(x); } } UpdateProgress("Completed.", false); thisApp.productsCollection.OrderBy(v => v.title); }
private void CreateProduct() { UpdateProgress("Creting product...", true); Products products = new Products() { product = new product() { title = txtProductName.Text, } }; bool isCreated = ShopifyRequests.CreateProduct(thisApp.api_key, thisApp.password, thisApp.GetFullUrl(""), products); if (isCreated == true) { thisApp.productsCollection.Add(products.product); thisApp.productsCollection.OrderBy(v => v.title); } UpdateProgress("Created.", false); }
private void GetProductById(string prodId) { UpdateProgress("Fetching Product...", true); product isCreated = new product(); isCreated = ShopifyRequests.GetProduct(thisApp.api_key, thisApp.password, thisApp.GetFullUrl(""), "https://ashishstoretrex.myshopify.com/admin/products/" + prodId + ".json"); if (isCreated != null) { product pros = new product() { id = isCreated.id, title = isCreated.title }; thisApp.productsCollection.Clear(); thisApp.productsCollection.Add(pros); thisApp.productsCollection.OrderBy(v => v.title); } UpdateProgress("Completed", false); }