public VentataProduct Update(VentataProduct product) { VentataProduct productWithId = RestHelper.CallResource( "PUT", String.Format("{0}?ApiKey={1}", "product", storeApiKey), product.ToJSON() //we are going to PUT to Products with the new product information ).FromJSON <VentataProduct>(); //then we convert it the JSON to a Ventata Product return(productWithId); }
public VentataStore Update(VentataStore store) { VentataStore storeWithId = RestHelper.CallResource( "PUT", String.Format("{0}?ApiKey={1}", "store", companyApiKey), store.ToJSON() //we are going to PUT to Stores with the new store information ).FromJSON <VentataStore>(); //then we convert it the JSON to a Ventata Store return(storeWithId); }
public VentataOrder Update(VentataOrder order) { VentataOrder orderWithId = RestHelper.CallResource( "PUT", String.Format("{0}?ApiKey={1}", "order", storeApiKey), order.ToJSON() //we are going to PUT to Orders with the new order information ).FromJSON <VentataOrder>(); //then we convert it the JSON to a Ventata Order return(orderWithId); }
public VentataStore Get(Guid VentataStoreId) { VentataStore storeWithId = RestHelper.CallResource( "GET", String.Format("{0}/{1}?ApiKey={2}", "store", VentataStoreId, companyApiKey) //we are going to GET from Stores by hitting store/{id} ).FromJSON <VentataStore>(); //then we convert it the JSON to a Ventata Store return(storeWithId); }
public VentataProduct GetProductByStoreCode(string InternalProductId) { VentataProduct productWithId = RestHelper.CallResource( "GET", String.Format("{0}/{1}?ApiKey={2}", "product/provider/", InternalProductId, storeApiKey) //we are going to GET from Products by hitting product/{id} ).FromJSON <VentataProduct>(); //then we convert it the JSON to a Ventata Product return(productWithId); }
public VentataProduct GetNewPrice(Guid VentataProductId) { VentataProduct productWithId = RestHelper.CallResource( "GET", String.Format("{0}/{1}/price?ApiKey={2}", "product", VentataProductId, storeApiKey) //we are going to GET from Products by hitting product/{id} ).FromJSON <VentataProduct>(); //then we convert it the JSON to a Ventata Product return(productWithId); }
public VentataOrder Get(Guid VentataOrderId) { VentataOrder orderWithId = RestHelper.CallResource( "GET", String.Format("{0}/{1}?ApiKey={2}", "order", VentataOrderId, storeApiKey) //we are going to GET from Orders by hitting order/{id} ).FromJSON <VentataOrder>(); //then we convert it the JSON to a Ventata Order return(orderWithId); }
public bool Delete(Guid VentataStoreId) { //We added a simple try/catch to give some feedback if the call didn't go through //I would expand this section to add your own exception handling try { //we are going to DELETE from Stores by hitting store/{id} RestHelper.CallResource( "DELETE", String.Format("{0}/{1}?ApiKey={2}", "store", VentataStoreId, companyApiKey) ); return(true); } catch { return(false); } }