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

📄 prorestore.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 Shop.Web.UI;

namespace YXShop.Web.Admin.Product
{
    public partial class ProReStore : System.Web.UI.Page
    {
        YXShop.BLL.Product bll = new YXShop.BLL.Product();
        public PageSet ps = null;
        BasePage bp = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("001006000", 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;
            }
            int RecordCount=0;
            int PageCount=0;
            List<YXShop.Model.Product> datas = bll.GetListByColumn("Pro_Audit", 3, pageIndex + 1, PageSet.PageSize, out RecordCount, out PageCount);
            gvProduct.DataSource = datas;
            ps = new PageSet(RecordCount, PageSet.PageSize, pageIndex);
            if (ps.PageCount <= pageIndex + 1)
            {
                pageIndex = ps.PageCount - 1;
            }
            gvProduct.PageSize = PageSet.PageSize;
            gvProduct.PageIndex = pageIndex;
            if (datas.Count < 1)
            {
                gvProduct.BackColor = System.Drawing.Color.White;
            }
            gvProduct.DataBind();
        }

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("001006003", PowerTree.PowerPanel.PowerType.del))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有删除数据的权限!", "../index.aspx");
            }
            else
            {
                int proID = GetProID((ImageButton)sender);
                try
                {
                    bll.operatePro(proID.ToString(), 2);
                    BindData();
                }
                catch { }
            }
        }

        private int GetProID(ImageButton sender)
        {
            int proID = 0;
            if (YXShop.Common.WebUtility.isNumeric(sender.CommandArgument))
            {
                proID = Convert.ToInt32(sender.CommandArgument);
            }
            return proID;
        }
        /// <summary>
        /// 还原
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("001006006",PowerTree.PowerPanel.PowerType.other))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有还原数据的权限!", "../index.aspx");
            }
            else
            {
                int proID = GetProID((ImageButton)sender);
                try
                {
                    bll.operatePro(proID.ToString(), 4);
                    BindData();
                }
                catch { }
            }
        }

        #region 返回商品分类名称
        /// <summary>
        /// 返回商品分类名称
        /// </summary>
        /// <param name="classID"></param>
        /// <returns></returns>
        public string className(string classID)
        {
            string reStr = "无";
            try
            {
                int cID = -1;
                if (YXShop.Common.WebUtility.isNumeric(classID))
                {
                    cID = Convert.ToInt32(classID);
                }
                YXShop.BLL.Pro_Categories PC = new YXShop.BLL.Pro_Categories();
                List<YXShop.Model.Pro_Categories> lPC = PC.GetId(cID);
                if (lPC != null && lPC.Count > 0)
                {
                    reStr = lPC[0].ProC_CategroiesName;
                }
            }
            catch { }
            return reStr;
        }
        #endregion
    }
}

⌨️ 快捷键说明

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