Suggestion for implementing controls based on rules

  • Thread starter Thread starter ajit goel
  • Start date Start date
A

ajit goel

Hi everyone;

We have a problem in our compact framework client-server application
for which we would require your valuable suggestions.

Problem:
There are controls in the application user interface that has to be
loaded based on rules / transaction codes else they are not displayed
at all, hence the controls won't be there at design time but they
would have to be created and placed at run time.Hence a elegant and
simple solution has to be designed to meet out the requirements.

Solution:
We are leaning towards getting all valid transaction codes from the
database and loading into memory at the start of the application. When
a form is created for the first time,the form and all the form
controls are created based on the transaction codes.The form is then
saved into a form factory. If that form is required again then it is
loaded from the form factory.

I would appreciate some comments or suggestions to this approach.

Thanks and Kind Regards;

Ajit Goel
 
This Concept looks good to me.
// The form is then saved into a form factory
How you do this I don't know

if you look at the project (with source) on :
http://www.codeproject.com/useritems/NetDbExplorer.asp

The Demo (NetDbExplorer) has a "Look and Feel" Mode on the PC Version.
Look and feel being PC Version or WinCe where the Controls are place
differntly do to Screen size.
Use Menu to switch from one to the other.

All the Controls are created (when needed) accourding to certin conditions
and place accourding Platform logic
in Methods inside DataBaseExplorer.cs (here TabControl, TabPages,
TreeView/ListView, Panel, Labels, Splitter in PC-Modus, ProgressBar and
Inputpanel when running on Compact) all without Designer support.

When building complicated Dialogs you use the Designer to develop it and the
copy the code created in InitializeComponent(); to your Method.
A bit more work of course, but seems to be the best way to do it.
You can allways check if (control != null) before using it and therfore skip
over it if the transaction condition is not met.

Hope this helps

Mark Johnson, Berlin Germany
(e-mail address removed)
 
Back
Top