96 lines
2.9 KiB
C#
96 lines
2.9 KiB
C#
|
|
using BLL;
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Data;
|
|||
|
|
using System.Data.SqlClient;
|
|||
|
|
|
|||
|
|
namespace FineUIPro.Web.HJGL.WeldingReport
|
|||
|
|
{
|
|||
|
|
public partial class PipePrefabricationRateStatistics : PageBase
|
|||
|
|
{
|
|||
|
|
protected void Page_Load(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (!IsPostBack)
|
|||
|
|
{
|
|||
|
|
this.InitTreeMenu();//加载树
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
this.InitTreeMenu();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#region 加载树装置-单位-工作区
|
|||
|
|
/// <summary>
|
|||
|
|
/// 加载树
|
|||
|
|
/// </summary>
|
|||
|
|
private void InitTreeMenu()
|
|||
|
|
{
|
|||
|
|
this.tvControlItem.Nodes.Clear();
|
|||
|
|
|
|||
|
|
TreeNode rootNode1 = new TreeNode();
|
|||
|
|
rootNode1.NodeID = "1";
|
|||
|
|
rootNode1.Text = "建筑工程";
|
|||
|
|
rootNode1.CommandName = "建筑工程";
|
|||
|
|
rootNode1.EnableClickEvent = true;
|
|||
|
|
this.tvControlItem.Nodes.Add(rootNode1);
|
|||
|
|
|
|||
|
|
TreeNode rootNode2 = new TreeNode();
|
|||
|
|
rootNode2.NodeID = "2";
|
|||
|
|
rootNode2.Text = "安装工程";
|
|||
|
|
rootNode2.CommandName = "安装工程";
|
|||
|
|
rootNode2.EnableClickEvent = true;
|
|||
|
|
this.tvControlItem.Nodes.Add(rootNode2);
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region 点击TreeView
|
|||
|
|
/// <summary>
|
|||
|
|
/// 点击TreeView
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
|
|||
|
|
{
|
|||
|
|
this.BindGrid();
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
private void BindGrid()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
|||
|
|
|
|||
|
|
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
|||
|
|
listStr.Add(new SqlParameter("@Flag", this.rdType.SelectedValue));
|
|||
|
|
listStr.Add(new SqlParameter("@ProjectType", this.tvControlItem.SelectedNodeID));
|
|||
|
|
|
|||
|
|
SqlParameter[] parameter = listStr.ToArray();
|
|||
|
|
DataTable tb = SQLHelper.GetDataTableRunProc("Sp_HJGL_PreRateStatistic", parameter);
|
|||
|
|
this.Grid1.RecordCount = tb.Rows.Count;
|
|||
|
|
var table = this.GetPagedDataTable(Grid1, tb);
|
|||
|
|
Grid1.DataSource = table;
|
|||
|
|
Grid1.DataBind();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void rdType_SelectedIndexChanged(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
BindGrid();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#region 排序
|
|||
|
|
/// <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;
|
|||
|
|
BindGrid();
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
}
|
|||
|
|
}
|