private void FillObjectToUsers(OguDataCollection <IUser> users, IOguObject obj) { OguBase wrappedObj = (OguBase)OguBase.CreateWrapperObject(obj); wrappedObj.FullPath = obj.FullPath; switch (obj.ObjectType) { case SchemaType.Users: if (users.Exists(u => string.Compare(u.ID, obj.ID, true) == 0) == false) { users.Add((IUser)wrappedObj); } break; case SchemaType.Groups: IGroup group = (IGroup)wrappedObj; group.Members.ForEach(u => { if (users.Exists(ul => string.Compare(ul.ID, u.ID, true) == 0) == false) { users.Add(u); } }); break; case SchemaType.Organizations: case SchemaType.OrganizationsInRole: IOrganization dept = (IOrganization)obj; dept.Children.ForEach(o => FillObjectToUsers(users, o)); break; } }
private void FillObjectToUsers(OguDataCollection<IUser> users, IOguObject obj) { OguBase wrappedObj = (OguBase)OguBase.CreateWrapperObject(obj); wrappedObj.FullPath = obj.FullPath; switch (obj.ObjectType) { case SchemaType.Users: if (users.Exists(u => string.Compare(u.ID, obj.ID, true) == 0) == false) users.Add((IUser)wrappedObj); break; case SchemaType.Groups: IGroup group = (IGroup)wrappedObj; group.Members.ForEach(u => { if (users.Exists(ul => string.Compare(ul.ID, u.ID, true) == 0) == false) users.Add(u); }); break; case SchemaType.Organizations: case SchemaType.OrganizationsInRole: IOrganization dept = (IOrganization)obj; dept.Children.ForEach(o => FillObjectToUsers(users, o)); break; } }
private static void FillAndDistinctUsers(IEnumerable <IUser> source, OguDataCollection <IUser> target) { foreach (IUser user in source) { if (target.Exists(u => string.Compare(u.ID, user.ID, true) == 0) == false) { target.Add(user); } } }
/// <summary> /// 某个用户是否是某个节点的传阅人 /// </summary> /// <param name="activity"></param> /// <param name="user"></param> /// <returns></returns> public static bool IsCirculatorInActivity(IWfActivity activity, IUser user) { OguDataCollection <IUser> users = GetActivityCirculators(activity); return(users.Exists(u => string.Compare(u.ID, user.ID, true) == 0)); }
private static void FillAndDistinctUsers(IEnumerable<IUser> source, OguDataCollection<IUser> target) { foreach (IUser user in source) { if (target.Exists(u => string.Compare(u.ID, user.ID, true) == 0) == false) target.Add(user); } }