using BLL; using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; namespace FineUIPro.Web.HJGL.TestPackageManage { public partial class ShowJointInfoView : PageBase { #region 加载 /// /// 加载页面 /// /// /// protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); // 绑定表格 this.BindGrid(); } } #endregion #region 绑定数据 /// /// 绑定数据 /// private void BindGrid() { string strSql = @"SELECT joint.JOT_ID, joint.ProjectId, joint.ISO_ID, joint.JOT_JointNo, joint.Is_hj, joint.JointStatusName, joint.JOT_TrustFlagName, joint.JOT_CheckFlagName, joint.JOT_JointAttribute, joint.JOT_WeldDate, joint.WED_Name1, joint.WED_Name2" + @" FROM View_JointInfo AS joint WHERE joint.ProjectId = @projectId AND joint.ISO_ID=@isoId "; List listStr = new List(); listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId)); listStr.Add(new SqlParameter("@isoId", Request.Params["ISO_ID"])); SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); Grid1.RecordCount = tb.Rows.Count; var table = this.GetPagedDataTable(Grid1, tb); Grid1.DataSource = table; Grid1.DataBind(); } /// /// 改变索引事件 /// /// /// protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) { BindGrid(); } /// /// 分页下拉选择事件 /// /// /// protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) { Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); BindGrid(); } /// /// 排序 /// /// /// protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) { BindGrid(); } #endregion } }