Exemplo n.º 1
0
        public WarehouseForm(Form parent, ShippingSystem sm)
        {
            InitializeComponent();
            parentForm = parent;
            shippingSystem = sm;
            em = shippingSystem.LoggedInEmployee as WarehouseEmployee;
            currentWarehouse = em.CurrentLocation as Warehouse;
            currentStoreFront = em.CurrentLocation as StoreFront;

            updateReceivingListBox();
            updateVehiclesListBox();

            if (currentStoreFront != null)
                Text = currentStoreFront.Id;
            else
                Text = currentWarehouse.Id;
        }
        public bool movePackageToWarehouse(Moveable moveable, Warehouse warehouse, Package package)
        {
            if (!warehouse.addPackage(package))
                return false;

            package.takeSnapshot("Arrived at", warehouse);
            moveable.removePackage(package);
            package.CurrentLocation = warehouse;
            return true;
        }
 public bool addWarehouse(string id, string streetAddress, string zipcode, int volumeCapacity)
 {
     Address a = new Address(id, streetAddress, zipcode);
     Warehouse sf = new Warehouse(a, volumeCapacity);
     if (locations.Contains(sf))
         return false;
     locations.Add(sf);
     return true;
 }