admin/showtype.aspx.cs

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class admin_showtype : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bind();
        }
    }

    public void bind()
    {

        DropDownList1.Items.Clear();
        string sql4 = "select * from type where p_id=0 order by id";
        DataSet set = DBClass.GetTableData(sql4, "sql");
        DropDownList1.DataSource = set;
        DropDownList1.DataBind();

        string sql = "select * from type where [p_id]=" + 0 + " order by  id desc";
        string sql1 = "select count(*) from type  where [p_id]=" + 0 + "";
        AspNetPager1.PageSize = 15;
        DBClass.binddl(sql1, sql, "sql", AspNetPager1, GridView1);

        string sql2 = "select * from type where [p_id]>" + 0 + "  order by  id desc";
        string sql3 = "select count(*) from type where [p_id]>" + 0 + "         ";
        AspNetPager2.PageSize = 10;
        DBClass.binddl(sql3, sql2, "sql", AspNetPager2, GridView2);

    }

    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string sql1 = "select * from type where p_id=" + GridView1.DataKeys[e.RowIndex].Value + "";
        DataSet set = DBClass.GetTableData(sql1, "sql");
        if (set.Tables["sql"].Rows.Count == 0)
        {
            string sql = "delete from type where id=" + GridView1.DataKeys[e.RowIndex].Value + "";
            if (DBClass.OperatorCommand(sql))
            {
                GridView1.EditIndex = -1;
                bind();
                Response.Write("<script>alert('删除成功!')</script>");
            }
        }
        else
        {
            Response.Write("<script>alert('删除失败!请先删除小类。')</script>");
后面还有 220 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。