2022-12-09 焊接任务单树修改
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
using Aspose.Words;
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
public partial class SelectTaskWeldJoint : PageBase
|
||||
@@ -81,7 +84,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
ViewState["SelectedList"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public List<HJGL_Pipeline> Tree_hJGL_Pipelines;
|
||||
public int pageindex=1;
|
||||
public int pageindex_2=1;
|
||||
public int page;
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
@@ -96,7 +102,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
{
|
||||
HJGL_MaterialService.materialStockItems_FIELD = new List<Model.MaterialStockItem>();
|
||||
HJGL_MaterialService.materialStockItems_SHOP = new List<Model.MaterialStockItem>();
|
||||
|
||||
pageindex = 1;
|
||||
pageindex_2 = 1;
|
||||
Tree_hJGL_Pipelines =new List<HJGL_Pipeline> ();
|
||||
this.txtTaskDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(1));
|
||||
this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text);
|
||||
BLL.Base_WeldingLocationServie.InitWeldingLocationDropDownList(drpWeldingLocation, true);
|
||||
@@ -158,6 +166,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
pageindex = 1;
|
||||
pageindex_2 = 1;
|
||||
this.tvControlItem.Nodes.Clear();
|
||||
TreeNode rootNode1 = new TreeNode();
|
||||
rootNode1.NodeID = BLL.PipelineService.PipeArea_SHOP;
|
||||
@@ -204,11 +214,29 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
}
|
||||
void AddTreeNode(string PipeArea , TreeNode node )
|
||||
{
|
||||
var iso = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipeArea orderby x.PipelineCode select x).ToList();
|
||||
|
||||
var iso = (from x in PipelineService.hJGL_Pipelines where x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipeArea orderby x.PipelineCode select x).ToList();
|
||||
if (!string.IsNullOrEmpty(this.txtPipelineCode.Text))
|
||||
{
|
||||
{
|
||||
iso = (from x in iso where x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) orderby x.PipelineCode select x).ToList();
|
||||
}
|
||||
int pagenum = 1 ;
|
||||
switch (PipeArea)
|
||||
{
|
||||
case "1":
|
||||
pagenum = pageindex;
|
||||
break;
|
||||
case "2":
|
||||
pagenum = pageindex_2;
|
||||
break;
|
||||
}
|
||||
|
||||
var Count = iso.Count();
|
||||
if (pagenum <= Count)
|
||||
{
|
||||
iso = iso.Skip(30 * (pagenum - 1)).Take(30).ToList(); ;
|
||||
|
||||
}
|
||||
var joints = from x in WeldJointService.hJGL_WeldJoints select x;
|
||||
foreach (var item in iso)
|
||||
{
|
||||
@@ -225,6 +253,17 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
newNode.ToolTip = item.PipelineCode;
|
||||
newNode.EnableClickEvent = true;
|
||||
node.Nodes.Add(newNode);
|
||||
|
||||
}
|
||||
if (pagenum < Count)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = "下一页";
|
||||
newNode.NodeID = "下一页";
|
||||
newNode.Icon = Icon.ArrowDown;
|
||||
newNode.CommandName = PipeArea;
|
||||
newNode.EnableClickEvent = true;
|
||||
node.Nodes.Add(newNode);
|
||||
}
|
||||
}
|
||||
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
|
||||
@@ -251,7 +290,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// <summary>
|
||||
/// 数据绑定
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
private void BindGrid()
|
||||
{
|
||||
string pipelineId = this.tvControlItem.SelectedNodeID;
|
||||
|
||||
@@ -321,7 +360,32 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||
/// <param name="e"></param>
|
||||
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
if (e.NodeID == "下一页")
|
||||
{
|
||||
|
||||
if (e.Node.CommandName == "1")
|
||||
{
|
||||
pageindex = pageindex + 1;
|
||||
TreeNode treeNode = e.Node.ParentNode;
|
||||
treeNode.Nodes.Remove(e.Node);
|
||||
AddTreeNode(BLL.PipelineService.PipeArea_SHOP, e.Node.ParentNode);
|
||||
|
||||
}
|
||||
else if (e.Node.CommandName == "2")
|
||||
{
|
||||
pageindex_2 = pageindex_2 + 1;
|
||||
TreeNode treeNode = e.Node.ParentNode;
|
||||
treeNode.Nodes.Remove(e.Node);
|
||||
|
||||
AddTreeNode(BLL.PipelineService.PipeArea_FIELD, e.Node.ParentNode);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.BindGrid();
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 排序
|
||||
|
||||
Reference in New Issue
Block a user