diff --git a/SGGL/FineUIPro.Web/Controls/ProjectWBSControl.ascx.designer.cs b/SGGL/FineUIPro.Web/Controls/ProjectWBSControl.ascx.designer.cs index a1fe0dab..479cd5a0 100644 --- a/SGGL/FineUIPro.Web/Controls/ProjectWBSControl.ascx.designer.cs +++ b/SGGL/FineUIPro.Web/Controls/ProjectWBSControl.ascx.designer.cs @@ -23,6 +23,24 @@ namespace FineUIPro.Web.Controls /// protected global::FineUIPro.Panel Panel2; + /// + /// drpWBS 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWBS; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + /// /// Toolbar1 控件。 /// diff --git a/SGGL/FineUIPro.Web/DigData/ProjectWBSDW.aspx b/SGGL/FineUIPro.Web/DigData/ProjectWBSDW.aspx index f1ea5a14..bdddf9f7 100644 --- a/SGGL/FineUIPro.Web/DigData/ProjectWBSDW.aspx +++ b/SGGL/FineUIPro.Web/DigData/ProjectWBSDW.aspx @@ -25,11 +25,11 @@ + TitleToolTip="WBS数据仓库" AutoScroll="true"> - @@ -37,46 +37,52 @@ + + - + - + - + + + diff --git a/SGGL/FineUIPro.Web/DigData/ShowProjectWBS.aspx.cs b/SGGL/FineUIPro.Web/DigData/ShowProjectWBS.aspx.cs new file mode 100644 index 00000000..5505c902 --- /dev/null +++ b/SGGL/FineUIPro.Web/DigData/ShowProjectWBS.aspx.cs @@ -0,0 +1,175 @@ +using BLL; +using System; +using System.Data; +using System.Linq; + +namespace FineUIPro.Web.DigData +{ + public partial class ShowProjectWBS : PageBase + { + /// + /// 主键 + /// + public string WorkPackageId + { + get + { + return (string)ViewState["WorkPackageId"]; + } + set + { + ViewState["WorkPackageId"] = value; + } + } + + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { ////加载树 + SetSubUnitProjectTree(this.trWBS); + } + } + + #region 绑定分公司 单位-项目树 + /// + /// 绑定分公司 单位-项目树 + /// + /// + /// + public void SetSubUnitProjectTree(FineUIPro.Tree trWBS) + { + 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 = "1"; + rootNode1.CommandName = "ProjectType"; + rootNode1.EnableExpandEvent = true; + rootNode1.EnableClickEvent = true; + this.trWBS.Nodes.Add(rootNode1); + TreeNode emptyNode = new TreeNode(); + emptyNode.Text = ""; + emptyNode.NodeID = ""; + rootNode1.Nodes.Add(emptyNode); + //this.GetNodes(rootNode1.Nodes, rootNode1.NodeID); + + TreeNode rootNode2 = new TreeNode(); + rootNode2.Text = "安装工程"; + rootNode2.NodeID = "2"; + rootNode2.CommandName = "ProjectType"; + rootNode2.EnableExpandEvent = true; + rootNode2.EnableClickEvent = true; + this.trWBS.Nodes.Add(rootNode2); + rootNode2.Nodes.Add(emptyNode); + } + #endregion + + #region 展开树 + /// + /// 展开树 + /// + /// + /// + protected void trWBS_NodeExpand(object sender, TreeNodeEventArgs e) + { + + e.Node.Nodes.Clear(); + if (e.Node.CommandName == "ProjectType") //展开工程类型 + { + var trUnitWork = from x in Funs.DB.WBS_UnitWork + where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null && x.ProjectType == e.Node.NodeID + select x; + trUnitWork = trUnitWork.OrderBy(x => x.UnitWorkCode); + if (trUnitWork.Count() > 0) + { + foreach (var trUnitWorkItem in trUnitWork) + { + TreeNode newNode = new TreeNode(); + newNode.Text = trUnitWorkItem.UnitWorkCode + "-" + trUnitWorkItem.UnitWorkName; + newNode.NodeID = trUnitWorkItem.UnitWorkId; + newNode.CommandName = "UnitWork"; + newNode.EnableExpandEvent = true; + newNode.EnableClickEvent = true; + e.Node.Nodes.Add(newNode); + if (BLL.WorkPackageService.GetWorkPackages1ByUnitWorkId(trUnitWorkItem.UnitWorkId.ToString()) != null) + { + TreeNode temp = new TreeNode(); + temp.Text = "temp"; + temp.NodeID = "temp"; + newNode.Nodes.Add(temp); + } + } + } + } + else if (e.Node.CommandName == "UnitWork") //展开单位工程节点 + { + var workPackages = from x in Funs.DB.WBS_WorkPackage where x.UnitWorkId == e.NodeID && x.SuperWorkPack == null && x.IsApprove == true orderby x.WorkPackageCode select x; + foreach (var workPackage in workPackages) + { + TreeNode newNode = new TreeNode(); + newNode.Text = workPackage.PackageContent; + newNode.NodeID = workPackage.WorkPackageId; + newNode.CommandName = "WorkPackage"; + newNode.EnableExpandEvent = true; + newNode.EnableClickEvent = true; + e.Node.Nodes.Add(newNode); + var childWorkPackages = from x in Funs.DB.WBS_WorkPackage where x.SuperWorkPackageId == workPackage.WorkPackageId && x.IsApprove == true select x; + if (childWorkPackages.Count() > 0) + { + TreeNode emptyNode = new TreeNode(); + emptyNode.Text = ""; + emptyNode.NodeID = ""; + newNode.Nodes.Add(emptyNode); + } + } + } + else if (e.Node.CommandName == "WorkPackage") //展开工作包节点 + { + var workPackages = from x in Funs.DB.WBS_WorkPackage where x.SuperWorkPackageId == e.Node.NodeID && x.IsApprove == true orderby x.WorkPackageCode select x; + if (workPackages.Count() > 0) //存在子单位工程 + { + foreach (var workPackage in workPackages) + { + TreeNode newNode = new TreeNode(); + newNode.Text = workPackage.PackageContent; + newNode.NodeID = workPackage.WorkPackageId; + newNode.CommandName = "WorkPackage"; + newNode.EnableExpandEvent = true; + newNode.EnableClickEvent = true; + e.Node.Nodes.Add(newNode); + var childWorkPackages = from x in Funs.DB.WBS_WorkPackage where x.SuperWorkPackageId == workPackage.WorkPackageId && x.IsApprove == true select x; + if (childWorkPackages.Count() > 0) + { + TreeNode emptyNode = new TreeNode(); + emptyNode.Text = ""; + emptyNode.NodeID = ""; + newNode.Nodes.Add(emptyNode); + } + } + } + } + } + #endregion + + protected void ckState_SelectedIndexChanged(object sender, EventArgs e) + { + ////加载树 + SetSubUnitProjectTree(this.trWBS); + } + + protected void btnSure_Click(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/DigData/ShowProjectWBS.aspx.designer.cs b/SGGL/FineUIPro.Web/DigData/ShowProjectWBS.aspx.designer.cs new file mode 100644 index 00000000..c5e1e3ab --- /dev/null +++ b/SGGL/FineUIPro.Web/DigData/ShowProjectWBS.aspx.designer.cs @@ -0,0 +1,80 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.DigData +{ + + + public partial class ShowProjectWBS + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ckState 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList ckState; + + /// + /// btnSure 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSure; + + /// + /// trWBS 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree trWBS; + } +} diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index 8b137891..e69de29b 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -1 +0,0 @@ - diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index a5cc182a..789c9fc7 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -523,6 +523,7 @@ + @@ -7595,6 +7596,13 @@ WorkingHoursItem.aspx + + ShowProjectWBS.aspx + ASPXCodeBehind + + + ShowProjectWBS.aspx + ProjectWBSDW.aspx ASPXCodeBehind