In a C#, Windows forms app, we have a series of user controls that are associated with menu entry records in a database...
ID Menu Title
1 User Management
4 Group Management
6 System Utilities
12 Configuration Management
A few user controls...
- UserManagement.cs
- GroupManager.cs
- SysUtil.cs
- ConfigurationMan.cs
We're currently just switching on the ID, but that seems like a very primitive way to accomplish this and has a lot of hard-coded IDs, which I don't like.
What would be the most appropriate way to read the database entries and load the appropriate user control?
Thanks!