代码拉取完成,页面将自动刷新
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 Wuqi.Webdiyer;
using System.Data.SqlClient;
using dal.tooldal;
public partial class send_detailsearch : WebPage
{
public string _username = "";
public string _bdate = "";
public string _edate = "";
public string _pcuser = "";
protected void Page_Load(object sender, EventArgs e)
{
this.VerifyPage();
try
{
_pcuser = Request.QueryString.Get("c");
security m = new security();
_username = m.decryptquerystring(_pcuser);
_bdate = Request.QueryString["b"];
_edate = Request.QueryString["e"];
}
catch { }
this.pcbtime.Value = _bdate;
this.pcetime.Value = _edate;
pcuser.InnerText = _username;
if (!Page.IsPostBack)
{
DataBindlist();
}
}
protected void DataBindlist()
{
string mysql = "";
if (_bdate != "" && _edate == "")
{
mysql += " and sendtime >= '" + Convert.ToDateTime(_bdate) + "' ";
}
if (_bdate == "" && _edate != "")
{
mysql += " and sendtime <= '" + Convert.ToDateTime(_edate) + "' ";
}
if (_bdate != "" && _edate != "")
{
mysql += " and sendtime between '" + Convert.ToDateTime(_bdate) + "' and '" + Convert.ToDateTime(_edate) + "' ";
}
string sqlCount = string.Format("Select Count(1) From [Table_Reports] where username='"+_username+"'" + mysql);
int recordcount = GetData.GetScalar(sqlCount);
if (recordcount == 0)
{
this.message.Visible = true;
}
pagelist.AlwaysShow = true;
pagelist.RecordCount = recordcount; //读出数据库里一共有多少条数据
string sql = "select * from [Table_Reports] where username='" + _username + "'" + mysql + " order by id desc";
//Response.Write(sql);
SqlDataAdapter ad = new SqlDataAdapter(sql, GetData.strConn);
DataSet ds = new DataSet();
ad.Fill(ds, pagelist.PageSize * (pagelist.CurrentPageIndex - 1), pagelist.PageSize, "temp");
rep_parent.DataSource = ds.Tables["temp"];
rep_parent.DataBind();
lblerr.InnerHtml = ReturnError(mysql);
lblok.InnerHtml = ReturnAccess(mysql);
lblcount.InnerHtml = ReturnCount(mysql);
}
protected void PageChanging(object src, PageChangingEventArgs e)
{
pagelist.CurrentPageIndex = e.NewPageIndex;
DataBindlist();
}
private string ReturnAccess(string _sql)
{
string sql = "select count(1) from [Table_Reports] where username='" + _username + "' and retValue='成功'"+_sql;
DataSet ds = GetData.GetDataFromDB(sql);
return ds.Tables[0].Rows[0][0].ToString();
}
private string ReturnError(string _sql)
{
string sql = "select count(1) from [Table_Reports] where username='" + _username + "' and retValue='失败'" + _sql;
DataSet ds = GetData.GetDataFromDB(sql);
return ds.Tables[0].Rows[0][0].ToString();
}
private string ReturnCount(string _sql)
{
string sql = "select count(1) from [Table_Reports] where username='" + _username + "'" + _sql;
DataSet ds = GetData.GetDataFromDB(sql);
return ds.Tables[0].Rows[0][0].ToString();
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。