public override void PrintEvent(WarehouseAction action) { if (action == WarehouseAction.Purchased) { Console.WriteLine($"{Amount} x \"{Title}\" was purchased."); } else { Console.WriteLine($"Unknown action."); } }
// For Increase and Decrease Commands public WarehouseCommand(IWarehouse warehouse, WarehouseAction warehouseAction, StoredProduct storedProduct, int amount) : this(warehouse, warehouseAction) { this.storedProduct = storedProduct; this.amount = amount; }
// For Edit Command public WarehouseCommand(IWarehouse warehouse, WarehouseAction warehouseAction, StoredProduct oldStoredProduct, StoredProduct newStoredProduct) : this(warehouse, warehouseAction) { this.oldStoredProduct = oldStoredProduct; this.newStoredProduct = newStoredProduct; }
// For Add and Remove commands public WarehouseCommand(IWarehouse warehouse, WarehouseAction warehouseAction, StoredProduct storedProduct) : this(warehouse, warehouseAction) { this.storedProduct = storedProduct; }
// Constructor overloading // For Print command public WarehouseCommand(IWarehouse warehouse, WarehouseAction warehouseAction) { this.warehouse = warehouse; this.warehouseAction = warehouseAction; }
public abstract void PrintEvent(WarehouseAction action);