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

📄 shoptypemanager.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 YXShop.Common;
using System.Collections.Generic;
using YXShop.Web.Admin.Control;
using Shop.Web.UI;

namespace YXShop.Web.Admin.Shop
{
    public partial class ShopTypeManager : System.Web.UI.Page
    {
        YXShop.BLL.YXShop_ShopType stBll = new YXShop.BLL.YXShop_ShopType();
        BasePage bp = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("014002000", PowerTree.PowerPanel.PowerType.look))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有查看此页面的权限!", "../index.aspx");
            }
            this.PageNavigator1.OnPageChange += new PageChangeHandler(PageNavigator1_PageChange);
            if (Request.Form["Option"] != null && !Request.Form["Option"].Trim().Equals("")
   && Request.Form["ID"] != null && !Request.Form["ID"].Trim().Equals(""))
            {

                string types = Request.Form["Option"].Trim();
                if (types == "del")
                {
                    string id = Request.Form["ID"].Trim();
                    del(id);
                }
                Response.End();
                return;
            }
            if (!Page.IsPostBack)
            {
                StartLoad(1);
            }
        }
        #region 列表信息
        //获得列表
        protected void PageNavigator1_PageChange(object sender, int PageIndex)
        {
            StartLoad(PageIndex);
        }

        protected void StartLoad(int PageIndex)
        {
            int i = 0;
            int j = 0;
            List<YXShop.Model.YXShop_ShopType> data = stBll.GetPages(PageIndex, 20, out i, out j);
            this.PageNavigator1.PageCount = j;
            this.PageNavigator1.PageIndex = PageIndex;
            this.PageNavigator1.RecordCount = i;
            Repeater1.DataSource = data;                              //设置datalist数据源
            Repeater1.DataBind();                                   //绑定数据源
        }
        #endregion

        #region 删除信息
        private void del(string sid)
        {
            if (!PowerTree.PowerPass.isPass("014002003", PowerTree.PowerPanel.PowerType.del))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有删除店铺等级的权限!", "../index.aspx");
            }
            string[] id = sid.Split(',');
            int ln = id.Length;
            int n = 0;
            YXShop.Model.YXShop_ShopType sModel = new YXShop.Model.YXShop_ShopType();
            for (int i = 0; i < id.Length; i++)
            {
                if (YXShop.Common.WebUtility.isNumeric(id[i].Trim()))
                {
                    try
                    {
                        sModel.STID = Convert.ToInt32(id[i]);
                        stBll.Delete(sModel);
                        n++;
                    }
                    catch
                    {
                        continue;
                    }
                }
            }
            Response.Write(n + "%成功删除" + n + "条数据!");
        }
        #endregion
        #region 判断是否具有删除权限
        /// <summary>
        /// 判断是否具有删除权限
        /// </summary>
        /// <param name="powertype"></param>
        /// <returns></returns>
        public string GetPowerStr(string powertype)
        {
            string reStr = "";
            switch (powertype)
            {
                case "del":
                    reStr = PowerTree.PowerPass.isPass("014002003", PowerTree.PowerPanel.PowerType.del) ? "t" : "f";
                    break;
            }
            return reStr;
        }
        #endregion
    }
}

⌨️ 快捷键说明

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