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

📄 commentform_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 CommentForm_List : System.Web.UI.Page
    {
        YXShop.BLL.YXShop_CommentBook BLL = new YXShop.BLL.YXShop_CommentBook();
        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("013009000", PowerTree.PowerPanel.PowerType.look))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有查看此页面的权限!", "../index.aspx");
            }
            if (!IsPostBack)
            {
                BindData();
            }
            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_CommentBook data = new YXShop.BLL.YXShop_CommentBook();
            List<YXShop.Model.YXShop_CommentBook> datas = data.GetAll();
            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;
            }
            
            GridView1.DataBind();
        }

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

            }
        }
        [AjaxPro.AjaxMethod]
        public string PropertyDel(int Prop_ID)
        {
            if (!PowerTree.PowerPass.isPass("013009003", PowerTree.PowerPanel.PowerType.del))
            {
                return "false";
            }
            YXShop.BLL.YXShop_CommentBook data = new YXShop.BLL.YXShop_CommentBook();
            YXShop.Model.YXShop_CommentBook datam = new YXShop.Model.YXShop_CommentBook();
            datam.CF_ID=Prop_ID;
            data.Delete(datam);
            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

        #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 + -