private static void clearRootTargetRepliesByData(int dataId, string dataType) { OpenCommentCount objCount = OpenCommentCount.find("DataType=:dtype and DataId=" + dataId) .set("dtype", dataType) .first(); if (objCount == null) { return; } objCount.Replies = 0; objCount.update(); }
private static void clearRootTargetRepliesByUrl(String url) { OpenCommentCount objCount = OpenCommentCount.find("TargetUrl=:url") .set("url", url) .first(); if (objCount == null) { return; } objCount.Replies = 0; objCount.update(); }
private static void updateCommentCount(OpenCommentCount objCount, int replies) { objCount.Replies = replies; objCount.update(); }