SuLei.Web/admin/article/comment_edit.aspx.cs

(完整代码) 2KB

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SuLei.Common;
using SuLei.UI;

namespace SuLei.Web.admin.article
{
    public partial class comment_edit : ManagePage
    {
        private int id = 0;
        private string channel_name = string.Empty; //频道名称
        protected Model.sl_article_comment model = new Model.sl_article_comment();

        protected void Page_Load(object sender, EventArgs e)
        {
            this.id = SLRequest.GetQueryInt("id");
            if (id == 0)
            {
                JscriptMsg("传输参数不正确!", "back");
                return;
            }
            if (!new BLL.sl_article_comment().Exists(this.id))
            {
                JscriptMsg("记录不存在或已删除!", "back");
                return;
            }
            this.model = new BLL.sl_article_comment().GetModel(this.id); //取得评论实体
            this.channel_name = new BLL.sl_site_channel().GetChannelName(model.channel_id); //取得频道名称
            if (!Page.IsPostBack)
            {
                ShowInfo();
            }
        }

        #region 赋值操作=================================
        private void ShowInfo()
        {
            txtReContent.Text = Utils.ToTxt(model.reply_content);
            rblIsLock.SelectedValue = model.is_lock.ToString();
        }
        #endregion

        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("channel_" + this.channel_name + "_comment", SLEnums.ActionEnum.Reply.ToString()); //检查权限
            BLL.sl_article_comment bll = new BLL.sl_article_comment();
            model.is_reply = 1;
            model.reply_content = Utils.ToHtml(txtReContent.Text);
            model.is_lock = int.Parse(rblIsLock.SelectedValue);
            model.reply_time = DateTime.Now;
            bll.Update(model);
            AddAdminLog(SLEnums.ActionEnum.Reply.ToString(), "回复" + this.channel_name + "频道评论ID:" + model.id); //记录日志
            JscriptMsg("评论回复成功!", "comment_list.aspx?channel_id=" + model.channel_id);
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。