com.huiyou.Web/admin/productcategory_edit.aspx.cs

(开头部分) 4KB

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

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

using com.huiyou.Web.tools;
using com.huiyou.Bll;
using System.Data;
using com.huiyou.Common;
using System.Web.UI.HtmlControls;
using com.huiyou.Model.Tables;

namespace com.huiyou.Web.admin
{
    public partial class productcategory_edit : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!AdminLoginHelper.AdminEnter()) return;

            if (!Page.IsPostBack)
            {
                BindData();
            }
        }

        private void BindData()
        {
            string action = Request["action"];
            if (string.IsNullOrEmpty(action))
                action = "add";

            #region 绑定上级分类

            var dtCategory = ProductCategoryService.GetProductCategoryTree(2);
            foreach (DataRow row in dtCategory.Rows)
            {
                ListItem item = new ListItem();
                item.Text = row["CategoryName"].ToString();
                item.Value = row["Id"].ToString();

                if (row["depth"].ToString() == "2")
                {
                    item.Text = " |-- " + item.Text;
                }

                drpParentId.Items.Add(item);
            }

            #endregion

            if (action == "edit")
            {
                int id = Convert.ToInt32(Request["id"]);
                var model = ProductCategoryService.GetById(id);

                //绑定基本信息
                txtCategoryName.Text = Convert.ToString(model.CategoryName);
后面还有 77 行代码,购买后查看完整代码

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

AI 解读

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

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