提交代码
This commit is contained in:
parent
a3e06cfc69
commit
e4e4468b46
|
@ -10,11 +10,25 @@
|
|||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<f:Panel ID="Panel1" CssClass="blockpanel" Margin="5px" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="工程量基础表" EnableCollapse="true" DataParentIDField="SupId" ExpandAllTreeNodes="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="BaseId" AllowCellEditing="true" EnableColumnLines="true" TreeColumn="Name" EnableTree="true"
|
||||
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true" EnableCollapse="true" Layout="Fit"
|
||||
RegionPercent="20%" Title="工程量基础表" TitleToolTip="工程量基础表" ShowBorder="true" ShowHeader="true"
|
||||
BodyPadding="10px">
|
||||
<Items>
|
||||
<f:Tree ID="trWBS" EnableCollapse="true" ShowHeader="true"
|
||||
OnNodeCommand="trWBS_NodeCommand" AutoLeafIdentification="true"
|
||||
runat="server">
|
||||
</f:Tree>
|
||||
<f:HiddenField runat="server" ID="hdSelectId">
|
||||
</f:HiddenField>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" Layout="Fit"
|
||||
Title="中间面板" ShowBorder="true" ShowHeader="false" BodyPadding="10px">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="工程量基础表" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="BaseId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="BaseId" AllowSorting="true" SortField="DrawingNo,Part,ProjectContent" ForceFit="true"
|
||||
SortDirection="DESC" OnSort="Grid1_Sort"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
|
@ -42,21 +56,18 @@
|
|||
<asp:Label ID="lblPageIndex" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField ColumnID="Name" DataField="Name" FieldType="String" HeaderText="层级" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="420px">
|
||||
</f:RenderField>
|
||||
<%--<f:RenderField ColumnID="WorkSection" DataField="WorkSection" FieldType="String" HeaderText="工段" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="120px">
|
||||
</f:RenderField>--%>
|
||||
<f:RenderField ColumnID="DrawingNo" DataField="DrawingNo" FieldType="String" HeaderText="图号" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="250px">
|
||||
</f:RenderField>
|
||||
<%--<f:RenderField ColumnID="DrawingName" DataField="DrawingName" FieldType="String" HeaderText="图纸名称" TextAlign="Center"
|
||||
<f:RenderField ColumnID="DrawingName" DataField="DrawingName" FieldType="String" HeaderText="图纸名称" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="200px">
|
||||
</f:RenderField>--%>
|
||||
<%--<f:RenderField ColumnID="Part" DataField="Part" FieldType="String" HeaderText="部位" TextAlign="Center"
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="Part" DataField="Part" FieldType="String" HeaderText="部位" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="120px">
|
||||
</f:RenderField>--%>
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="ProjectContent" DataField="ProjectContent" FieldType="String" HeaderText="项目内容" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="120px">
|
||||
</f:RenderField>
|
||||
|
@ -97,6 +108,8 @@
|
|||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="工程量基础表" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
|
|
|
@ -20,45 +20,117 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
|||
if (!IsPostBack)
|
||||
{
|
||||
GetButtonPower();
|
||||
DataTable table = BLL.BaseService.GetAllTreeDataTable(this.CurrUser.LoginProjectId);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
//BindGrid();
|
||||
InitTreeMenu();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载树
|
||||
/// <summary>
|
||||
/// 加载树
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
this.trWBS.Nodes.Clear();
|
||||
this.trWBS.ShowBorder = false;
|
||||
this.trWBS.ShowHeader = false;
|
||||
this.trWBS.EnableIcons = true;
|
||||
this.trWBS.AutoScroll = true;
|
||||
this.trWBS.EnableSingleClickExpand = true;
|
||||
|
||||
TreeNode rootNode1 = new TreeNode();
|
||||
rootNode1.Text = "工程量基础表";
|
||||
rootNode1.NodeID = "0";
|
||||
rootNode1.CommandName = "Node";
|
||||
//rootNode1.EnableExpandEvent = true;
|
||||
rootNode1.EnableClickEvent = true;
|
||||
this.trWBS.Nodes.Add(rootNode1);
|
||||
this.GetNodes(rootNode1.Nodes, rootNode1.NodeID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 遍历节点方法
|
||||
/// </summary>
|
||||
/// <param name="nodes">节点集合</param>
|
||||
/// <param name="parentId">父节点</param>
|
||||
private void GetNodes(TreeNodeCollection nodes, string parentId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
if (parentId == "0") //工程量基础表节点
|
||||
{
|
||||
var cNProfessionals = from x in db.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId orderby x.SortIndex select x;
|
||||
var bases = from x in db.View_QuantityManagement_Base where x.ProjectId == this.CurrUser.LoginProjectId select x;
|
||||
foreach (var q in cNProfessionals)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = q.ProfessionalName;
|
||||
newNode.NodeID = q.CNProfessionalId;
|
||||
newNode.CommandName = "CNProfessional";
|
||||
newNode.EnableClickEvent = true;
|
||||
nodes.Add(newNode);
|
||||
var workSections = bases.Where(x => x.Major == q.ProfessionalName).Select(x => x.WorkSection).Distinct().ToList();
|
||||
foreach (var workSection in workSections)
|
||||
{
|
||||
TreeNode newNode2 = new TreeNode();
|
||||
newNode2.Text = workSection;
|
||||
newNode2.NodeID = workSection;
|
||||
newNode2.CommandName = "WorkSection";
|
||||
newNode2.EnableClickEvent = true;
|
||||
newNode.Nodes.Add(newNode2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Tree点击事件
|
||||
/// <summary>
|
||||
/// Tree点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void trWBS_NodeCommand(object sender, TreeCommandEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 数据绑定
|
||||
/// </summary>
|
||||
public void BindGrid()
|
||||
{
|
||||
string strSql = @"select * from View_QuantityManagement_Base C
|
||||
where C.ProjectId = @ProjectId";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
if (!string.IsNullOrEmpty(this.txtDrawingNo.Text.Trim()))
|
||||
if (this.trWBS.SelectedNode.CommandName == "WorkSection")
|
||||
{
|
||||
strSql += " AND DrawingNo like @DrawingNo";
|
||||
listStr.Add(new SqlParameter("@DrawingNo", "%" + this.txtDrawingNo.Text.Trim() + "%"));
|
||||
string strSql = @"select * from View_QuantityManagement_Base C
|
||||
where C.ProjectId = @ProjectId and C.WorkSection=@WorkSection";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@WorkSection", this.trWBS.SelectedNodeID));
|
||||
if (!string.IsNullOrEmpty(this.txtDrawingNo.Text.Trim()))
|
||||
{
|
||||
strSql += " AND DrawingNo like @DrawingNo";
|
||||
listStr.Add(new SqlParameter("@DrawingNo", "%" + this.txtDrawingNo.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtPart.Text.Trim()))
|
||||
{
|
||||
strSql += " AND Part like @Part";
|
||||
listStr.Add(new SqlParameter("@Part", "%" + this.txtPart.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtProjectContent.Text.Trim()))
|
||||
{
|
||||
strSql += " AND ProjectContent like @ProjectContent";
|
||||
listStr.Add(new SqlParameter("@ProjectContent", "%" + this.txtProjectContent.Text.Trim() + "%"));
|
||||
}
|
||||
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();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtPart.Text.Trim()))
|
||||
{
|
||||
strSql += " AND Part like @Part";
|
||||
listStr.Add(new SqlParameter("@Part", "%" + this.txtPart.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtProjectContent.Text.Trim()))
|
||||
{
|
||||
strSql += " AND ProjectContent like @ProjectContent";
|
||||
listStr.Add(new SqlParameter("@ProjectContent", "%" + this.txtProjectContent.Text.Trim() + "%"));
|
||||
}
|
||||
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();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 分页、排序
|
||||
/// <summary>
|
||||
|
|
|
@ -39,6 +39,42 @@ namespace FineUIPro.Web.CQMS.QuantityManagement {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// panelLeftRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelLeftRegion;
|
||||
|
||||
/// <summary>
|
||||
/// trWBS 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tree trWBS;
|
||||
|
||||
/// <summary>
|
||||
/// hdSelectId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdSelectId;
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -19719,7 +19719,7 @@
|
|||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
|
Loading…
Reference in New Issue