public void ChangeGroupInfo(string operationUserId, GroupChangeInfo changeInfo) { User opUser = this.OrganizationManager.UserManager.GetUserById(operationUserId); Group group = this.OrganizationManager.GroupManager.GetGroupById(changeInfo.ID); group.Change(opUser, changeInfo); }
public virtual void Change(User operationUser, GroupChangeInfo changeInfo) { if (operationUser == null) { throw new ArgumentNullException("operationUser"); } if (changeInfo == null) { throw new ArgumentNullException("groupInfo"); } if (this.IsSystem) { throw new SystemGroupCannotModifyException(); } if (string.IsNullOrWhiteSpace(changeInfo.Name)) { throw new ArgumentNullException("groupInfo.Name"); } if (changeInfo.Name != this.Name) { if (this._orgMnger.GroupManager.Groups.Any(x => x.GroupType != GroupType.Personal && x.Name == changeInfo.Name)) { throw new GroupNameReapeatException(); } } if (this.Changing != null) { this.Changing(this, changeInfo); } this.Name = changeInfo.Name; this.Remark = changeInfo.Remark; if (this.Changed != null) { this.Changed(this, changeInfo); } }