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

📄 pro_auction_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.BLL;
using YXShop.Model;
using YXShop.Common;
using Shop.Web.UI;

namespace YXShop.Web.Admin.Product
{
    public partial class Pro_Auction_List : System.Web.UI.Page
    {
        public PageSet ps;
        YXShop.BLL.Pro_Auction dataCA = new YXShop.BLL.Pro_Auction();
        BasePage bp = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(YXShop.Web.Admin.Product.Pro_Auction_List));
            if (!PowerTree.PowerPass.isPass("002002000", PowerTree.PowerPanel.PowerType.look))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有查看此页面的权限!", "../index.aspx");
            }
            if (!IsPostBack)
            {
                grid();
            }

        }
        #region 列表
        private void grid()
        {
            int pageIndex = Request["pageIndex"] == null ? 0 : int.Parse(Request["pageIndex"]);
            if (pageIndex < 0)
            {
                pageIndex = 0;
            }
            if ((Request["Event"] == null) || (Request["Event"] == ""))
            {
                pageIndex = 0;
            }

            List<YXShop.Model.Pro_Auction> datas = dataCA.GetAll();
            dg1.DataSource = datas;
            ps = new PageSet(datas.Count, PageSet.PageSize, pageIndex);
            if (ps.PageCount <= pageIndex + 1)
            {
                pageIndex = ps.PageCount - 1;
            }

            dg1.PageSize = PageSet.PageSize;

            dg1.PageIndex = pageIndex;

            if (datas.Count < 1)
            {
                dg1.BackColor = System.Drawing.Color.White;
            }

            dg1.DataBind();
        }
        #endregion

        #region 批量删除
        protected void Button2_Click(object sender, EventArgs e)
        {
            System.Web.UI.WebControls.CheckBox chkExport;
            string sID;
            int all = dg1.Rows.Count;
            int i;
            try
            {
                for (i = 0; i < all; i++)
                {
                    chkExport = (CheckBox)dg1.Rows[i].FindControl("chkItem");
                    if (chkExport.Checked == true)
                    {
                        sID = dg1.DataKeys[i].Value.ToString();
                        YXShop.Model.Pro_Auction data = new YXShop.Model.Pro_Auction();
                        data.Auc_ID = Convert.ToInt32(sID);
                        dataCA.Delect(data);
                    }
                }
                grid();
            }
            catch (Exception eFS)
            {
                Response.Write(eFS.ToString());
                Response.End();
            }
        }
        #endregion


        [AjaxPro.AjaxMethod]
        public string GiftDel(int id)
        {
            if (PowerTree.PowerPass.isPass("002002003", PowerTree.PowerPanel.PowerType.del))
            {
                YXShop.Model.Pro_Auction datam = new YXShop.Model.Pro_Auction();
                datam.Auc_ID = id;
                dataCA.Delect(datam);
            }

            return string.Empty;
        }
        public string GetPowerStr(string powertype)
        {
            string reStr = "";
            switch (powertype)
            {
                case "del":
                    reStr = PowerTree.PowerPass.isPass("002002003", PowerTree.PowerPanel.PowerType.del) ? "t" : "f";
                    break;
            }
            return reStr;
        }
    }
}

⌨️ 快捷键说明

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