commentpost.ascx.cs

来自「如果不使用IIS,请先运行 XSP.exe,待提示已侦听 8080端口后」· CS 代码 · 共 71 行

CS
71
字号
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using DNNLite.Entites.Modules;
using DNNLite.DesktopModules.Comment;
using NHibernate.Expression;
using DNNLite.Service;
using Ader.TemplateEngine;

public partial class DesktopModules_Comment_CommentPost : CommentPage
{
    protected string posturl;

    protected void Page_Load(object sender, EventArgs e)
    {
        

        if (needcomment && ischecked)
        {
            CommentSubject csub = CommentSubject.FindFirst(new EqExpression("CommentKey", key));

            if (csub == null)
            {
                csub = new CommentSubject();
                csub.Antis = 0;
                csub.Backers = 0;
                csub.CommentCount = 0;
                csub.CommentKey = key;
                csub.Neutrals = 0;
                csub.Subject = subject;
                csub.SourceTabModule = sourcetabmoduleid; 
                csub.CreateAndFlush();

            }

            posturl  = ResolveUrl("~/DesktopModules/Comment/CPost.aspx?" +
                        "commenttabmoduleid=" + TabModuleInfo.TabModuleId +
                        "&sourcetabmoduleid=" + sourcetabmoduleid +
                        "&commentkey=" + key +
                        "&commentid=" + csub.Id +
                        "&commentcheck=" + DNNLite.Util.MD5CheckSum.MD5Hash(key)
                        );

            string templetfile =
                Settings.ContainsKey("Templet") ? 
                                        Settings["Templet"] :
                                        "~/Templets/Comment/提交评论.htm";


            
            TemplateManager tm= TemplateManager.FromFile(
                Server.MapPath(templetfile ) 
                );

            tm.SetValue("posturl", posturl);

            litForm.Text = tm.Process();

        }

    }

    

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?