Exemplo n.º 1
0
        /// <summary>
        /// 从当前Group中删除User
        /// </summary>
        /// <param name="users"></param>
        /// <returns></returns>
        public bool RemoveUserFromGroup(IList <UserBase> users, ISession session)
        {
            bool flag = false;

            foreach (UserBase user in users)
            {
                flag = UserToGroup.Delete(session, this.GroupId, user.UserId) == 1;
                if (!flag)
                {
                    throw new ApplicationException(string.Format("删除用户{0}失败", user.UserName));
                }
            }

            return(flag);
        }
 private bool RemoveUserFromGroup(ISession session, int groupId, int userId)
 {
     return(UserToGroup.Delete(session, groupId, userId) > 0);
 }