Web/Admin/Channel/Edit.aspx.cs

(开头部分) 2KB

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

using System;
using System.Data;
using System.Web;
using Web.UI;

namespace Web.Admin.Channel
{
    public partial class Edit : ManagePage
    {
        private BLL.Channel bll = new BLL.Channel();
        private Model.Channel model = new Model.Channel();
        public int kindId; //种类
        public int classId;    //ID
        protected void Page_Load(object sender, EventArgs e)
        {
            chkLoginLevel("editChannel");
            //取得栏目传参
            if (int.TryParse(Request.Params["kindId"], out kindId) && int.TryParse(Request.Params["classId"], out classId))
            {
                model = bll.GetModel(classId);
                if (!Page.IsPostBack)
                {
                    ShowInfo();
                }
            }
            else
            {
                JscriptMsg(350, 230, "错误提示", "<b>出现错误啦!</b>您要修改类别的种类不明确或参数不正确。", "back", "Error");
            }
        }

        //绑定数据
        private void ShowInfo()
        {
            this.lblPid.Text = model.ParentId.ToString();
            if (model.ParentId>0)
            {
                this.lblPname.Text = bll.GetChannelTitle(model.ParentId);
            }
            else
            {
                this.lblPname.Text = "顶级类别";
            }
            this.txtImgUrl.Text = model.ImgUrl;
            this.TxtKeyWord.Text = model.Keywords;
            this.TxtDescription.Text = model.Description;
            this.txtTitle.Text = model.Title;
            this.txtPageUrl.Text = model.PageUrl;
            this.txtSortId.Text = model.SortId.ToString();
        }

        //保存修改
        protected void btnSave_Click(object sender, EventArgs e)
        {
            model.Title = txtTitle.Text.Trim();
            model.PageUrl = txtPageUrl.Text.Trim();
            model.SortId = int.Parse(txtSortId.Text.Trim());
            model.Keywords = TxtKeyWord.Text.Trim();
            model.Description = TxtDescription.Text.Trim();
            model.ImgUrl = txtImgUrl.Text.Trim();
后面还有 9 行代码,购买后查看完整代码

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

AI 解读 AI

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

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