コード例 #1
0
        public int DislikeProductDetial(int fCommentId)
        {
            CComment comment = CCommentFactory.fn留言查詢().FirstOrDefault(p => p.fCommentId == fCommentId);

            comment.fLikeCount -= 1;
            CCommentFactory.fn留言更新(comment);

            int result = comment.fLikeCount;

            return(result);
        }
コード例 #2
0
        //將選取的對象加入黑名單
        public string commentboard(int commentid, string content, int memberid)
        {
            CAdmin admin = Session[CAdminSession.Session_Login_User] as CAdmin;

            var comment = CCommentFactory.fn留言查詢().FirstOrDefault(m => m.fCommentId == commentid);

            comment.fContent  = content;
            comment.fIsBanned = true;
            CCommentFactory.fn留言更新(comment);
            var member = CMemberFactory.fn會員查詢().FirstOrDefault(n => n.fMemberId == memberid);

            CNotice c = new CNotice();

            c.fNoticeDatetime = DateTime.UtcNow.AddHours(08);
            c.fNoticeContent  = "此留言因涉及違規發言已被遮蔽";
            c.fCategoryType   = "管理員";
            c.fLink           = "超連結";
            c.fMemberId       = member.fMemberId;
            CNoticeFactory.fn通知訂單訊息新增(c);

            return("遮蔽原因更新成功!");
        }