This commit is contained in:
gaofei
2021-08-13 11:15:59 +08:00
parent 43acc57060
commit d8dff88c39
320 changed files with 37219 additions and 4678 deletions
+250 -450
View File
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
namespace FineUIPro.Web.JDGL.WBS
@@ -53,10 +54,12 @@ namespace FineUIPro.Web.JDGL.WBS
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuEdit.Hidden = false;
this.btnMenuModify.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDelete.Hidden = false;
this.btnMenuDel.Hidden = false;
}
}
}
@@ -104,7 +107,7 @@ namespace FineUIPro.Web.JDGL.WBS
e.Node.Nodes.Clear();
if (e.Node.CommandName == "cnProfession") //展开专业节点
{
var unitProjects = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Convert.ToInt32(e.Node.NodeID) && x.SuperUnitProject == null orderby x.UnitProjectCode select x;
var unitProjects = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Convert.ToInt32(e.Node.NodeID) && x.SuperUnitProject == null orderby x.SortIndex select x;
foreach (var unitProject in unitProjects)
{
TreeNode newNode = new TreeNode();
@@ -122,15 +125,15 @@ namespace FineUIPro.Web.JDGL.WBS
}
else if (e.Node.CommandName == "unitProject") //展开单位工程节点
{
var childUnitProjects = from x in Funs.DB.Wbs_UnitProjectInit where x.SuperUnitProject == e.Node.NodeID orderby x.UnitProjectCode select x;
if (childUnitProjects.Count() > 0) //存在子单位工程
var wbsSet1s = from x in Funs.DB.WBS_WbsSetInit where x.UnitProjectCode == e.Node.NodeID && x.SuperWbsSetCode == null orderby x.WbsSetCode select x;
if (wbsSet1s.Count() > 0)
{
foreach (var childUnitProject in childUnitProjects)
foreach (var wbsSet1 in wbsSet1s)
{
TreeNode newNode = new TreeNode();
newNode.Text = childUnitProject.UnitProjectName;
newNode.NodeID = childUnitProject.UnitProjectCode;
newNode.CommandName = "childUnitProject";
newNode.Text = wbsSet1.WbsSetName;
newNode.NodeID = wbsSet1.WbsSetCode;
newNode.CommandName = "wbsSet";
newNode.EnableExpandEvent = true;
newNode.EnableClickEvent = true;
e.Node.Nodes.Add(newNode);
@@ -140,91 +143,6 @@ namespace FineUIPro.Web.JDGL.WBS
newNode.Nodes.Add(emptyNode);
}
}
else //不存在子单位工程,加载分部工程
{
var wbsSet1s = from x in Funs.DB.WBS_WbsSetInit where x.Flag == 1 && x.UnitProjectCode == e.Node.NodeID orderby x.WbsSetCode select x;
if (wbsSet1s.Count() > 0)
{
foreach (var wbsSet1 in wbsSet1s)
{
TreeNode newNode = new TreeNode();
newNode.Text = wbsSet1.WbsSetName;
newNode.NodeID = wbsSet1.WbsSetCode;
newNode.CommandName = "wbsSet";
newNode.EnableExpandEvent = true;
newNode.EnableClickEvent = true;
e.Node.Nodes.Add(newNode);
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newNode.Nodes.Add(emptyNode);
}
}
else
{
var wbsSet3s = from x in Funs.DB.WBS_WbsSetInit where x.Flag == 3 && x.UnitProjectCode == e.Node.NodeID orderby x.WbsSetCode select x;
if (wbsSet3s.Count() > 0)
{
foreach (var wbsSet3 in wbsSet3s)
{
TreeNode newNode = new TreeNode();
newNode.Text = wbsSet3.WbsSetName;
newNode.NodeID = wbsSet3.WbsSetCode;
newNode.CommandName = "wbsSet";
newNode.EnableExpandEvent = true;
newNode.EnableClickEvent = true;
e.Node.Nodes.Add(newNode);
var childWbsSets = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(wbsSet3.WbsSetCode);
if (childWbsSets.Count() > 0)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newNode.Nodes.Add(emptyNode);
}
}
}
else
{
var wbsSet4s = from x in Funs.DB.WBS_WbsSetInit where x.Flag == 4 && x.UnitProjectCode == e.Node.NodeID orderby x.WbsSetCode select x;
if (wbsSet4s.Count() > 0)
{
foreach (var wbsSet4 in wbsSet4s)
{
TreeNode newNode = new TreeNode();
newNode.Text = wbsSet4.WbsSetName;
newNode.NodeID = wbsSet4.WbsSetCode;
newNode.CommandName = "wbsSet";
newNode.EnableExpandEvent = true;
newNode.EnableClickEvent = true;
e.Node.Nodes.Add(newNode);
}
}
}
}
}
}
else if (e.Node.CommandName == "childUnitProject") //展开子单位工程节点
{
var wbsSet1s = from x in Funs.DB.WBS_WbsSetInit where x.Flag == 1 && x.UnitProjectCode == e.Node.NodeID orderby x.WbsSetCode select x;
foreach (var wbsSet1 in wbsSet1s)
{
TreeNode newNode = new TreeNode();
newNode.Text = wbsSet1.WbsSetName;
newNode.NodeID = wbsSet1.WbsSetCode;
newNode.CommandName = "wbsSet";
newNode.EnableExpandEvent = true;
newNode.EnableClickEvent = true;
e.Node.Nodes.Add(newNode);
var childWbsSets = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(wbsSet1.WbsSetCode);
if (childWbsSets.Count > 0)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newNode.Nodes.Add(emptyNode);
}
}
}
else if (e.Node.CommandName == "wbsSet") //展开分部/子分部/分项/子分项工程节点
{
@@ -259,10 +177,10 @@ namespace FineUIPro.Web.JDGL.WBS
/// <param name="e"></param>
protected void trWBS_NodeCommand(object sender, TreeCommandEventArgs e)
{
if (this.Grid1.Rows.Count > 0)
{
SaveData();
}
//if (this.Grid1.Rows.Count > 0)
//{
// SaveData();
//}
BindGrid();
}
#endregion
@@ -298,7 +216,7 @@ namespace FineUIPro.Web.JDGL.WBS
}
#endregion
#region
#region
/// <summary>
/// 关闭窗口
/// </summary>
@@ -306,24 +224,34 @@ namespace FineUIPro.Web.JDGL.WBS
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
ShowNotify("修改成功!", MessageBoxIcon.Success);
ShowNotify("保存成功!", MessageBoxIcon.Success);
getWBSSet();
}
#endregion
#region
/// <summary>
/// 拷贝关闭窗口
/// 关闭窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window2_Close(object sender, WindowCloseEventArgs e)
{
ShowNotify("增加成功!", MessageBoxIcon.Success);
ShowNotify("保存成功!", MessageBoxIcon.Success);
getWBSSet();
}
/// <summary>
/// 关闭窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window3_Close(object sender, WindowCloseEventArgs e)
{
ShowNotify("保存成功!", MessageBoxIcon.Success);
BindGrid();
}
#endregion
#region
@@ -364,6 +292,51 @@ namespace FineUIPro.Web.JDGL.WBS
}
}
/// <summary>
/// 增加费控项
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAdd_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(trWBS.SelectedNodeID))
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.WBSSetMenuId, BLL.Const.BtnAdd))
{
type = this.trWBS.SelectedNode.CommandName;
this.hdSelectId.Text = this.trWBS.SelectedNodeID;
Model.WBS_WbsSetInit wbsSet = BLL.WbsSetInitService.GetWbsSetInitByWbsSetCode(this.trWBS.SelectedNodeID);
if (wbsSet != null)
{
var list = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(this.trWBS.SelectedNodeID);
if (list.Count == 0)
{
operating = "add";
string openUrl = String.Format("CostControlInitEdit.aspx?operating=add&Id={0}", trWBS.SelectedNodeID, "增加 - ");
PageContext.RegisterStartupScript(Window3.GetShowReference(openUrl));
}
else
{
ShowNotify("请选择工作项节点进行增加!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify("请选择工作项节点进行增加!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
}
}
/// <summary>
/// 增加
/// </summary>
@@ -631,62 +604,25 @@ namespace FineUIPro.Web.JDGL.WBS
/// </summary>
private void BindGrid()
{
this.Grid1.Columns[2].Hidden = true;
this.Grid1.Columns[3].Hidden = true;
this.Grid1.Columns[4].Hidden = true;
List<Model.WBSSetInitItem> items = new List<Model.WBSSetInitItem>();
if (this.trWBS.SelectedNode != null)
var codeList = BLL.WbsSetMatchCostControlInitService.GetWbsSetMatchCostControlInits(this.trWBS.SelectedNodeID);
if (codeList.Count > 0) //存在费控对应关系项
{
if (this.trWBS.SelectedNode.CommandName == "cnProfession")
string codes = string.Empty;
foreach (var item in codeList)
{
Model.WBS_CnProfessionInit cnProfession = BLL.CnProfessionInitService.GetCnProfessionInitByCnProfessionId(this.trWBS.SelectedNode.NodeID);
Model.WBSSetInitItem item = new Model.WBSSetInitItem();
if (cnProfession != null)
{
item.Code = this.trWBS.SelectedNode.NodeID;
item.Name = cnProfession.CnProfessionName;
item.Type = "cnProfession";
items.Add(item);
}
codes += item.CostControlInitCode + ",";
}
else if (this.trWBS.SelectedNode.CommandName == "unitProject" || this.trWBS.SelectedNode.CommandName == "childUnitProject")
{
this.Grid1.Columns[4].Hidden = false;
Model.Wbs_UnitProjectInit unitProject = BLL.UnitProjectInitService.GetUnitProjectInitByUnitProjectCode(this.trWBS.SelectedNode.NodeID);
Model.WBSSetInitItem item = new Model.WBSSetInitItem();
if (unitProject != null)
{
item.Code = this.trWBS.SelectedNode.NodeID;
item.Name = unitProject.UnitProjectName;
item.Remark = unitProject.Remark;
item.Type = "unitProject";
items.Add(item);
}
}
else if (this.trWBS.SelectedNode.CommandName == "wbsSet")
{
this.Grid1.Columns[4].Hidden = false;
Model.WBS_WbsSetInit wbsSet = BLL.WbsSetInitService.GetWbsSetInitByWbsSetCode(this.trWBS.SelectedNode.NodeID);
var childWbsSets = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(this.trWBS.SelectedNode.NodeID);
if (childWbsSets.Count == 0)
{
this.Grid1.Columns[2].Hidden = false;
this.Grid1.Columns[3].Hidden = false;
}
Model.WBSSetInitItem item = new Model.WBSSetInitItem();
if (wbsSet != null)
{
item.Code = this.trWBS.SelectedNode.NodeID;
item.Name = wbsSet.WbsSetName;
item.Type = "wbsSet";
item.ControlPoint = wbsSet.ControlPoint;
item.ControlItemDef = wbsSet.ControlItemDef;
item.Remark = wbsSet.Remark;
items.Add(item);
}
}
this.Grid1.DataSource = items;
this.Grid1.DataBind();
string strSql = "SELECT * FROM WBS_CostControlInit where @CostControlInitCodes like '%'+CostControlInitCode+'%'";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@CostControlInitCodes", codes));
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
@@ -707,43 +643,18 @@ namespace FineUIPro.Web.JDGL.WBS
}
#endregion
#region Id定位到对应具体的专业
#region Id定位到对应具体的专业
/// <summary>
/// 根据所给Id定位到对应具体的专业、单位工程、子单位工程、分部、子分部、分项、子分项
/// 根据所给Id定位到对应具体的专业、单位工程、分部、子分部、分项、子分项
/// </summary>
private void getWBSSet()
{
string CnProfessionCode = string.Empty;
string UnitProjectCode = string.Empty;
string childUnitProjectCode = string.Empty;
string CnProfessionId = String.Empty;
string wbsSetParentCode1 = string.Empty;
string wbsSetParentCode2 = string.Empty;
string wbsSetParentCode3 = string.Empty;
//if (type.Equals("unitProject"))
//{
// this.hdSelectId.Text = node.ParentNode.NodeID;
// if (!operating.Equals("add"))
// {
// this.hdSelectId.Text = node.ParentNode.NodeID;
// }
//}
//else
//{
// if (type.Equals("cnProfession") && operating.Equals("add"))
// {
// this.hdSelectId.Text = node.NodeID;
// }
// else
// {
// this.hdSelectId.Text = node.ParentNode.NodeID;
// }
//}
Model.WBS_CnProfessionInit cnPro = BLL.CnProfessionInitService.GetCnProfessionInitByCnProfessionId(this.hdSelectId.Text);
Model.Wbs_UnitProjectInit UnitProject = BLL.UnitProjectInitService.GetUnitProjectInitByUnitProjectCode(this.hdSelectId.Text);
Model.WBS_WbsSetInit wbsSetParm = BLL.WbsSetInitService.GetWbsSetInitByWbsSetCode(this.hdSelectId.Text);
@@ -754,11 +665,6 @@ namespace FineUIPro.Web.JDGL.WBS
{
UnitProjectCode = UnitProject.UnitProjectCode;
}
else
{
childUnitProjectCode = UnitProject.UnitProjectCode;
UnitProjectCode = UnitProject.SuperUnitProject;
}
Model.WBS_CnProfessionInit cn = BLL.CnProfessionInitService.GetCnProfessionInitByCnProfessionId(UnitProject.CnProfessionId.ToString());
if (cn != null)
{
@@ -781,11 +687,6 @@ namespace FineUIPro.Web.JDGL.WBS
{
UnitProjectCode = unitpro.UnitProjectCode;
}
else
{
childUnitProjectCode = unitpro.UnitProjectCode;
UnitProjectCode = unitpro.SuperUnitProject;
}
if (!string.IsNullOrEmpty(wbsSetParm.SuperWbsSetCode))
{
wbsSetParentCode1 = wbsSetParm.SuperWbsSetCode;
@@ -858,7 +759,7 @@ namespace FineUIPro.Web.JDGL.WBS
if (cnProfession.CnProfessionId.ToString().Equals(CnProfessionCode))
{
newCnProfessionNode.Expanded = true;
var UnitProjects = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId.ToString() == CnProfessionCode && x.SuperUnitProject == null orderby x.UnitProjectCode select x;
var UnitProjects = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId.ToString() == CnProfessionCode && x.SuperUnitProject == null orderby x.SortIndex select x;
foreach (var unitProject in UnitProjects)
{
TreeNode newNodeUnitPorject = new TreeNode();
@@ -878,269 +779,126 @@ namespace FineUIPro.Web.JDGL.WBS
}
else
{
if (!string.IsNullOrEmpty(childUnitProjectCode))//存在子单位工程
if (wbsSetParm != null)
{
newNodeUnitPorject.Expanded = true;
var childUnitProjects = BLL.UnitProjectInitService.GetUnitProjectInitsBySuperUnitProject(newNodeUnitPorject.NodeID);
foreach (var childUnitProject in childUnitProjects)
{
TreeNode newChildUnitProjectNode = new TreeNode();
newChildUnitProjectNode.Text = childUnitProject.UnitProjectName;
newChildUnitProjectNode.NodeID = childUnitProject.UnitProjectCode;
newChildUnitProjectNode.CommandName = "childUnitProject";
newChildUnitProjectNode.ToolTip = childUnitProject.UnitProjectCode;
newChildUnitProjectNode.EnableExpandEvent = true;
newChildUnitProjectNode.EnableClickEvent = true;
newNodeUnitPorject.Nodes.Add(newChildUnitProjectNode);
if (wbsSetParm != null)
{
if (wbsSetParm.UnitProjectCode != childUnitProject.UnitProjectCode)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newChildUnitProjectNode.Nodes.Add(emptyNode);
}
else
{
newChildUnitProjectNode.Expanded = true;
var wbsSet1s = from x in Funs.DB.WBS_WbsSetInit where x.Flag == 1 && x.UnitProjectCode == wbsSetParm.UnitProjectCode orderby x.WbsSetCode select x;
foreach (var wbsSet1 in wbsSet1s)
{
TreeNode newwbsSet1Node = new TreeNode();
newwbsSet1Node.Text = wbsSet1.WbsSetName;
newwbsSet1Node.NodeID = wbsSet1.WbsSetCode;
newwbsSet1Node.CommandName = "wbsSet";
newwbsSet1Node.ToolTip = wbsSet1.WbsSetCode;
newwbsSet1Node.EnableExpandEvent = true;
newwbsSet1Node.EnableClickEvent = true;
newChildUnitProjectNode.Nodes.Add(newwbsSet1Node);
var childWbsSets2 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet1Node.NodeID);
if (childWbsSets2.Count() > 0)
{
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet1.WbsSetCode, wbsSetParm.WbsSetCode))
{
newwbsSet1Node.Expanded = true;
foreach (var wbsSet2 in childWbsSets2)
{
TreeNode newwbsSet2Node = new TreeNode();
newwbsSet2Node.Text = wbsSet2.WbsSetName;
newwbsSet2Node.NodeID = wbsSet2.WbsSetCode;
newwbsSet2Node.CommandName = "wbsSet";
newwbsSet2Node.ToolTip = wbsSet2.WbsSetCode;
newwbsSet2Node.EnableExpandEvent = true;
newwbsSet2Node.EnableClickEvent = true;
newwbsSet1Node.Nodes.Add(newwbsSet2Node);
var childWbsSets3 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet2Node.NodeID);
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet2.WbsSetCode, wbsSetParm.WbsSetCode))
{
newwbsSet2Node.Expanded = true;
if (childWbsSets3.Count() > 0)
{
foreach (var wbsSet3 in childWbsSets3)
{
TreeNode newwbsSet3Node = new TreeNode();
newwbsSet3Node.Text = wbsSet3.WbsSetName;
newwbsSet3Node.NodeID = wbsSet3.WbsSetCode;
newwbsSet3Node.CommandName = "wbsSet";
newwbsSet3Node.ToolTip = wbsSet3.WbsSetCode;
newwbsSet3Node.EnableExpandEvent = true;
newwbsSet3Node.EnableClickEvent = true;
newwbsSet2Node.Nodes.Add(newwbsSet3Node);
var childWbsSets4 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet3Node.NodeID);
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet3.WbsSetCode, wbsSetParm.WbsSetCode))
{
newwbsSet3Node.Expanded = true;
if (childWbsSets4.Count() > 0)
{
foreach (var wbsSet4 in childWbsSets4)
{
TreeNode newwbsSet4Node = new TreeNode();
newwbsSet4Node.Text = wbsSet4.WbsSetName;
newwbsSet4Node.NodeID = wbsSet4.WbsSetCode;
newwbsSet4Node.CommandName = "wbsSet";
newwbsSet4Node.ToolTip = wbsSet4.WbsSetCode;
newwbsSet4Node.EnableExpandEvent = true;
newwbsSet4Node.EnableClickEvent = true;
newwbsSet3Node.Nodes.Add(newwbsSet4Node);
}
}
}
else
{
if (childWbsSets4.Count() > 0)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newwbsSet3Node.Nodes.Add(emptyNode);
}
}
}
}
}
else
{
if (childWbsSets3.Count() > 0)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newwbsSet2Node.Nodes.Add(emptyNode);
}
}
}
}
else
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newwbsSet1Node.Nodes.Add(emptyNode);
}
}
}
}
}
else
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newChildUnitProjectNode.Nodes.Add(emptyNode);
}
}
}
else
{
#region
if (wbsSetParm != null)
{
if (wbsSetParm.UnitProjectCode != UnitProjectCode)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newNodeUnitPorject.Nodes.Add(emptyNode);
}
else
{
newNodeUnitPorject.Expanded = true;
var wbsSet1s = from x in Funs.DB.WBS_WbsSetInit where x.Flag == 1 && x.UnitProjectCode == UnitProjectCode orderby x.WbsSetCode select x;
foreach (var wbsSet1 in wbsSet1s)
{
TreeNode newwbsSet1Node = new TreeNode();
newwbsSet1Node.Text = wbsSet1.WbsSetName;
newwbsSet1Node.NodeID = wbsSet1.WbsSetCode;
newwbsSet1Node.CommandName = "wbsSet";
newwbsSet1Node.ToolTip = wbsSet1.WbsSetCode;
newwbsSet1Node.EnableExpandEvent = true;
newwbsSet1Node.EnableClickEvent = true;
newNodeUnitPorject.Nodes.Add(newwbsSet1Node);
var childWbsSets2 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet1Node.NodeID);
if (childWbsSets2.Count() > 0)
{
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet1.WbsSetCode, wbsSetParm.WbsSetCode))
{
foreach (var wbsSet2 in childWbsSets2)
{
if (wbsSet1.WbsSetCode == wbsSet2.SuperWbsSetCode)
{
newwbsSet1Node.Expanded = true;
}
TreeNode newwbsSet2Node = new TreeNode();
newwbsSet2Node.Text = wbsSet2.WbsSetName;
newwbsSet2Node.NodeID = wbsSet2.WbsSetCode;
newwbsSet2Node.CommandName = "wbsSet";
newwbsSet2Node.ToolTip = wbsSet2.WbsSetCode;
newwbsSet2Node.EnableExpandEvent = true;
newwbsSet2Node.EnableClickEvent = true;
newwbsSet1Node.Nodes.Add(newwbsSet2Node);
var childWbsSets3 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet2Node.NodeID);
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet2.WbsSetCode, wbsSetParm.WbsSetCode))
{
newwbsSet2Node.Expanded = true;
if (childWbsSets3.Count() > 0)
{
foreach (var wbsSet3 in childWbsSets3)
{
TreeNode newwbsSet3Node = new TreeNode();
newwbsSet3Node.Text = wbsSet3.WbsSetName;
newwbsSet3Node.NodeID = wbsSet3.WbsSetCode;
newwbsSet3Node.CommandName = "wbsSet";
newwbsSet3Node.ToolTip = wbsSet3.WbsSetCode;
newwbsSet3Node.EnableExpandEvent = true;
newwbsSet3Node.EnableClickEvent = true;
newwbsSet2Node.Nodes.Add(newwbsSet3Node);
var childWbsSets4 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet3Node.NodeID);
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet3.WbsSetCode, wbsSetParm.WbsSetCode))
{
newwbsSet3Node.Expanded = true;
if (childWbsSets4.Count() > 0)
{
foreach (var wbsSet4 in childWbsSets4)
{
TreeNode newwbsSet4Node = new TreeNode();
newwbsSet4Node.Text = wbsSet4.WbsSetName;
newwbsSet4Node.NodeID = wbsSet4.WbsSetCode;
newwbsSet4Node.CommandName = "wbsSet";
newwbsSet4Node.ToolTip = wbsSet4.WbsSetCode;
newwbsSet4Node.EnableExpandEvent = true;
newwbsSet4Node.EnableClickEvent = true;
newwbsSet3Node.Nodes.Add(newwbsSet4Node);
}
}
}
else
{
if (childWbsSets4.Count() > 0)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newwbsSet3Node.Nodes.Add(emptyNode);
}
}
}
}
}
else
{
if (childWbsSets3.Count() > 0)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newwbsSet2Node.Nodes.Add(emptyNode);
}
}
}
}
else
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newwbsSet1Node.Nodes.Add(emptyNode);
}
}
}
}
}
else
if (wbsSetParm.UnitProjectCode != UnitProjectCode)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newNodeUnitPorject.Nodes.Add(emptyNode);
}
#endregion
else
{
newNodeUnitPorject.Expanded = true;
var wbsSet1s = from x in Funs.DB.WBS_WbsSetInit where x.UnitProjectCode == UnitProjectCode && x.SuperWbsSetCode == null orderby x.WbsSetCode select x;
foreach (var wbsSet1 in wbsSet1s)
{
TreeNode newwbsSet1Node = new TreeNode();
newwbsSet1Node.Text = wbsSet1.WbsSetName;
newwbsSet1Node.NodeID = wbsSet1.WbsSetCode;
newwbsSet1Node.CommandName = "wbsSet";
newwbsSet1Node.ToolTip = wbsSet1.WbsSetCode;
newwbsSet1Node.EnableExpandEvent = true;
newwbsSet1Node.EnableClickEvent = true;
newNodeUnitPorject.Nodes.Add(newwbsSet1Node);
var childWbsSets2 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet1Node.NodeID);
if (childWbsSets2.Count() > 0)
{
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet1.WbsSetCode, wbsSetParm.WbsSetCode))
{
foreach (var wbsSet2 in childWbsSets2)
{
if (wbsSet1.WbsSetCode == wbsSet2.SuperWbsSetCode)
{
newwbsSet1Node.Expanded = true;
}
TreeNode newwbsSet2Node = new TreeNode();
newwbsSet2Node.Text = wbsSet2.WbsSetName;
newwbsSet2Node.NodeID = wbsSet2.WbsSetCode;
newwbsSet2Node.CommandName = "wbsSet";
newwbsSet2Node.ToolTip = wbsSet2.WbsSetCode;
newwbsSet2Node.EnableExpandEvent = true;
newwbsSet2Node.EnableClickEvent = true;
newwbsSet1Node.Nodes.Add(newwbsSet2Node);
var childWbsSets3 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet2Node.NodeID);
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet2.WbsSetCode, wbsSetParm.WbsSetCode))
{
newwbsSet2Node.Expanded = true;
if (childWbsSets3.Count() > 0)
{
foreach (var wbsSet3 in childWbsSets3)
{
TreeNode newwbsSet3Node = new TreeNode();
newwbsSet3Node.Text = wbsSet3.WbsSetName;
newwbsSet3Node.NodeID = wbsSet3.WbsSetCode;
newwbsSet3Node.CommandName = "wbsSet";
newwbsSet3Node.ToolTip = wbsSet3.WbsSetCode;
newwbsSet3Node.EnableExpandEvent = true;
newwbsSet3Node.EnableClickEvent = true;
newwbsSet2Node.Nodes.Add(newwbsSet3Node);
var childWbsSets4 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet3Node.NodeID);
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet3.WbsSetCode, wbsSetParm.WbsSetCode))
{
newwbsSet3Node.Expanded = true;
if (childWbsSets4.Count() > 0)
{
foreach (var wbsSet4 in childWbsSets4)
{
TreeNode newwbsSet4Node = new TreeNode();
newwbsSet4Node.Text = wbsSet4.WbsSetName;
newwbsSet4Node.NodeID = wbsSet4.WbsSetCode;
newwbsSet4Node.CommandName = "wbsSet";
newwbsSet4Node.ToolTip = wbsSet4.WbsSetCode;
newwbsSet4Node.EnableExpandEvent = true;
newwbsSet4Node.EnableClickEvent = true;
newwbsSet3Node.Nodes.Add(newwbsSet4Node);
}
}
}
else
{
if (childWbsSets4.Count() > 0)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newwbsSet3Node.Nodes.Add(emptyNode);
}
}
}
}
}
else
{
if (childWbsSets3.Count() > 0)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newwbsSet2Node.Nodes.Add(emptyNode);
}
}
}
}
else
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newwbsSet1Node.Nodes.Add(emptyNode);
}
}
}
}
}
else
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newNodeUnitPorject.Nodes.Add(emptyNode);
}
}
}
@@ -1182,5 +940,47 @@ namespace FineUIPro.Web.JDGL.WBS
BindGrid();
}
#endregion
#region
/// <summary>
/// 编辑按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuModify_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("CostControlInitEdit.aspx?type=modify&Id={0}&Code={1}", this.Grid1.SelectedRowID,this.trWBS.SelectedNodeID, "修改 - ")));
}
#endregion
#region
/// <summary>
/// 删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDel_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
Model.WBS_CostControlInit costControl = BLL.CostControlInitService.GetCostControlInitByCostControlInitId(Grid1.SelectedRowID);
if (costControl != null)
{
BLL.WbsSetMatchCostControlInitService.DeleteWbsSetMatchCostControlInitByWbsSetCodeAndCostControlInitCode(this.trWBS.SelectedNodeID,costControl.CostControlInitCode);
BLL.LogService.AddSys_Log(this.CurrUser, Grid1.SelectedRowID, Grid1.SelectedRowID, BLL.Const.ProjectControlPointMenuId, "删除费用对应关系");
Grid1.DataBind();
BindGrid();
Alert.ShowInTop("删除数据成功!", MessageBoxIcon.Success);
}
}
#endregion
}
}