// private Methods

        private void RegisterMethods(RequestBroker requestBroker)
        {
            var systemAuth = new SystemAuth();

            requestBroker.Add("system.login", systemAuth.Login);

            var orderPicking = new OrderPicking();

            requestBroker.Add("orderPicking.getPickList", orderPicking.GetPickList);
        }
        public void DispatchOrders(string id)
        {
            WarehouseBusinessLayer wbl = new WarehouseBusinessLayer();
            int warehouseId            = wbl.getWarehouseId(Convert.ToInt32(Session["UserID"]));
            int oid = Convert.ToInt32(id);
            WarehouseDBEntities wde    = new WarehouseDBEntities();
            List <Order>        orders = wde.Orders.Where(a => a.warehouseId == warehouseId && a.orderId == oid && (a.orderStatus == "Unseen" || a.orderStatus == "Seen")).OrderBy(a => a.totalOrderQuanitity).ToList();
            int i = 0;

            //Sorting items according to quantity
            foreach (var order in orders)
            {
                var neworder = order.item_Order;
                neworder = neworder.OrderBy(a => a.quantity).ToList();
                orders.ElementAt(i).item_Order = neworder;
                i++;
            }
            Slotting slotting = new Slotting();
            List <Item_Warehouse> itemWarehouse = wde.Item_Warehouse.Where(a => a.warehouseId == warehouseId).ToList();

            List <Shelf> shelfs = wde.Shelves.Where(a => a.warehouse_id == warehouseId).ToList();
            Dictionary <int, List <ShelfItems> > shelfItems = new Dictionary <int, List <ShelfItems> >();

            foreach (Shelf shelf in shelfs)
            {
                List <ShelfItems> shelves = slotting.covert_to_object(shelf.shelfItems);
                shelfItems.Add(shelf.id, shelves);
            }

            List <Item> items = new List <Item>();

            foreach (Item_Warehouse item_Warehouse in itemWarehouse)
            {
                items.Add(item_Warehouse.Item);
            }

            OrderPicking orderPick = new OrderPicking();

            orderPick.getFirstOrder(orders, shelfItems);
        }
Example #3
0
 public async Task <Order> PickOrderRows(OrderPicking orderPicking) =>
 await _client.PostAsync <Order>("api/orderpicking", orderPicking);