BookShop.Web/Manage/Cate_Web/CateEdit.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.Text;

using CTL.Common;

namespace BookShop.Web.Manage
{
    public partial class CateEdit : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                

            }
        }
           

        /// <summary>
        /// 按钮事件
        /// </summary>
        /// <param name="sender">触发事件的对象</param>
        /// <param name="e">事件的参数</param>
        protected void subitBtn_Click(object sender, EventArgs e)
        {
            CheckPermission(ResEnum.类别, ActionEnum.添加);

            string catename = txtName.Value.Trim();
            int parentid = Utils.StrToInt(Requests.Form("parentId"));
            Model.Cate model = CateBLL.GetCateInfoByCondition("Name='" + catename + "'");

            if (model != null)
            {
                ShowError("该类别名称已经存在。");
            }
            else
            {
                model = new Model.Cate()
                {
                    CreateTime = DateTime.Now,
                    ParentID = parentid,
                    Name = catename
                };

                if (CateBLL.AddCate(model) > 0)
                {
                    ShowOK("添加成功!");
                }
                else
                {
                    ShowError("添加失败!");
                }
            }
        }
后面还有 33 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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