Web/Admin/Channel/Add.aspx.cs

(开头部分) 2KB

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

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

namespace cosmos.Web.Admin.Channel
{
    public partial class Add : ManagePage
    {
        private cosmos.BLL.Channel bll = new cosmos.BLL.Channel();
        private cosmos.Model.Channel model = new cosmos.Model.Channel();
        public int kindId; //栏目种类
        public int pId;    //栏目父ID
        public string pTitle = "顶级类别";

        protected void Page_Load(object sender, EventArgs e)
        {
            //取得栏目传参
            if (int.TryParse(Request.Params["kindId"], out kindId))
            {
                if (int.TryParse(Request.Params["classId"], out pId))
                {
                    pTitle = bll.GetChannelTitle(pId);
                }
                else
                {
                    pId = 0;
                }
                lblPid.Text = pId.ToString();
                lblPname.Text = pTitle;
            }
            else
            {
                JscriptMsg(350, 230, "错误提示", "<b>出现错误!</b>您要增加类别的种类不明确或参数不正确。", "back", "Error");
            }
        }

        //添加
        protected void btnSave_Click(object sender, EventArgs e)
        {
            int classId;
            int parentId = int.Parse(this.lblPid.Text.Trim());          //上一级目录
            int classLayer = 1;                                         //栏目深度
            string classList = "";
            
            model.Title = this.txtTitle.Text.Trim();
            model.ParentId = parentId;
            model.SortId = int.Parse(this.txtSortId.Text.Trim());
            model.KindId = this.kindId;
            //添加栏目
            classId = bll.Add(model);
            //修改栏目的下属栏目ID列表
            if (parentId > 0)
            {
                DataSet ds = bll.GetChannelListByClassId(parentId);

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

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

AI 解读 AI

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

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