Ejemplo n.º 1
0
 public Table(string description, Area area)
 {
     Description = description;
     _state      = new TableClosed(this);
     _state.OpenTable();
     stateColor = Color.Green;
     Area       = area;
 }
Ejemplo n.º 2
0
        partial void OnTableStateIdChanged()
        {
            switch (this.TableStateId)
            {
            case 1:
                _state     = new TableOpened(this);
                stateColor = Color.Green;
                break;

            case 2:
                _state     = new TableClosed(this);
                stateColor = Color.Gray;
                break;

            case 3:
                _state     = new TableInUse(this);
                stateColor = Color.Orange;
                break;

            default:
                throw new Exception("Invalid state");
            }
        }