⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 proproperty_list.aspx.cs

📁 易想商城系统
💻 CS
字号:
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 YXShop.Common;
using Shop.Web.UI;

namespace YXShop.Web.Admin.Product
{
    public partial class ProProperty_List : System.Web.UI.Page
    {
        YXShop.BLL.YXShop_ProProperty BLL = new YXShop.BLL.YXShop_ProProperty();
        public PageSet ps; 
        BasePage bp = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(YXShop.Web.Admin.Product.ProProperty_List));
            if (!PowerTree.PowerPass.isPass("001003000", PowerTree.PowerPanel.PowerType.look))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有查看此页的权限!", "../index.aspx");
            }
            if ((!IsPostBack) || ((Request["Event"] != null) && (Request["Event"] != "")))
            {
                BindData();
            }
        }
        private void BindData()
        {
            int pageIndex = Request["pageIndex"] == null ? 0 : int.Parse(Request["pageIndex"]);
            if (pageIndex < 0)
            {
                pageIndex = 0;
            }
            if ((Request["Event"] == null) || (Request["Event"] == ""))
            {
                pageIndex = 0;
            }
            YXShop.BLL.YXShop_ProProperty data = new YXShop.BLL.YXShop_ProProperty();
            List<YXShop.Model.YXShop_ProProperty> datas = data.GetList();
            GridView1.DataSource = datas;

            ps = new PageSet(datas.Count, PageSet.PageSize, pageIndex);
            if (ps.PageCount <= pageIndex + 1)
            {
                pageIndex = ps.PageCount - 1;
            }

            GridView1.PageSize = PageSet.PageSize;
            GridView1.PageIndex = pageIndex;
            if (datas.Count < 1)
            {
                GridView1.BackColor = System.Drawing.Color.White;
            } 
            //else
            //{
            //    GridView1.BackColor = System.Drawing.Color.FromArgb(0xe3, 0xe3, 0xe3);
            //}
            GridView1.DataBind();
        }

        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (!(e.Row.DataItem is YXShop.Model.YXShop_ProProperty))
            {
                return;
            }
            YXShop.Model.YXShop_ProProperty data = (e.Row.DataItem as YXShop.Model.YXShop_ProProperty);
            if (data != null)
            {

            }
        }
        [AjaxPro.AjaxMethod]
        public string PropertyDel(int Prop_ID)
        {
            if (PowerTree.PowerPass.isPass("001003003", PowerTree.PowerPanel.PowerType.del))
            {
                YXShop.BLL.YXShop_ProProperty data = new YXShop.BLL.YXShop_ProProperty();
                YXShop.Model.YXShop_ProProperty datam = new YXShop.Model.YXShop_ProProperty();
                data.Delete(Prop_ID);
            }
            return string.Empty;
        }

        #region 返回属性值的类型

        public string ProP_Type(string pID)
        {
            string str = "";
            switch (pID)
            {
                case "1":
                    str = "从下拉列表中选择";
                    break;
                case "2":
                    str = "单选";
                    break;
                case "3":
                    str = "多选";
                    break;
                case "4":
                    str = "单行文本";
                    break;
                default:
                    str = "多行文本";
                    break;
            }
            return str;
        }
        #endregion
        public string GetPowerStr(string powertype)
        {
            string reStr = "";
            switch (powertype)
            {
                case "del":
                    reStr = PowerTree.PowerPass.isPass("001003003", PowerTree.PowerPanel.PowerType.del) ? "t" : "f";
                    break;
            }
            return reStr;
        }
        #region 格式化现实属性的可选值
        public string ProP_Value(string pValue)
        {
            if (!string.IsNullOrEmpty(pValue))
            {
                return pValue.Replace("\n", ",");
            }
            else
            {
                return "<font color=\"Red\">无可选值</font>";
            }
        }
        #endregion
    }
}

⌨️ 快捷键说明

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