private void AddSWProduct()
 {
     sw = new ShipwireClient(_uname, _pwd);
     long pid = sw.AddProduct(txtRawData.Text);
     txtRawData.Clear();
     txtRawData.Text = "ProductID: " + pid;
 }
 private void GetStocks()
 {
     sw = new ShipwireClient(_uname, _pwd);
     List<Stock> st = sw.GetStocks(64512, "");
     txtRawData.Clear();
     foreach (Stock s in st)
     {
         txtRawData.Text += String.Format("productID: {0} |sku: {1} |warehouseID: {2} |pending: {3}\n", s.productId, s.sku, s.warehouseId, s.pending);
     }
 }
Beispiel #3
0
    public static IEnumerable SW_GetVendors(string ShipwireUsername, string ShipwirePassword)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        List<SWVendor> vs = sw.GetVendors();

        return vs;
    }
Beispiel #4
0
    public static IEnumerable SW_GetReceivingOrders(string ShipwireUsername, string ShipwirePassword, string OrderStatus = null, string WarehouseIDs = null, string UpdatedAfter = null)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        eSWOrderStatus _s = eSWOrderStatus.all;
        string _w = "";
        string _u = "";

        if (!string.IsNullOrEmpty(OrderStatus))
        {
            if (Enum.TryParse(OrderStatus, out _s))
                _s = (eSWOrderStatus)Enum.Parse(typeof(eSWOrderStatus), OrderStatus);
        }

        if (!string.IsNullOrEmpty(WarehouseIDs))
            _w = WarehouseIDs;

        if (!string.IsNullOrEmpty(UpdatedAfter))
            _u = UpdatedAfter;

        return sw.GetReceivingOrders(_s, _w, _u);
    }
Beispiel #5
0
    public static IEnumerable SW_GetReceivingOrder(string ShipwireUsername, string ShipwirePassword, long OrderID)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        List<SWReceiving> l = new List<SWReceiving>();
        l.Add(sw.GetReceivingOrder(OrderID));

        return l;
    }
Beispiel #6
0
    public static IEnumerable SW_GetProduct(string ShipwireUsername, string ShipwirePassword, long ProductID)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        List<SWProduct> products = new List<SWProduct>();
        products.Add(sw.GetProduct(ProductID));

        return products;
    }
Beispiel #7
0
    public static IEnumerable SW_GetOrders(string ShipwireUsername, string ShipwirePassword, string Status = null, string WarehouseIDs = null, string UpdatedAfter = null)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        eSWOrderStatus s = eSWOrderStatus.all;
        string w = "";
        string u = "";

        if (!string.IsNullOrEmpty(Status))
        {
            if (Enum.TryParse(Status, out s))
                s = (eSWOrderStatus)Enum.Parse(typeof(eSWOrderStatus), Status);
        }

        if (!string.IsNullOrEmpty(WarehouseIDs))
            w = WarehouseIDs;

        if (!string.IsNullOrEmpty(UpdatedAfter))
            u = UpdatedAfter;

        return sw.GetOrders(s,w,u);
    }
Beispiel #8
0
    public static SqlInt32 SW_UpdateProduct(string ShipwireUsername, string ShipwirePassword, long ProductID, string JsonString)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        int success = sw.UpdateProduct(ProductID, JsonString);

        if (!String.IsNullOrEmpty(sw.ErrMsg))
            RaiseErr(sw.ErrMsg);

        return success;
    }
 private void UpdateProduct()
 {
     sw = new ShipwireClient(_uname, _pwd);
     int pid = sw.UpdateProduct(Convert.ToInt32(txtInput.Text), txtRawData.Text);
     txtRawData.Clear();
     txtRawData.Text = "ProductID: " + pid;
 }
 private void GetWarehouses()
 {
     sw = new ShipwireClient(_uname, _pwd);
     List<Warehouse> ws = sw.GetWarehouses();
     txtRawData.Clear();
     foreach (Warehouse w in ws)
     {
         txtRawData.Text += String.Format("Name: {0} |WarehouseID: {1}\n", w.name, w.id);
     }
 }
 private void GetVendors()
 {
     sw = new ShipwireClient(_uname, _pwd);
     List<SWVendor> vs = sw.GetVendors();
     txtRawData.Clear();
     foreach (SWVendor v in vs)
     {
         txtRawData.Text += String.Format("Name: {0} |VendorID: {1}\n", v.name, v.id);
     }
 }
 private void GetSW_OrderItems()
 {
     sw = new ShipwireClient(_uname, _pwd);
     List<OrderItem> orders = sw.GetOrderItems(Convert.ToInt64(txtInput.Text));
     txtRawData.Clear();
     foreach (OrderItem o in orders)
     {
         txtRawData.Text += string.Format("ProductID: {0}| Quantity: {1} |SKU: {2}\n", o.productId, o.quantity, o.sku);
     }
 }
 private void GetSWProducts()
 {
     sw = new ShipwireClient(_uname, _pwd);
     List<SWProduct> ps = sw.GetProducts("", eSWProductClassification.baseProduct, eSWProductStatus.outofstock);
     txtRawData.Clear();
     foreach( SWProduct p in ps)
     {
         txtRawData.Text += String.Format("productID: {0} |sku: {1} |class: {2}\n", p.id, p.sku, p.classification);
         if (p.dimensions != null)
             txtRawData.Text += String.Format("\tWidth: {0}\n", p.dimensions.resource.width);
         if (p.alternateNames.resource != null)
             txtRawData.Text += String.Format("\talternate names count: {0}\n", p.alternateNames.resource.total);
     }
 }
 private void GetSWProduct()
 {
     sw = new ShipwireClient(_uname, _pwd);
     SWProduct swp = sw.GetProduct(Convert.ToInt64(txtInput.Text));
     txtRawData.Clear();
     txtRawData.Text += String.Format("Dims: {0}x{1}x{2}| Weight: {3}\n", swp.dimensions.resource.width, swp.dimensions.resource.height, swp.dimensions.resource.length, swp.dimensions.resource.weight);
     if (swp.alternateNames.resource.total != 0)
         txtRawData.Text += String.Format("Alternate names: {0}\n", swp.alternateNames.resource.items[0].resource.name);
 }
 private void GetSWOrder()
 {
     sw = new ShipwireClient(_uname, _pwd);
     SWOrder o = sw.GetOrder(Convert.ToInt64(txtInput.Text));
     txtRawData.Clear();
     txtRawData.Text += String.Format("OrderNo: {0} |ExternalID: {1}\n", o.orderNo, o.externalId);
 }
Beispiel #16
0
    public static SqlInt32 SW_SetReceiving(string ShipwireUsername, string ShipwirePassword, long ReceivingID, string JsonString)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        int success = sw.SetReceiving(ReceivingID, JsonString);

        if (!String.IsNullOrEmpty(sw.ErrMsg))
            RaiseErr(sw.ErrMsg);

        return success;
    }
Beispiel #17
0
    public static SqlInt32 SW_StockAdjustments(string ShipwireUsername, string ShipwirePassword, string JsonString)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        int success = sw.StockAdjustments(JsonString);

        if (!String.IsNullOrEmpty(sw.ErrMsg))
            RaiseErr(sw.ErrMsg);

        return success;
    }
 private void AddSW_Receiving()
 {
     sw = new ShipwireClient(_uname, _pwd);
     long rid = sw.AddReceiving(txtRawData.Text);
     txtInput.Text = rid.ToString();
 }
Beispiel #19
0
    public static IEnumerable SW_GetOrder(string ShipwireUsername, string ShipwirePassword, long OrderID)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        List<SWOrder> o = new List<SWOrder>();
        o.Add(sw.GetOrder(OrderID));

        return o;
    }
 private void AddVendor()
 {
     sw = new ShipwireClient(_uname, _pwd);
     long id = sw.AddVendor(txtRawData.Text);
     txtRawData.Clear();
     txtRawData.Text = "Vendor ID: " + id;
 }
Beispiel #21
0
    public static IEnumerable SW_GetOrderTrackings(string ShipwireUsername, string ShipwirePassword, long OrderID)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        List<Tracking> t = new List<Tracking>();

        t = sw.GetTrackings(OrderID);

        return t;
    }
 private void AddWarehouse()
 {
     sw = new ShipwireClient(_uname, _pwd);
     long id = sw.AddWarehouse(txtRawData.Text);
     txtRawData.Clear();
     txtRawData.Text = "Warehouse ID: " + id;
 }
Beispiel #23
0
    public static IEnumerable SW_GetProducts(string ShipwireUsername, string ShipwirePassword, string SKU = "", string Classification = null, string Status = null)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        eSWProductClassification _cl = eSWProductClassification.all;
        eSWProductStatus _st = eSWProductStatus.all;

        if (Classification != null)
        {
            if (Enum.TryParse(Classification, out _cl))
                _cl = (eSWProductClassification)Enum.Parse(typeof(eSWProductClassification), Classification);
        }

        if (Status != null)
        {
            if (Enum.TryParse(Status, out _st))
                _st = (eSWProductStatus)Enum.Parse(typeof(eSWProductStatus), Status);
        }

        return sw.GetProducts(SKU, _cl, _st);
    }
Beispiel #24
0
    public static void SW_AddReceiving(string ShipwireUsername, string ShipwirePassword, string JsonString, out SqlInt64 ReceivingID)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        ReceivingID = sw.AddReceiving(JsonString);

        if (!String.IsNullOrEmpty(sw.ErrMsg))
            RaiseErr(sw.ErrMsg);
    }
Beispiel #25
0
    public static IEnumerable SW_GetReceivingOrderItems(string ShipwireUsername, string ShipwirePassword, long OrderID)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);

        return sw.GetReceivingOrderItems(OrderID);
    }
Beispiel #26
0
    public static SqlInt32 SW_CancelOrder(string ShipwireUsername, string ShipwirePassword, long OrderID)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        int success = sw.CancelOrder(OrderID);

        if (!String.IsNullOrEmpty(sw.ErrMsg))
            RaiseErr(sw.ErrMsg);

        return success;
    }
Beispiel #27
0
    public static IEnumerable SW_GetStocks(string ShipwireUsername, string ShipwirePassword, SqlInt32 WarehouseID, SqlString SKU)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        int wid = -1;
        string sku = "";

        if (!WarehouseID.IsNull)
            wid = (int)WarehouseID;

        if (!SKU.IsNull)
            sku = (string)SKU;

        return sw.GetStocks(wid, sku);
    }
Beispiel #28
0
    public static void SW_CreateOrder(string ShipwireUsername, string ShipwirePassword, string JsonString, out SqlInt64 OrderID)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        OrderID = sw.CreateOrder(JsonString);

        if (!String.IsNullOrEmpty(sw.ErrMsg))
            RaiseErr(sw.ErrMsg);
    }
Beispiel #29
0
    public static IEnumerable SW_GetWarehouses(string ShipwireUsername, string ShipwirePassword)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        List<Warehouse> whs = sw.GetWarehouses();

        return whs;
    }
 private void GetROI()
 {
     sw = new ShipwireClient(_uname, _pwd);
     List<ROItem> r = sw.GetReceivingOrderItems(Convert.ToInt64(txtInput.Text));     //109594672  108237412
     txtRawData.Clear();
     foreach (ROItem item in r)
     {
         txtRawData.Text += String.Format("Product ID: {0} | Expected Qty: {1} | Quantity: {2}\n", item.productId, item.expected, item.quantity);
     }
 }