# AspNet Forums 中当访问private message页面后,所有阅读记录全部消失 #
经查为forums_Forum_MarkRead存储过程中存在逻辑错
IF @ForumGroupID = 0 AND @ForumID = 0
BEGIN
-- 1. Delete any entries for this user
DELETE forums_ForumsRead WHERE UserID = @UserID
-- DELETE forums_ThreadsRead WHERE UserID = @UserID -- by chaozi
-- 2. INSERT into forums_ForumsRead
INSERT INTO forums_ForumsRead
SELECT ForumGroupID, ForumID, @UserID, 0, 0, GetDate() FROM forums_Forums F
RETURN
END
BEGIN
-- 1. Delete any entries for this user
DELETE forums_ForumsRead WHERE UserID = @UserID
-- DELETE forums_ThreadsRead WHERE UserID = @UserID -- by chaozi
-- 2. INSERT into forums_ForumsRead
INSERT INTO forums_ForumsRead
SELECT ForumGroupID, ForumID, @UserID, 0, 0, GetDate() FROM forums_Forums F
RETURN
END
注销掉清除forums_ThreadRead纪录的操作。这样private Message的数量也可以统计了。