private void sendBtn_Click(object sender, EventArgs e) { if (UPC.Text == "") { apiResponse.Text = "No UPC!"; return; } logMessage("Sending Product Update API..."); PovelliProduct[] products = new PovelliProduct[1]; products[0] = new PovelliProduct(storeUID.Text, UPC.Text, size.Text); products[0].name = productTitle.Text; products[0].family = ""; // Category or Department products[0].manufacturer = ""; try { products[0].price = Double.Parse(productPrice.Text); } catch { products[0].price = 0.0; } try { PovelliResponse res = getPovelliApi().updateProducts(products); if (res.success) { logMessage("Product Added or Updated."); } else { logMessage(res.ToString()); } } catch (Exception exc) { logMessage(exc.ToString()); } }
public PovelliResponse updateProducts(PovelliProduct [] products) { PovelliResponse res = this.sendRequest( PovelliAPI.DEFAULT_API_DOMAIN, PovelliAPI.API_URL_PRODUCTS_UPDATE, this.dataToJson(products, typeof(PovelliProduct[]))); return res; }