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

📄 turnsonmemberqz.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.Web.Admin.Control;
using Shop.Web.UI;
using System.Data.SqlClient;
using System.Web.UI.MobileControls;
using System.Collections.Generic;

namespace YXShop.Web.Admin.TurnSon
{
    public partial class TurnsonMemberqz : System.Web.UI.Page
    {
        BasePage bp = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!PowerTree.PowerPass.isPass("013006000",PowerTree.PowerPanel.PowerType.look))
            {
                bp = new BasePage();
                bp.PageError("对不起,你没有查看此页面的权限!", "../index.aspx");
            }


            AjaxPro.Utility.RegisterTypeForAjax(typeof(YXShop.Web.Admin.TurnSon.TurnsonMemberqz));
            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")
                {
                    if (!PowerTree.PowerPass.isPass("013006003", PowerTree.PowerPanel.PowerType.del))
                    {
                        bp = new BasePage();
                        bp.PageError("对不起,你没有删除圈子项的权限!", "../index.aspx");
                    }
                    string id =Request.Form["ID"].Trim();
                    del(id);
                }
                Response.End();
                return;
            }
            if (!IsPostBack)
            {
                StartLoad1();
                StartLoad(1);
                bin();
            }
        }
        #region 列表信息
        //获得列表
        protected void PageNavigator1_PageChange(object sender, int PageIndex)
        {
            StartLoad(PageIndex);
        }
        protected void bin()
        {
            int i = 0;
            int j = 0;
            YXShop.BLL.Turnson asda = new YXShop.BLL.Turnson();
            DropDownList1.DataSource = asda.GetAll();           
            DropDownList1.DataValueField = "ID";
            DropDownList1.DataTextField = "Ts_name";
            DropDownList1.DataBind();

        }


        protected void StartLoad(int PageIndex)
        {
            YXShop.BLL.TurnsonEstablish datab = new YXShop.BLL.TurnsonEstablish();
            int i = 0;
            int j = 0;
            //List<YXShop.Model.TurnsonEstablish> data = datab.GetListByColumn("QuestionID", Request.QueryString["SurveyID"], PageIndex, 50, out i, out j);
            List<YXShop.Model.TurnsonEstablish> data = datab.GetAll(PageIndex, 50, out i, out j);
            this.PageNavigator1.PageCount = j;
            this.PageNavigator1.PageIndex = PageIndex;
            this.PageNavigator1.RecordCount = i;
            Questionlists.DataSource = data;                              //设置datalist数据源
            Questionlists.DataBind();                                   //绑定数据源
        }
        protected void StartLoad1()
        {
            YXShop.BLL.TurnsonEstablish datab = new YXShop.BLL.TurnsonEstablish();
            int i = 0;
            int j = 0;
            //List<YXShop.Model.TurnsonEstablish> data = datab.GetListByColumn("QuestionID", Request.QueryString["SurveyID"], PageIndex, 50, out i, out j);
            string strsql = " Recommend = 1";
            List<YXShop.Model.TurnsonEstablish> data = datab.GetListqz(strsql);
            this.PageNavigator1.PageCount = 1;
            this.PageNavigator1.PageIndex = 1;
            this.PageNavigator1.RecordCount = 1;
            Repeater2.DataSource = data;                              //设置datalist数据源
            Repeater2.DataBind();                                   //绑定数据源
        }

        protected void DataList1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
        }
        #endregion
        #region 删除信息
        private void del(string sid)
        {
            if (!PowerTree.PowerPass.isPass("013006003", PowerTree.PowerPanel.PowerType.del))
            {
                
            }
            YXShop.BLL.TurnsonEstablish datab = new YXShop.BLL.TurnsonEstablish();
            string[] id = sid.Split(',');
            int ln = id.Length;
            int n = 0;
            for (int i = 0; i < id.Length; i++)
            {
                if (!id[i].Trim().Equals(""))
                {
                    try
                    {
                        datab.Delect(Convert.ToInt32(id[i]));
                        n++;
                    }
                    catch
                    {
                        continue;
                    }
                }
            }
            Response.Write(n + "%成功删除" + n + "个圈子!");
        }
        #endregion

        #region
        protected string QuestionType(string TypeID)
        {
            string Str = "";
            switch (TypeID)
            {
                case "1":
                    Str = "单行文本";
                    break;
                case "2":
                    Str = "多行文本";
                    break;
                case "3":
                    Str = "单选";
                    break;
                case "4":
                    Str = "多选";
                    break;
                case "5":
                    Str = "下拉";
                    break;
                case "6":
                    Str = "是/否(单选框)";
                    break;
            }
            return Str;
        }
        #endregion

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            YXShop.BLL.TurnsonEstablish datab = new YXShop.BLL.TurnsonEstablish();
            string asdasdas = DropDownList1.SelectedValue.ToString();
            int i = 0;
            int j = 0;
            int PageIndex = 1;
            string strsql = "YXShop_TurnsonEstablish where TurnsonID = " + DropDownList1.SelectedValue.ToString() + " ";
           // List<YXShop.Model.TurnsonEstablish> data = datab.GetListByColumnb("TurnsonID", DropDownList1.SelectedValue.ToString(), PageIndex, 100, out i, out j);
            List<YXShop.Model.TurnsonEstablish> data = datab.GetListByColumnb(strsql, PageIndex, 100, out i, out j);
            this.PageNavigator1.PageCount = j;
            this.PageNavigator1.PageIndex = PageIndex;
            this.PageNavigator1.RecordCount = i;
            Questionlists.DataSource = data;                              //设置datalist数据源
            Questionlists.DataBind();  

        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            YXShop.BLL.TurnsonEstablish datab = new YXShop.BLL.TurnsonEstablish();
            int i = 0;
            int j = 0;
            int PageIndex = 1;
            string strsql = "YXShop_TurnsonEstablish where TurnsonID = " + DropDownList1.SelectedValue.ToString() + " and Turnsonname like '%"+this.TextBox1.Text.Trim()+"%'";
            //List<YXShop.Model.TurnsonEstablish> data = datab.GetListByColumnb("TurnsonID", DropDownList1.SelectedValue.ToString(), PageIndex, 100, out i, out j);
            List<YXShop.Model.TurnsonEstablish> data = datab.GetListByColumnb(strsql, PageIndex, 100, out i, out j);
            this.PageNavigator1.PageCount = j;
            this.PageNavigator1.PageIndex = PageIndex;
            this.PageNavigator1.RecordCount = i;
            Questionlists.DataSource = data;                              //设置datalist数据源
            Questionlists.DataBind();  
        }
        [AjaxPro.AjaxMethod]
        public string tjh(int IDStr)
        {
            if (!PowerTree.PowerPass.isPass("013006006", PowerTree.PowerPanel.PowerType.other))
            {
                return "false";
            }
            YXShop.BLL.TurnsonEstablish datab = new YXShop.BLL.TurnsonEstablish();
            string strsql = " Recommend = 1";
            List<YXShop.Model.TurnsonEstablish> asd = datab.GetListqz(strsql);
            if (asd.Count >= 3)
            {
                return "asd";
            }
            else
            {
                datab.Amend(Convert.ToInt32(IDStr), "Recommend", 1);
            }
            return string.Empty;
        }
        [AjaxPro.AjaxMethod]
        public string jsh(int IDStr)
        {
            if (!PowerTree.PowerPass.isPass("013006006", PowerTree.PowerPanel.PowerType.other))
            {
                return "false";
            }
            YXShop.BLL.TurnsonEstablish datab = new YXShop.BLL.TurnsonEstablish();
            datab.Amend(Convert.ToInt32(IDStr), "Recommend", 0);
           
            return string.Empty;
        }
    }
}

⌨️ 快捷键说明

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