SGGL_SGY/SUBQHSE/FineUIPro.Web/HSSE/Manager/ProjectPersonStatistics.asp...

122 lines
3.7 KiB
C#
Raw Normal View History

2025-02-19 15:58:42 +08:00
using BLL;
using System;
2025-05-08 14:26:36 +08:00
using System.Linq;
using System.Text;
using AspNet = System.Web.UI.WebControls;
2025-02-19 15:58:42 +08:00
2025-05-08 14:26:36 +08:00
namespace FineUIPro.Web.HSSE.Manager
2025-02-19 15:58:42 +08:00
{
2025-05-08 14:26:36 +08:00
public partial class ProjectPersonStatistics : PageBase
2025-02-19 15:58:42 +08:00
{
2025-05-08 14:26:36 +08:00
#region
2025-02-19 15:58:42 +08:00
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
2025-05-08 14:26:36 +08:00
// 表头过滤
//FilterDataRowItem = FilterDataRowItemImplement;
2025-02-19 15:58:42 +08:00
if (!IsPostBack)
{
2025-05-08 14:26:36 +08:00
////权限按钮方法
2025-02-19 15:58:42 +08:00
Funs.DropDownPageSize(this.ddlPageSize);
2025-05-08 14:26:36 +08:00
this.txtUnit.Text = ProjectService.getUnitNameByProjectId(this.CurrUser.LoginProjectId);
2025-02-19 15:58:42 +08:00
// 绑定表格
2025-05-08 14:26:36 +08:00
BindGrid();
2025-02-19 15:58:42 +08:00
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
2025-05-08 14:26:36 +08:00
var getData = ProjectPersonStatisticsService.getListData(this.CurrUser.LoginProjectId,null, Grid1);
Grid1.RecordCount = ProjectPersonStatisticsService.count;
Grid1.DataSource = getData;
2025-02-19 15:58:42 +08:00
Grid1.DataBind();
2025-05-08 14:26:36 +08:00
2025-02-19 15:58:42 +08:00
}
2025-05-08 14:26:36 +08:00
#endregion
2025-02-19 15:58:42 +08:00
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
this.BindGrid();
}
#endregion
2025-05-08 14:26:36 +08:00
#region
2025-02-19 15:58:42 +08:00
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
2025-05-08 14:26:36 +08:00
Grid1.PageIndex = e.NewPageIndex;
BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
2025-02-19 15:58:42 +08:00
BindGrid();
}
/// <summary>
/// 分页显示条数下拉框
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
/// <summary>
2025-05-08 14:26:36 +08:00
/// 关闭弹出窗
2025-02-19 15:58:42 +08:00
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
2025-05-08 14:26:36 +08:00
protected void Window1_Close(object sender, WindowCloseEventArgs e)
2025-02-19 15:58:42 +08:00
{
BindGrid();
}
#endregion
2025-05-08 14:26:36 +08:00
2025-02-19 15:58:42 +08:00
#region
2025-05-08 14:26:36 +08:00
/// 导出按钮
2025-02-19 15:58:42 +08:00
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
2025-05-08 14:26:36 +08:00
protected void btnOut_Click(object sender, EventArgs e)
2025-02-19 15:58:42 +08:00
{
Response.ClearContent();
string filename = Funs.GetNewFileName();
2025-05-08 14:26:36 +08:00
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("专职安全管理人员信息统计表" + filename, System.Text.Encoding.UTF8) + ".xls");
2025-02-19 15:58:42 +08:00
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
2025-05-08 14:26:36 +08:00
this.Grid1.PageSize = this.Grid1.RecordCount;
this.BindGrid();
2025-02-19 15:58:42 +08:00
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}
2025-05-08 14:26:36 +08:00
2025-02-19 15:58:42 +08:00
#endregion
}
}