예제 #1
0
        /// <summary>
        /// 删除角色下的用户
        /// </summary>
        /// <param name="entity"></param>
        public void DeleteRoleUser(RoleUserEntity entity)
        {
            var param = new DynamicParameters();
            param.Add("@userID", entity.UserID);
            param.Add("@roleID", entity.RoleID);

            using (var conn = SessionFactory.CreateConnection())
            {
                QuickRepository.ExecuteProc(conn, "pr_sys_RoleUserDelete", param);
            }
        }
예제 #2
0
        public ResponseResult DeleteRoleUser(RoleUserEntity entity)
        {
            var result = ResponseResult.Default();
            try
            {
                var roleService = new RoleDataService();
                roleService.DeleteRoleUser(entity);

                result = ResponseResult.Success();
            }
            catch (System.Exception ex)
            {
                result = ResponseResult.Error(string.Format("删除角色下用户失败!{0}", ex.Message));
            }
            return result;
        }
예제 #3
0
 /// <summary>
 /// 添加用户到角色
 /// </summary>
 /// <param name="entity"></param>
 public void AddRoleUser(RoleUserEntity entity)
 {
     QuickRepository.Insert<RoleUserEntity>(entity);
 }