ZHJA_HJGL/HJGL_ZH/FineUIPro.Web/HJGL/CheckManage/PassFileOneQueStatistic.asp...

143 lines
4.4 KiB
C#
Raw Normal View History

2024-05-08 17:17:11 +08:00
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using BLL;
2024-10-17 14:50:41 +08:00
using System.Linq;
2024-05-08 17:17:11 +08:00
namespace FineUIPro.Web.HJGL.CheckManage
{
public partial class PassFileOneQueStatistic : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
//this.BindGrid();
}
}
#endregion
#region
/// <summary>
/// 数据绑定
/// </summary>
private void BindGrid()
{
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim()))
{
listStr.Add(new SqlParameter("@startDate", Funs.GetNewDateTime(this.txtStartDate.Text.Trim())));
}
if (!string.IsNullOrEmpty(this.txtEndDate.Text.Trim()))
{
listStr.Add(new SqlParameter("@endDate", Funs.GetNewDateTime(this.txtEndDate.Text.Trim())));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunProc("HJGL_spPassFileOneQue", parameter);
this.Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region
#region
/// <summary>
/// 页索引改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <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();
}
#endregion
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnAnalyse_Click(object sender, EventArgs e)
{
this.BindGrid();
}
#endregion
#region
/// <summary>
/// 打印
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnPrint_Click(object sender, EventArgs e)
{
string startDate = string.Empty;
string endDate = string.Empty;
string parameter = string.Empty;
string varValue = string.Empty;
if (!string.IsNullOrEmpty(this.txtStartDate.Text))
{
startDate = string.Format("{0:yyyy-MM-dd}", this.txtStartDate.Text.Trim());
}
else
{
startDate = "NULL";
}
if (!string.IsNullOrEmpty(this.txtEndDate.Text))
{
endDate = string.Format("{0:yyyy-MM-dd}", this.txtEndDate.Text.Trim());
}
else
{
endDate = "NULL";
}
parameter = startDate + "|" + endDate;
varValue = startDate + "至" + endDate;
varValue = Microsoft.JScript.GlobalObject.escape(varValue.Replace("/", ","));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../../Common/ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId=0", Const.HJGL_PassFileOneQueReportId, parameter, varValue)));
}
#endregion
}
}