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

📄 pro_quehuomange.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 YXShop.Web.Admin.Control;
using System.Data.SqlClient;
namespace YXShop.Web.Admin.Product
{
    public partial class Pro_QueHuoMange : System.Web.UI.Page
    {
        YXShop.BLL.YXshop_QueHuoShop BLL = new YXShop.BLL.YXshop_QueHuoShop();
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLConnString"].ConnectionString); 
            conn.Open();
            DataSet ds = new DataSet();
            SqlDataAdapter adapter = new SqlDataAdapter("select * from YXshop_QueHuoShop", conn);
            adapter.Fill(ds, "YXshop_QueHuoShop");  
            GridView1.DataSource = ds.Tables["YXshop_QueHuoShop"].DefaultView;
            GridView1.DataBind();
            conn.Close();
            conn.Dispose();
            if (!string.IsNullOrEmpty(Request["isshen"])) {
                string sql = "";
                if (Request["isshen"].ToString() == "0")
                {
                    sql = "update  YXshop_QueHuoShop set Qshop_isShenHe=1 where Qshop_ID=" + Convert.ToInt32(Request["Qshop_ID"]) + "";
                }
                else {
                    sql = "update  YXshop_QueHuoShop set Qshop_isShenHe=0 where Qshop_ID=" + Convert.ToInt32(Request["Qshop_ID"]) + "";

                }
                SqlConnection conn1 = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLConnString"].ConnectionString); 
                conn1.Open();
                SqlCommand comm = new SqlCommand(sql, conn1);
                comm.ExecuteNonQuery();
                Response.Redirect("Pro_QueHuoMange.aspx");
            }
            if (!string.IsNullOrEmpty(Request["delid"])) {
                SqlConnection conn2 = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLConnString"].ConnectionString);
                conn2.Open();
                string sql2 = "delete   from YXshop_QueHuoShop where Qshop_ID=" + Convert.ToInt32(Request["delid"]) + "";
                SqlCommand comm2 = new SqlCommand(sql2, conn2);
                comm2.ExecuteNonQuery();
                Response.Redirect("Pro_QueHuoMange.aspx");
            }
        }
        public string Leixing(string  type) {
            string leixing1="";
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLConnString"].ConnectionString);
            conn.Open();
            string sql = "select * from YXShop_ProCategories where ProC_ID="+Convert.ToInt32(type)+"";
            SqlCommand comm = new SqlCommand(sql, conn);
            SqlDataReader dr = comm.ExecuteReader();
            while (dr.Read()) {
                leixing1 = dr["ProC_Name"].ToString();
            }
            dr.Close();
            conn.Close();
            conn.Dispose();
            return leixing1.ToString();
        }
        public string shehe(string shehe1)
        {
            if (shehe1 == "0")
            {
                return "未审核";
            }
            else {
                return "<font color=red>审核</font>";
            }
         }
        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.PageIndex = e.NewPageIndex;
            this.GridView1.DataBind(); 
        }


    }
}

⌨️ 快捷键说明

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