Hello all --
I have what I hope is an interesting question that I further hope someone here has conquered in the past.
A little bit of background:
We are attempting to architect a reusable menu system for web applications. We have tackled all obstacles but one: special business rules.
Our goal is to set up a system whereby anyone could setup a web application. To this end, we have devised a standard database setup that covers everything but the inevitable whacko client business rule. i.e. when this strange condition exists, then do this.
We have always handled this situation by deriving a class from the base class and manually coding up the rule. That's what I'm trying to avoid, which would create less work for me (the true goal ;-)).
Specific case:
The app: Statistical reporting site that delivers results based on some number of user selected filters.
The problem: When a user has selected filterA, then I don't want them to be able to select filterB.
FilterA & filterB have no other logical connection, other than this rule that's been thrust upon us by the client. The only way to tell if filterA has been selected is to evaluate Session["filterA"].ToString()
The Question
If there was some way that I could put a 'Condition' field in the database for this filter (I have a table containing all filters), then I might make that field say:
if(Session["filterA"].ToString() != -1)
and in this case, no values would be pulled for filterB, since -1 is the value that equates to "All".
So, in code, I could simply code up that statement, and the world is rosy. But, what I'm looking for is a way to read in that condition from some source (preferably a database, but I'm not completely opposed to XML) and then apply it to the logic that creates the menu.
In this way, when a new application is launched, I simply write in the business rules to the database, and the standard menu creator takes those rules into account when it renders the menu.
So... has anyone any words of wisdom for me? I'm basically looking for some Eval() statement or something. Eval() is from javascript, and it performs things like this. I know that there's no specific Eval() statement in C#, so I'm looking for alternatives here.
I'm not even locked into the specific method I've posted, it was basically just a brain dump of what I'm looking for. If anyone has any ideas for me, that would be grand.
Thanks alot, folks!
paul
The answer to getting answered -- faq855-2992
I have what I hope is an interesting question that I further hope someone here has conquered in the past.
A little bit of background:
We are attempting to architect a reusable menu system for web applications. We have tackled all obstacles but one: special business rules.
Our goal is to set up a system whereby anyone could setup a web application. To this end, we have devised a standard database setup that covers everything but the inevitable whacko client business rule. i.e. when this strange condition exists, then do this.
We have always handled this situation by deriving a class from the base class and manually coding up the rule. That's what I'm trying to avoid, which would create less work for me (the true goal ;-)).
Specific case:
The app: Statistical reporting site that delivers results based on some number of user selected filters.
The problem: When a user has selected filterA, then I don't want them to be able to select filterB.
FilterA & filterB have no other logical connection, other than this rule that's been thrust upon us by the client. The only way to tell if filterA has been selected is to evaluate Session["filterA"].ToString()
The Question
If there was some way that I could put a 'Condition' field in the database for this filter (I have a table containing all filters), then I might make that field say:
if(Session["filterA"].ToString() != -1)
and in this case, no values would be pulled for filterB, since -1 is the value that equates to "All".
So, in code, I could simply code up that statement, and the world is rosy. But, what I'm looking for is a way to read in that condition from some source (preferably a database, but I'm not completely opposed to XML) and then apply it to the logic that creates the menu.
In this way, when a new application is launched, I simply write in the business rules to the database, and the standard menu creator takes those rules into account when it renders the menu.
So... has anyone any words of wisdom for me? I'm basically looking for some Eval() statement or something. Eval() is from javascript, and it performs things like this. I know that there's no specific Eval() statement in C#, so I'm looking for alternatives here.
I'm not even locked into the specific method I've posted, it was basically just a brain dump of what I'm looking for. If anyone has any ideas for me, that would be grand.
Thanks alot, folks!
paul
The answer to getting answered -- faq855-2992