Beispiel #1
0
        public Product SaveProduct(Product product)
        {
            Product result = null;

            var vendRequest = new VendRequest(this.Url, this.Username, this.Password);
            var response    = vendRequest.Post("/api/products", product.ToJson());

            if (!string.IsNullOrEmpty(response))
            {
                var productWrapper = response.FromJson <ProductWrapper>();
                result = productWrapper.Product;
            }

            return(result);
        }
Beispiel #2
0
        public Consignment SaveStockTransfer(StockTransfer stockTransfer)
        {
            Consignment result = null;

            var vendRequest = new VendRequest(this.Url, this.Username, this.Password);
            var response    = vendRequest.Post("/api/stock_transfers", stockTransfer.ToJson());

            if (!string.IsNullOrEmpty(response))
            {
                var consignmentWrapper = response.FromJson <ConsignmentWrapper>();
                result = consignmentWrapper.Consignment;
            }

            return(result);
        }
Beispiel #3
0
        public RegisterSale SaveRegisterSale(RegisterSale registerSale)
        {
            RegisterSale result = null;

            var vendRequest = new VendRequest(this.Url, this.Username, this.Password);
            var response    = vendRequest.Post("/api/register_sales", registerSale.ToJson());

            if (!string.IsNullOrEmpty(response))
            {
                var responseRegisterSale = response.FromJson <RegisterSaleWrapper>();
                result = responseRegisterSale.RegisterSale;
            }

            return(result);
        }