Exemplo n.º 1
0
 private void AddSWProduct()
 {
     sw = new ShipwireClient(_uname, _pwd);
     long pid = sw.AddProduct(txtRawData.Text);
     txtRawData.Clear();
     txtRawData.Text = "ProductID: " + pid;
 }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
    public static IEnumerable SW_GetVendors(string ShipwireUsername, string ShipwirePassword)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        List<SWVendor> vs = sw.GetVendors();

        return vs;
    }
Exemplo n.º 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);
    }
Exemplo n.º 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;
    }
Exemplo n.º 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;
    }
Exemplo n.º 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);
    }
Exemplo n.º 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;
    }
Exemplo n.º 9
0
 private void UpdateProduct()
 {
     sw = new ShipwireClient(_uname, _pwd);
     int pid = sw.UpdateProduct(Convert.ToInt32(txtInput.Text), txtRawData.Text);
     txtRawData.Clear();
     txtRawData.Text = "ProductID: " + pid;
 }
Exemplo n.º 10
0
 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);
     }
 }
Exemplo n.º 11
0
 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);
     }
 }
Exemplo n.º 12
0
 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);
     }
 }
Exemplo n.º 13
0
 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);
     }
 }
Exemplo n.º 14
0
 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);
 }
Exemplo n.º 15
0
 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);
 }
Exemplo n.º 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;
    }
Exemplo n.º 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;
    }
Exemplo n.º 18
0
 private void AddSW_Receiving()
 {
     sw = new ShipwireClient(_uname, _pwd);
     long rid = sw.AddReceiving(txtRawData.Text);
     txtInput.Text = rid.ToString();
 }
Exemplo n.º 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;
    }
Exemplo n.º 20
0
 private void AddVendor()
 {
     sw = new ShipwireClient(_uname, _pwd);
     long id = sw.AddVendor(txtRawData.Text);
     txtRawData.Clear();
     txtRawData.Text = "Vendor ID: " + id;
 }
Exemplo n.º 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;
    }
Exemplo n.º 22
0
 private void AddWarehouse()
 {
     sw = new ShipwireClient(_uname, _pwd);
     long id = sw.AddWarehouse(txtRawData.Text);
     txtRawData.Clear();
     txtRawData.Text = "Warehouse ID: " + id;
 }
Exemplo n.º 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);
    }
Exemplo n.º 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);
    }
Exemplo n.º 25
0
    public static IEnumerable SW_GetReceivingOrderItems(string ShipwireUsername, string ShipwirePassword, long OrderID)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);

        return sw.GetReceivingOrderItems(OrderID);
    }
Exemplo n.º 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;
    }
Exemplo n.º 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);
    }
Exemplo n.º 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);
    }
Exemplo n.º 29
0
    public static IEnumerable SW_GetWarehouses(string ShipwireUsername, string ShipwirePassword)
    {
        ShipwireClient sw = new ShipwireClient(ShipwireUsername, ShipwirePassword);
        List<Warehouse> whs = sw.GetWarehouses();

        return whs;
    }
Exemplo n.º 30
0
 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);
     }
 }