IntroduceManage.aspx.cs

(完整代码) 2KB

using MyWeb.DBUtility;
using MyWeb.WebUtility;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MyWeb
{
    public partial class IntroduceManage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        [WebMethod]
        public static string loadIntroduceManage(string pi, string ps)
        {
            DBHelper db = new DBHelper();
            //分页sql查询列表数据
            string sql = "select top " + ((Convert.ToInt32(pi) - 1) * Convert.ToInt32(ps) + Convert.ToInt32(ps)) + " * from Introduce_Tbl where del=0  and id not in (select top " + ((Convert.ToInt32(pi) - 1) * Convert.ToInt32(ps)) + " id from Introduce_Tbl where del=0 order by addDate desc) order by addDate desc";
            DataSet ds = db.Query(sql);
            string html = "";
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                //得到列表数据
                html += "<tr><td>" + ds.Tables[0].Rows[i]["content"] + "</td><td>" + ds.Tables[0].Rows[i]["addDate"] + "</td><td><input type='button' value='删除' class='btn' id='" + ds.Tables[0].Rows[i]["id"] + "'/></td><td><a href='EditIntroduce.aspx?id=" + ds.Tables[0].Rows[i]["id"] + "'>修改</a></td></tr>";
            }
            return html;
        }
        //删除列表信息
        [WebMethod]
        public static int RemoveIntroduceManage(string id)
        {
            DBHelper db = new DBHelper();
            WebHelper wb = new WebHelper();
            string sql = "update Introduce_Tbl set del=1 where id='" + id + "'";
            int renum = db.ExecuteSql(sql);
            if (renum == 1)
            {
                return 1;
            }
            else
            {
                return 0;
            }

        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("AddIntroduce.aspx");
        }
    }
}

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

AI 解读 AI

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

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