焊工 入场 离场 日报导入 装置排序

This commit is contained in:
2025-08-14 17:26:23 +08:00
parent 2e0c97e981
commit bead4c1d76
18 changed files with 597 additions and 258 deletions
@@ -105,8 +105,8 @@ namespace FineUIPro.Web.ProjectData
{
var installations = from x in Funs.DB.Project_Installation
where x.ProjectId == e.Node.NodeID && x.SuperInstallationId == "0"
orderby x.InstallationCode
select x;
orderby x.SortIndex ascending
select x;
foreach (var installation in installations)
{
TreeNode newNode = new TreeNode();
@@ -116,7 +116,7 @@ namespace FineUIPro.Web.ProjectData
newNode.EnableExpandEvent = true;
newNode.EnableClickEvent = true;
e.Node.Nodes.Add(newNode);
var installation2s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation.InstallationId orderby x.InstallationCode select x;
var installation2s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation.InstallationId orderby x.SortIndex ascending select x;
if (installation2s.Count() > 0)
{
TreeNode emptyNode = new TreeNode();
@@ -130,7 +130,7 @@ namespace FineUIPro.Web.ProjectData
{
var installations = from x in Funs.DB.Project_Installation
where x.SuperInstallationId == e.Node.NodeID
orderby x.InstallationCode
orderby x.SortIndex ascending
select x;
foreach (var installation in installations)
{
@@ -141,7 +141,7 @@ namespace FineUIPro.Web.ProjectData
newNode.EnableExpandEvent = true;
newNode.EnableClickEvent = true;
e.Node.Nodes.Add(newNode);
var installation3s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation.InstallationId orderby x.InstallationCode select x;
var installation3s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation.InstallationId orderby x.SortIndex ascending select x;
if (installation3s.Count() > 0)
{
TreeNode emptyNode = new TreeNode();
@@ -296,15 +296,200 @@ namespace FineUIPro.Web.ProjectData
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
}
}
protected void btnMenuUp_Click(object sender, EventArgs e)
{
if (this.trProjects.SelectedNode != null)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectInstallationMenuId, BLL.Const.BtnAdd))
{
var install = Funs.DB.Project_Installation.FirstOrDefault(x => x.InstallationId == this.trProjects.SelectedNode.NodeID);
var installs = Funs.DB.Project_Installation.Where(x => x.ProjectId == install.ProjectId && x.SuperInstallationId == install.SuperInstallationId).OrderBy(x => x.SortIndex).ToList();
/// <summary>
/// 右键删除事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
if (!install.SortIndex.HasValue)
{
int index = 1;
foreach (var i in installs)
{
i.SortIndex = index;
index++;
}
}
for (int index = 1; index < installs.Count; index++)
{
if (installs[index].InstallationId == this.trProjects.SelectedNode.NodeID)
{
int tempIndex = installs[index].SortIndex.Value;
installs[index].SortIndex = installs[index - 1].SortIndex;
installs[index - 1].SortIndex = tempIndex;
}
}
Funs.DB.SubmitChanges();
var parent = this.trProjects.SelectedNode.ParentNode;
parent.Nodes.Clear();
if (parent.CommandName == "project")
{
var installations = from x in Funs.DB.Project_Installation where x.ProjectId == parent.NodeID && x.SuperInstallationId == "0" orderby x.SortIndex ascending select x;
foreach (var installation in installations)
{
TreeNode newNode = new TreeNode();
newNode.Text = installation.InstallationName;
newNode.NodeID = installation.InstallationId;
newNode.CommandName = "installation";
newNode.EnableExpandEvent = true;
newNode.EnableClickEvent = true;
parent.Nodes.Add(newNode);
var installation3s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation.InstallationId orderby x.SortIndex ascending select x;
if (installation3s.Count() > 0)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newNode.Nodes.Add(emptyNode);
}
}
}
else
{
var installations = from x in Funs.DB.Project_Installation where x.SuperInstallationId == parent.NodeID orderby x.SortIndex ascending select x;
foreach (var installation in installations)
{
TreeNode newNode = new TreeNode();
newNode.Text = installation.InstallationName;
newNode.NodeID = installation.InstallationId;
newNode.CommandName = "installation";
newNode.EnableExpandEvent = true;
newNode.EnableClickEvent = true;
parent.Nodes.Add(newNode);
var installation3s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation.InstallationId orderby x.SortIndex ascending select x;
if (installation3s.Count() > 0)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newNode.Nodes.Add(emptyNode);
}
}
}
}
else
{
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
}
}
protected void btnMenuDown_Click(object sender, EventArgs e)
{
if (this.trProjects.SelectedNode != null)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectInstallationMenuId, BLL.Const.BtnAdd))
{
var install = Funs.DB.Project_Installation.FirstOrDefault(x => x.InstallationId == this.trProjects.SelectedNode.NodeID);
var installs = Funs.DB.Project_Installation.Where(x =>x.ProjectId==install.ProjectId && x.SuperInstallationId == install.SuperInstallationId).OrderBy(x => x.SortIndex).ToList();
if (!install.SortIndex.HasValue)
{
int index = 1;
foreach (var i in installs)
{
i.SortIndex = index;
index++;
}
}
for (int index = 0; index < installs.Count - 1; index++)
{
if (installs[index].InstallationId == this.trProjects.SelectedNode.NodeID)
{
int tempIndex = installs[index].SortIndex.Value;
installs[index].SortIndex = installs[index + 1].SortIndex;
installs[index + 1].SortIndex = tempIndex;
}
}
Funs.DB.SubmitChanges();
var parent = this.trProjects.SelectedNode.ParentNode;
parent.Nodes.Clear();
if (parent.CommandName == "project")
{
var installations = from x in Funs.DB.Project_Installation where x.ProjectId == parent.NodeID && x.SuperInstallationId == "0" orderby x.SortIndex ascending select x;
foreach (var installation in installations)
{
TreeNode newNode = new TreeNode();
newNode.Text = installation.InstallationName;
newNode.NodeID = installation.InstallationId;
newNode.CommandName = "installation";
newNode.EnableExpandEvent = true;
newNode.EnableClickEvent = true;
parent.Nodes.Add(newNode);
var installation3s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation.InstallationId orderby x.SortIndex ascending select x;
if (installation3s.Count() > 0)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newNode.Nodes.Add(emptyNode);
}
}
}
else
{
var installations = from x in Funs.DB.Project_Installation where x.SuperInstallationId == parent.NodeID orderby x.SortIndex ascending select x;
foreach (var installation in installations)
{
TreeNode newNode = new TreeNode();
newNode.Text = installation.InstallationName;
newNode.NodeID = installation.InstallationId;
newNode.CommandName = "installation";
newNode.EnableExpandEvent = true;
newNode.EnableClickEvent = true;
parent.Nodes.Add(newNode);
var installation3s = from x in Funs.DB.Project_Installation where x.SuperInstallationId == installation.InstallationId orderby x.SortIndex ascending select x;
if (installation3s.Count() > 0)
{
TreeNode emptyNode = new TreeNode();
emptyNode.Text = "";
emptyNode.NodeID = "";
newNode.Nodes.Add(emptyNode);
}
}
}
}
else
{
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
}
}
/// <summary>
/// 右键删除事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
if (this.trProjects.SelectedNode != null)
{