示例#1
0
        private static List <IeUserGroup> FromXmlModel(List <XmlUserGroup> xmlUserGroups,
                                                       ISet <int> userIdsToCollect, ISet <int> groupIdsToCollect)
        {
            if (xmlUserGroups.IsEmpty())
            {
                return(null);
            }

            var userGroups = new List <IeUserGroup>();

            foreach (var g in xmlUserGroups)
            {
                if (!g.IsGroup.HasValue)
                {
                    continue;
                }

                if (g.IsGroup.GetValueOrDefault())
                {
                    // Name and GroupProjectId properties will be assigned later after converting the entire workflow
                    // since we need to know all group Ids to retrieve group information form the database.
                    var group = new IeUserGroup
                    {
                        Id      = g.Id,
                        IsGroup = g.IsGroup
                    };
                    userGroups.Add(group);
                    groupIdsToCollect.Add(g.Id);
                }
                else
                {
                    // Name and property will be assigned later after converting the entire workflow
                    // since we need to know all user Ids to retrieve user information form the database.
                    var user = new IeUserGroup
                    {
                        Id      = g.Id,
                        IsGroup = false
                    };
                    userGroups.Add(user);
                    userIdsToCollect.Add(g.Id);
                }
            }

            return(userGroups);
        }
 private static bool IsGroupProjectIdUnassigned(IeUserGroup userGroup)
 {
     return(userGroup != null && userGroup.IsGroup.GetValueOrDefault() &&
            !string.IsNullOrEmpty(userGroup.GroupProjectPath) &&
            !userGroup.GroupProjectId.HasValue);
 }
示例#3
0
 private static void NormalizeUserGroup(IeUserGroup userGroup)
 {
     userGroup.IsGroup = NormalizeNullableBool(userGroup.IsGroup);
 }