62,046
社区成员
发帖
与我相关
我的任务
分享
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
foreach (RepeaterItem ite in Repeater1.Items)
{
Label lbtjr = ite.FindControl("tjr") as Label;
Label lbtjsj = ite.FindControl("tjsj") as Label;
LinkButton lbbj = ite.FindControl("bj") as LinkButton;
LinkButton lbsc = ite.FindControl("sc") as LinkButton;
if (lbtjr.Text != Session["user"].ToString() || Math.Abs((DateTime.Now - Convert.ToDateTime(lbtjsj.Text)).TotalHours) > 24)
{
lbbj.Enabled = false;
lbsc.Enabled = false;
}
}
private PagedDataSource pds()
{
string connstring = ConfigurationManager.ConnectionStrings["WHConn"].ConnectionString;
SqlConnection con = new SqlConnection(connstring);
DataSet ds = new DataSet();
SqlDataAdapter sda = new SqlDataAdapter("select * from gzhz order by 时间1 desc", con);
sda.Fill(ds, "gz");
PagedDataSource pds = new PagedDataSource();
pds.DataSource = ds.Tables["gz"].DefaultView;
pds.AllowPaging = true;
pds.PageSize = 15;
pds.CurrentPageIndex = Convert.ToInt32(Request.QueryString["page"]);
return pds;
}