using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using BLL;
using System.Linq;
namespace FineUIPro.Web.HJGL.CheckManage
{
public partial class PassFileOneQueStatistic : PageBase
{
#region 加载页面
///
/// 加载页面
///
///
///
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
//this.BindGrid();
}
}
#endregion
#region 数据绑定
///
/// 数据绑定
///
private void BindGrid()
{
List listStr = new List();
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 页索引改变事件
///
/// 页索引改变事件
///
///
///
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
#endregion
#region 排序
///
/// 排序
///
///
///
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
BindGrid();
}
#endregion
#region 分页选择下拉改变事件
///
/// 分页选择下拉改变事件
///
///
///
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
#endregion
#endregion
#region 查询
///
/// 查询
///
///
///
protected void BtnAnalyse_Click(object sender, EventArgs e)
{
this.BindGrid();
}
#endregion
#region 打印
///
/// 打印
///
///
///
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
}
}