コード例 #1
0
        /// <summary>
        /// 添加关注
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="attentionUserId">被关注者</param>
        public void AddAttention(int userId, int attentionUserId)
        {
            var sql = string.Format(@"INSERT INTO Int_Relationship (UserId ,UserId2)
VALUES({0} ,{1}) ", userId, attentionUserId);

            _dataAccess.ExecuteSql(sql);
        }
コード例 #2
0
        /// <summary>
        ///     批量删除用户
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public bool BatchDeleteUser(int[] userIds)
        {
            var    ids = userIds.GetString();
            string sql = string.Format("Update Sys_Users set Status = 1 where UserId in ({0})", ids);

            _dataAccess.DeleteEntities <SysRoleUser>(" Sys_RoleUser.UserId IN (" + ids + ")");
            return(_dataAccess.ExecuteSql(sql) > 0);
        }
コード例 #3
0
        public void DeletePost(int[] postIds)
        {
            string sql = string.Format(@"update Sys_Posts set status = 1 where PostId in ({0})
            update Sys_Users set postId = 0 where PostId in ({0})
            ", postIds.GetString());

            _dataAccess.ExecuteSql(sql);
        }
コード例 #4
0
ファイル: RoleManager.cs プロジェクト: dovanduy/CountryTrain
        /// <summary>
        ///     批量删除角色
        /// </summary>
        /// <param name="roleIds"></param>
        /// <returns></returns>
        public bool BatchDeleteRole(int[] roleIds)
        {
            string sql = string.Format("Update Sys_Roles set Status = 1 where RoleId in ({0})", roleIds.GetString());

            return(_dataAccess.ExecuteSql(sql) > 0);
        }