private void addNotificationToParent(MicroblogComment c, String microblogLink, int sentId) { if (c.ParentId == 0) { return; } MicroblogComment parent = MicroblogComment.findById(c.ParentId); int receiverId = parent.User.Id; if (c.User.Id == receiverId) { return; } if (receiverId == sentId) { return; } String commentTitle = strUtil.ParseHtml(parent.Content, 30); //String msg = c.User.Name + " 回复了你的微博评论 <a href=\"" + microblogLink + "\">" + commentTitle + "</a>"; String clink = "<a href=\"" + microblogLink + "\">" + commentTitle + "</a>"; String msg = string.Format(lang.get("replyMicroblog"), c.User.Name, clink); nfService.send(receiverId, typeof(User).FullName, msg, NotificationType.Comment); }
public void Delete(int id) { if (hasPermission() == false) { echoText(lang("exNoPermission")); return; } MicroblogComment c = MicroblogComment.findById(id); if (c == null) { echoText(lang("exDataNotFound")); return; } c.delete(); echoAjaxOk(); }
public virtual MicroblogComment GetById(int id) { return(MicroblogComment.findById(id)); }