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
@@ -281,7 +281,7 @@ namespace FineUIPro.Web.ProjectData
}
else
{
ShowNotify("总图和主项节点无法增加子级!", MessageBoxIcon.Warning);
ShowNotify("总图和末级节点无法增加子级!", MessageBoxIcon.Warning);
}
}
else
@@ -320,36 +320,12 @@ namespace FineUIPro.Web.ProjectData
}
else
{
BLL.Project_InstallationService.DeleteInstallation(id);
var installation2s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == id select x;
foreach (var installation2 in installation2s)
{
BLL.Project_InstallationService.DeleteInstallation(installation2.InstallationId);
var installation3s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation2.InstallationId select x;
foreach (var installation3 in installation3s)
{
DeleteData(installation3.InstallationId);
}
}
DeleteBaseData(id);
}
}
else
{
Model.Project_Installation installation2 = BLL.Project_InstallationService.GetInstallationByInstallationId(id);
Model.Project_Installation installation1 = BLL.Project_InstallationService.GetInstallationByInstallationId(installation2.SuperInstallationId);
if (installation1.SuperInstallationId == "0") //删除二级装置
{
BLL.Project_InstallationService.DeleteInstallation(id);
var installation3s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == id select x;
foreach (var installation3 in installation3s)
{
DeleteData(installation3.InstallationId);
}
}
else //删除二级装置
{
DeleteData(id);
}
DeleteBaseData(id);
}
ShowNotify("删除成功!", MessageBoxIcon.Success);
InitTreeMenu();
@@ -370,6 +346,24 @@ namespace FineUIPro.Web.ProjectData
}
}
private void DeleteBaseData(string installationId)
{
Model.Project_Installation installation=BLL.Project_InstallationService.GetInstallationByInstallationId(installationId);
if (installation.IsEnd == false)
{
BLL.Project_InstallationService.DeleteInstallation(installationId);
var installations = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installationId select x;
foreach (var item in installations)
{
DeleteBaseData(item.InstallationId);
}
}
else
{
DeleteData(installationId);
}
}
/// <summary>
/// 删除方法
/// </summary>
@@ -378,9 +372,11 @@ namespace FineUIPro.Web.ProjectData
var wbsSets = (from x in Funs.DB.Wbs_WbsSet join y in Funs.DB.WBS_CnProfession on x.CnProfessionId equals y.CnProfessionId where y.InstallationId == installationId && x.CnProfessionId != null select x).ToList();
foreach (var wbsSet in wbsSets)
{
BLL.CostControlService.DeleteCostControlByWbsSetId(wbsSet.WbsSetId); //删除费控项
BLL.WbsDetailHistoryService.DeleteWbsDetailHistoryByToWbs(wbsSet.WbsSetId); //删除进度历史版本记录
BLL.WbsDetailService.DeleteWbsDetailByToWbs(wbsSet.WbsSetId); //删除进度记录
BLL.WbsSetService.DeleteWbsSet(wbsSet.WbsSetId);
BLL.WbsSetMatchCostControlService.DeleteWbsSetMatchCostControlByWbsSetId(wbsSet.WbsSetId); //删除费控项对应关系
}
//删除单位工程及子单位工程
@@ -544,30 +540,31 @@ namespace FineUIPro.Web.ProjectData
string ppInstallationId = string.Empty;
string projectId = this.CurrUser.LoginProjectId;
string id = this.hdSelectId.Text;
Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(id);
if (installation.SuperInstallationId == "0") //一级装置
{
ppInstallationId = id;
}
else
{
if (BLL.Project_InstallationService.IsCanAddInstallation(id)) //二级装置
{
pInstallationId = id;
ppInstallationId = installation.SuperInstallationId;
}
else //三级装置
{
installationId = id;
pInstallationId = installation.SuperInstallationId;
Model.Project_Installation pInstallation = BLL.Project_InstallationService.GetInstallationByInstallationId(installation.SuperInstallationId);
if (pInstallation != null)
{
ppInstallationId = pInstallation.SuperInstallationId;
}
}
}
//projectId = installation.ProjectId;
//Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(id);
//if (installation.SuperInstallationId == "0") //一级装置
//{
// ppInstallationId = id;
//}
//else
//{
// if (BLL.Project_InstallationService.IsCanAddInstallation(id)) //二级装置
// {
// pInstallationId = id;
// ppInstallationId = installation.SuperInstallationId;
// }
// else //三级装置
// {
// installationId = id;
// pInstallationId = installation.SuperInstallationId;
// Model.Project_Installation pInstallation = BLL.Project_InstallationService.GetInstallationByInstallationId(installation.SuperInstallationId);
// if (pInstallation != null)
// {
// ppInstallationId = pInstallation.SuperInstallationId;
// }
// }
//}
string ids = BLL.Project_InstallationService.GetParentInstallationIds(id);
this.trProjects.Nodes.Clear();
this.trProjects.ShowBorder = false;
this.trProjects.ShowHeader = false;
@@ -596,7 +593,7 @@ namespace FineUIPro.Web.ProjectData
newNode1.EnableExpandEvent = true;
newNode1.EnableClickEvent = true;
node.Nodes.Add(newNode1);
if (installation1.InstallationId == ppInstallationId)
if (ids.Contains(installation1.InstallationId))
{
newNode1.Expanded = true;
var installation2s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation1.InstallationId orderby x.InstallationCode select x;
@@ -609,7 +606,7 @@ namespace FineUIPro.Web.ProjectData
newNode2.EnableExpandEvent = true;
newNode2.EnableClickEvent = true;
newNode1.Nodes.Add(newNode2);
if (installation2.InstallationId == pInstallationId)
if (ids.Contains(installation2.InstallationId))
{
newNode2.Expanded = true;
var installation3s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation2.InstallationId orderby x.InstallationCode select x;
@@ -622,6 +619,57 @@ namespace FineUIPro.Web.ProjectData
newNode3.EnableExpandEvent = true;
newNode3.EnableClickEvent = true;
newNode2.Nodes.Add(newNode3);
if (ids.Contains(installation3.InstallationId))
{
newNode3.Expanded = true;
var installation4s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation3.InstallationId orderby x.InstallationCode select x;
foreach (var installation4 in installation4s)
{
TreeNode newNode4 = new TreeNode();
newNode4.Text = installation4.InstallationName;
newNode4.NodeID = installation4.InstallationId;
newNode4.CommandName = "installation";
newNode4.EnableExpandEvent = true;
newNode4.EnableClickEvent = true;
newNode3.Nodes.Add(newNode4);
if (ids.Contains(installation4.InstallationId))
{
newNode4.Expanded = true;
var installation5s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation4.InstallationId orderby x.InstallationCode select x;
foreach (var installation5 in installation5s)
{
TreeNode newNode5 = new TreeNode();
newNode5.Text = installation5.InstallationName;
newNode5.NodeID = installation5.InstallationId;
newNode5.CommandName = "installation";
newNode5.EnableExpandEvent = true;
newNode5.EnableClickEvent = true;
newNode4.Nodes.Add(newNode5);
}
}
else
{
if (BLL.Project_InstallationService.IsExitsInstallationsBySuperInstallationId(installation4.InstallationId))
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newNode4.Nodes.Add(emptyNode);
}
}
}
}
else
{
if (BLL.Project_InstallationService.IsExitsInstallationsBySuperInstallationId(installation3.InstallationId))
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newNode3.Nodes.Add(emptyNode);
}
}
}
}
else