Admin/NewsManage.aspx.cs
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
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.Xml.Linq;
using System.Data.OleDb;
using System.IO;
public partial class Admin_NewsManage :BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
AllowPage1.ControlID = "GridView1";
AllowPage1.ControlType = 1;
AllowPage1.PageSize =10;
AllowPage1.SQL = "select tb_news.*,fname,sname from tb_news,tb_second,tb_first where tb_news.fid=tb_first.fid and tb_news.sid=tb_second.sid order by addtime desc";
//AllowPage1.CurrentIndex;
BindToGrid();
BindToRptFirst();
}
}
public void BindToRptFirst()
{
string sql = "select * from tb_First where fid<>4";
rptFirst.DataSource = SQLClass.Query(sql).Tables[0];
rptFirst.DataBind();
}
public void BindToGrid()
{
int curIndex = 0;
if (Request.QueryString["page"] == null)
{
curIndex = 0;
}
else
{
curIndex= Int32.Parse(Request.QueryString["page"].ToString());
}
AllowPage1.DataTbl =SQLClass.Query(AllowPage1.SQL).Tables[0];
PagedDataSource pds = AllowPage1.GetPagedDataSource(curIndex);
GridView1.DataSource = pds;
GridView1.DataKeyNames = new string[] { "newsid" };
GridView1.DataBind();
}
//删除新闻,删除其相应附件
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int id = Int32.Parse(GridView1.DataKeys[e.RowIndex].Value.ToString());
string mstr = SQLClass.GetSingle("select newsimg from tb_news where firstimg<>'0' and newsid=" + id).ToString();
if (mstr.Contains("|"))
{
后面还有 146 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
