Scientific/Main/Content/AddNews.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Scientific.Main.Content
{
    public partial class AddNews : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {

                if (Request["InfoID"] == null)
                {
                    Literal1.Text = "添加";
                    Literal2.Text += "<script type=\"text/javascript\" >var ue = UE.getEditor('Content',{ toolbars: [['fullscreen', 'source', '|', 'undo', 'redo', '|', 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', '|', 'insertimage', 'wordimage', 'emotion']], wordCount: false });SetEdit('Content','')</script>";
                }
                else
                {
                    DataTable dt = new BLL.Models.Scientific().GetContentInfo(int.Parse(Request["InfoID"].ToString()), "News");
                    title.Value = dt.Rows[0]["Title"].ToString();
                    username.Value = dt.Rows[0]["Source"].ToString();
                    Literal2.Text += "<script type=\"text/javascript\" >var ue = UE.getEditor('Content',{ toolbars: [['fullscreen', 'source', '|', 'undo', 'redo', '|', 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', '|', 'insertimage', 'wordimage', 'emotion']], wordCount: false });SetEdit('Content','" + dt.Rows[0]["Content"].ToString() + "')</script>";
                    Literal1.Text = "编辑";
                }
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (Request["InfoID"] == null)
            {
                Hashtable ht = new Hashtable();
                ht.Add("Title", title.Value);
                ht.Add("Source", username.Value);
                ht.Add("Content", HiddenField1.Value);

                if (new BLL.Models.Scientific().AddContent("News", ht) > 0)
                {
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), System.DateTime.Now.Ticks.ToString(), "layer.alert('操作成功!', {icon: 1,kin: 'layer-ext-moon',closeBtn: 0}, function () { location.href = 'NewsManage.aspx';})", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), System.DateTime.Now.Ticks.ToString(), "layer.alert('操作失败!', {icon: 2,kin: 'layer-ext-moon',closeBtn: 0})", true);
                }
            }
            else
            {
                Hashtable ht = new Hashtable();
                ht.Add("InfoID", Request["InfoID"].ToString());
                ht.Add("Title", title.Value);
                ht.Add("Source", username.Value);
                ht.Add("Content", HiddenField1.Value);

后面还有 12 行代码,购买后查看完整代码

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

AI 解读 AI

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

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