turnson.ascx.cs

来自「易想商城系统」· CS 代码 · 共 83 行

CS
83
字号
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using System.Text;
namespace YXShop.Web.Admin.Control
{
    public partial class Turnson : System.Web.UI.UserControl
    {
        protected string SelectList, slingSelect1, OKID;
        protected int i;
        private string _id = string.Empty;
        public string strID
        {

            get
            {
                return (_id == null) ? "" : _id;

            }
            set
            {
                _id = value;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SelectContent();
        }
        protected void SelectContent()
        {
            YXShop.BLL.Turnson bdata = new YXShop.BLL.Turnson();
            List<YXShop.Model.Turnson> data = bdata.GetAll();
            slingSelect1 = "<select id=\"Turnson1\" name=\"Turnson1\" runat=\"server\">";
            if (strID != string.Empty && strID != null)
            {
                if (strID == "0")
                {
                    slingSelect1 += "<option value=\"0\" selected>作为一级分类</option>";
                }

            }
            else
            {
                slingSelect1 += "<option value=\"0\" >作为一级分类</option>";
            }


            if (data.Count > 0)
            {
                foreach (YXShop.Model.Turnson ds in data)
                {
                    string[] ParentPath = ds.Ts_Flid.Split(',');
                    string KG = "";
                    for (int j = 0; j < ParentPath.Length; j++)
                    {
                        KG += "&nbsp;&nbsp;";
                    }
                    //int k = ParentPath.Length - 1;
                    //string pd = ParentPath[k].ToString();
                    if (ds.ID.ToString() == strID)
                    {
                        slingSelect1 += "<option value=" + ds.ID + " selected >" + KG + "├" + ds.Ts_name + "</option>";
                    }
                    else
                    {
                        slingSelect1 += "<option value=" + ds.ID + " >" + KG + "├" + ds.Ts_name + "</option>";
                    }
                 
                }
            }
            slingSelect1 += "</select>";
            SelectList = slingSelect1.ToString();
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?