49 lines
1.6 KiB
C#
49 lines
1.6 KiB
C#
using BLL;
|
|
using Newtonsoft.Json;
|
|
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 RulesRegulations : PageBase
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
BindGrid();
|
|
}
|
|
|
|
private void BindGrid()
|
|
{
|
|
var returnData = ServerService.GerDataFromCncec("/api/Data/GetLaw_RulesRegulationsToSUB", null, null);
|
|
if (returnData != null && returnData.code ==1)
|
|
{
|
|
var data = JsonConvert.DeserializeObject<List<Model.Law_RulesRegulationsItems>>(returnData.data.ToString());
|
|
Grid1.RecordCount = data.Count;
|
|
Grid1.DataSource = data;
|
|
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();
|
|
}
|
|
}
|
|
} |