ccwl_admin/newsList.aspx.cs

(开头部分) 4KB

这里只显示每个文件的开头 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;

public partial class ccwl_admin_newsList : System.Web.UI.Page
{
    private string type = string.Empty;

    public string Type
    {
        get { return type; }
        set { type = value; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["users"] == null || Session["users"].ToString() == "")
        {
            Response.Write("<script>alert('对不起您还没有登陆!');window.location='login.aspx'</script>");
            return;
        }
        else if (!IsPostBack)
        {
            GetTitle();
            BindArticles();
        }

    }
    protected void gvwArticles_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string id = gvwArticles.DataKeys[e.RowIndex].Value.ToString();
        string sql = "delete from news where id=" + id;
        DBHelper.ExecuteBoolCommand(sql);
        BindArticles();
    }
    private void BindArticles()
    {
        string sql = string.Empty;
        string Channel = string.Empty;
        if (this.Request.QueryString["type"] != null)
        {

            Channel = this.Request.QueryString["type"];
            Type = Channel;
        }
        sql = " select   id,title,source,inputtime,istop,content,channel,isCheck from news where channel=" + Channel;
        if (this.txtTitle.Text.Trim()!="")
        {
            sql += " and title like '%"+this.txtTitle.Text.Trim()+"%' ";
        }
        sql += " order by id desc ";
        DataSet ds = DBHelper.GetDataSet(sql);
        gvwArticles.DataSource = ds.Tables[0].DefaultView;
后面还有 86 行代码,购买后查看完整代码

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

AI 解读

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

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