SGGL_JT/SUBQHSE/FineUIPro.Web/ThreeYearAction/Gateway/News.aspx.cs

47 lines
1.4 KiB
C#

using BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.ThreeYearAction.Gateway
{
public partial class News : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
BindGrid();
}
private void BindGrid()
{
var returnData = ServerService.GetNewsList();
if (returnData != null)
{
Grid1.RecordCount = returnData.Count;
Grid1.DataSource = returnData;
Grid1.DataBind();
}
for (int i = 0; i < Grid1.Rows.Count; i++)
{
System.Web.UI.WebControls.LinkButton lbtnUrl = ((System.Web.UI.WebControls.LinkButton)(this.Grid1.Rows[i].FindControl("lbtnUrl1")));
string url = lbtnUrl.CommandArgument.ToString();
if (!string.IsNullOrEmpty(url))
{
url = url.Replace('\\', '/');
lbtnUrl.Text = BLL.UploadAttachmentService.ShowAttachment(Funs.CNCECPath, url);
}
}
}
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
}
}