songohan
Posts: 89
|
| Posted: 06/30/2007, 6:24 AM |
|
In database I have two connected tables, one has user_group_id and user_group_name fields and other has other user details fields.
Now, one grid is used to build menu based on user_group table and other to show all users from certain user_group. "select form USERS where user_group_id=xxx"
When someone comes to that page he will see all records from USER table as there is no user_group_id parameter until you click one user group from menu.
What I'd like is to show users only from first user group (eg. lowest user_group_id number). I could hardcode user_group_id to link to that page but as user group records can be edited and deleted dynimically that would only work until that user group record gets deleted.
What is most elegant way to do such a thing?
Thnx,
Andrej
|
 |
 |
mamboBROWN
Posts: 1713
|
| Posted: 07/01/2007, 2:48 PM |
|
songohan
Have you thought about creating a query that groups the users by order of user_group_id. Therefore your list would look like below:
USER GROUP
mambobrown Admin
songohan Admin
peterr Manager
wkempes Manager
feha Guest
klwillis Guest
Your query would include both tables and order them by user_group_id and username.
|
 |
 |
wkempees
|
| Posted: 07/02/2007, 3:38 AM |
|
The most elegant soulution, huh, does not exist.
The way I would do it, not telling you to join tables and the likes.
The grid on the USER table has a Where on user_group_id, but that is not set
yet.
In the VisualQueryBuilder set the default value for the Where parameter to
your equal your lowest user_group_id.
That way if it is not set (by selection from the menu as you describe) it
will default to for instance 1, showing only the users in group 1.
Walter
"songohan" <songohan@forum.codecharge> schreef in bericht
news:5468659a36c94c@news.codecharge.com...
> In database I have two connected tables, one has user_group_id and
> user_group_name fields and other has other user details fields.
>
> Now, one grid is used to build menu based on user_group table and other to
> show
> all users from certain user_group. "select form USERS where
> user_group_id=xxx"
>
> When someone comes to that page he will see all records from USER table as
> there is no user_group_id parameter until you click one user group from
> menu.
>
> What I'd like is to show users only from first user group (eg. lowest
> user_group_id number). I could hardcode user_group_id to link to that page
> but
> as user group records can be edited and deleted dynimically that would
> only work
> until that user group record gets deleted.
>
> What is most elegant way to do such a thing?
>
> Thnx,
>
> Andrej
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
 |
songohan
Posts: 89
|
| Posted: 07/12/2007, 3:08 AM |
|
Thnx,
Well I went through: http://forums.yessoftware.com/posts.php?post_id=88238
and think this might solve my problem... very interesting topic...
Regards,
Andrej
|
 |
 |
Wkempees
|
| Posted: 07/12/2007, 7:23 AM |
|
Your welcome
Walter
|
|
|
 |
|