static void AXcopyUserGroupUserlist(Args _args)
{
usergrouplist usergrouplist,ins,exitslist;
userGroupid src,dest;
dialogfield srcdf,destdf;
dialog dialog;
;
dialog = new dialog("copying user group's user lists ");
srcdf = dialog.addField(typeid(userGroupid),"Source");
destdf = dialog.addField(typeid(userGroupid),"Destination");
if(dialog.run())
{
src = srcdf.value();
dest = destdf.value();
if(src!="" && dest !="")
{
ttsbegin;
info("Copying user groups USER ID to destination user GROUP ");
while select * from usergrouplist
where usergrouplist.groupId == src
{
select exitslist where exitslist.UserId == usergrouplist.userId
&& exitslist.groupId == dest;
if(exitslist.RecId == 0)
{
ins.clear();
ins.userId = usergrouplist.userId;
ins.groupId = dest;
ins.insert();
}
}
ttscommit;
info("User groups has been copied!");
}
}
else
{
info("Canceled by user");
}
}
{
usergrouplist usergrouplist,ins,exitslist;
userGroupid src,dest;
dialogfield srcdf,destdf;
dialog dialog;
;
dialog = new dialog("copying user group's user lists ");
srcdf = dialog.addField(typeid(userGroupid),"Source");
destdf = dialog.addField(typeid(userGroupid),"Destination");
if(dialog.run())
{
src = srcdf.value();
dest = destdf.value();
if(src!="" && dest !="")
{
ttsbegin;
info("Copying user groups USER ID to destination user GROUP ");
while select * from usergrouplist
where usergrouplist.groupId == src
{
select exitslist where exitslist.UserId == usergrouplist.userId
&& exitslist.groupId == dest;
if(exitslist.RecId == 0)
{
ins.clear();
ins.userId = usergrouplist.userId;
ins.groupId = dest;
ins.insert();
}
}
ttscommit;
info("User groups has been copied!");
}
}
else
{
info("Canceled by user");
}
}
No comments:
Post a Comment