Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have below table structure:
User(UserID, Name, Address, Phone, CustomFieldValue)
Group(GroupID, GroupName, ApplyGroupRuleString)
UserGroup(UserID, GroupID)

Example of data:

User(210111, 'Mohit', 'Delhi', '99999999', '(Email=mohit@gmail.com)(Designation:Software Engineer)(CurrentLocation=Delhi)')
- Here CustomFieldValue field contains the list of key/value pairs.

Group(10001, 'Delhi User', '//User[(Address=Delhi) and (CurrentLocation=Delhi)]')
- Here ApplyGroupRuleString means that this group should be assigned to those users whose Address is 'Delhi' and also whose CurrentLocation is 'Delhi'. However important thing here is that CurrentLocation key is part of field CustomFieldValue. We have requirement that the Key/Value pair will be decided at run time.

Expected Result from above data : UserGroup(210111,10001)

So can someone please help me to find out a solution so that I can match the Users against Group's ApplyGroupRuleString and assign the group to user accordingly.

Thanks for help in advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900