SuLei.Web/admin/message/view.aspx.cs

(完整代码) 1KB

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.message
{
    public partial class view : ManagePage
    {
        private int id = 0;
        protected Model.sl_message model = new Model.sl_message();

        protected void Page_Load(object sender, EventArgs e)
        {
            this.id = SLRequest.GetQueryInt("id");
            if (this.id == 0)
            {
                JscriptMsg("传输参数不正确!", "back");
                return;
            }
            if (!new BLL.sl_message().Exists(this.id))
            {
                JscriptMsg("信息不存在或已被删除!", "back");
                return;
            }
            if (!Page.IsPostBack)
            {
                ChkAdminLevel("message_list", SLEnums.ActionEnum.View.ToString()); //检查权限
                ShowInfo(this.id);
            }
        }

        #region 赋值操作=================================
        private void ShowInfo(int _id)
        {
            BLL.sl_message bll = new BLL.sl_message();
            model = bll.GetModel(_id);
            txtReContent.Text = Utils.ToTxt(model.replay);
        }
        #endregion

        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("message_list", SLEnums.ActionEnum.Reply.ToString()); //检查权限
            BLL.sl_message bll = new BLL.sl_message();
            model = bll.GetModel(this.id);
            model.replay = Utils.ToHtml(txtReContent.Text);
            model.replay_time = DateTime.Now;
            bll.Update(model);
            AddAdminLog(SLEnums.ActionEnum.Reply.ToString(), "回复留言插件内容:" + model.title); //记录日志
            JscriptMsg("留言回复成功!", "index.aspx");
        }
    }
}

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

AI 解读

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

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