Ejemplo n.º 1
0
        internal static void FillItems(MagentoSoapAPI.salesOrderEntity orderData, C1FlexGrid grid, Dictionary <int, int> _preparationWarehouse)
        {
            int i       = 0;
            int snus    = 0;
            int snuff   = 0;
            int tobfree = 0;

            if (orderData != null)
            {
                foreach (MagentoSoapAPI.salesOrderItemEntity item in orderData.items)
                {
                    int x, y, z = 0;
                    x = Convert.ToInt32(item.qty_ordered.Remove(item.qty_ordered.IndexOf('.')));
                    y = Convert.ToInt32(item.qty_refunded.Remove(item.qty_refunded.IndexOf('.')));
                    z = Convert.ToInt32(item.qty_shipped.Remove(item.qty_shipped.IndexOf('.')));
                    int qty = x - y - z;
                    if (i < orderData.items.Length)
                    {
                        if (Convert.ToInt32(item.preparation_warehouse) == _preparationWarehouse[Properties.Settings.Default.WAREHOUSE])
                        {
                            if (qty > 0)
                            {
                                grid.Rows.Count = i + 2;
                                grid[i + 1, 0]  = (i + 1).ToString();
                                grid[i + 1, 1]  = item.name;
                                grid[i + 1, 2]  = item.sku;
                                grid[i + 1, 3]  = qty;
                                if (grid.Cols[4].Caption == "Qty packed")
                                {
                                    grid[i + 1, 4] = 0;
                                }
                                grid[i + 1, 5] = false;

                                if (item.name.ToString().Contains("Snus") || item.name.Contains("Dry"))
                                {
                                    snus++;
                                }
                                if (item.name.ToString().Contains("Snuff"))
                                {
                                    snuff++;
                                }
                                if (item.name.ToString().Contains("Tobacco Free"))
                                {
                                    tobfree++;
                                }

                                i++;
                            }
                        }
                    }
                }
            }

/*            if (snus > 0) _upsDescription = "Snus";
 *          else if (snuff > 0) _upsDescription = "Snuff";
 *          else if (tobfree > 0) _upsDescription = "Tobacco Free";*/
        }
Ejemplo n.º 2
0
 public PickPackWizardForm(Row order, Dictionary <string, string> countries, Dictionary <string, MagentoSoapAPI.salesOrderEntity> items, Dictionary <int, int> warehouse, C1FlexGrid orderGrid, bool UPSDK, bool sign)
 {
     InitializeComponent();
     _order      = order;
     _countries  = countries;
     _orderItems = items[order["increment_id"].ToString()];
     _warehouse  = warehouse;
     _orderGrid  = orderGrid;
     _upsDK      = UPSDK;
     _sign       = sign;
 }
Ejemplo n.º 3
0
        private void FillOrderDetails(C1FlexGrid grid)
        {
            Helper.FillAddress(label_orderNumberDetail, label_orderAddressDetail, c1FlexGrid_ListOfOrders.Rows[c1FlexGrid_ListOfOrders.RowSel], _countries);

            _orderID = grid.GetData(c1FlexGrid_ListOfOrders.RowSel, "increment_id").ToString();

            CellRange rng = c1FlexGrid_Items.GetCellRange(1, 0, c1FlexGrid_Items.Rows.Count - 1, c1FlexGrid_Items.Cols.Count - 1);

            rng.Clear(ClearFlags.Content);

            MagentoSoapAPI.salesOrderEntity orderData = _orderItemArray[_orderID.ToString()];

            Helper.FillItems(orderData, c1FlexGrid_Items, _preparationWarehouse);
        }