From 86b99315973534de7de284b3a959d6ff904102ef Mon Sep 17 00:00:00 2001 From: fly-l <1420031550@qq.com> Date: Fri, 17 Feb 2023 15:30:04 +0800 Subject: [PATCH] =?UTF-8?q?2023-02-17=20=E7=84=8A=E6=8E=A5=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=8D=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBase/版本日志/SGGLDB_V2023-02-17.sql | 76 +++++++++ SGGL/FineUIPro.Web/ErrLog.txt | 82 +++++++++ .../HJGL/PointTrust/PointBatch.aspx | 15 +- .../HJGL/PointTrust/PointBatch.aspx.cs | 41 ++++- .../PointTrust/PointBatch.aspx.designer.cs | 31 +++- .../WeldingManage/SelectTaskWeldJoint.aspx | 21 ++- .../WeldingManage/SelectTaskWeldJoint.aspx.cs | 156 ++++++++---------- SGGL/Model/Model.cs | 118 ++++++++----- 8 files changed, 393 insertions(+), 147 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2023-02-17.sql diff --git a/DataBase/版本日志/SGGLDB_V2023-02-17.sql b/DataBase/版本日志/SGGLDB_V2023-02-17.sql new file mode 100644 index 00000000..7ad191c9 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-02-17.sql @@ -0,0 +1,76 @@ + +/****** Object: View [dbo].[View_HJGL_WeldingTask] Script Date: 2023/2/17 9:50:51 ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + + + +ALTER VIEW [dbo].[View_HJGL_WeldingTask] +AS +SELECT T.WeldTaskId,T.WeldJointId,T.CoverWelderId,T.BackingWelderId, + cov.WelderCode AS CoverWelderCode,back.WelderCode AS BackingWelderCode, + case when jot.JointAttribute is not null then jot.JointAttribute else T.JointAttribute end as JointAttribute, + T.WeldingMode,T.ProjectId,T.UnitWorkId,T.UnitId,T.TaskDate,T.Tabler,T.TableDate, + jot.WeldJointCode,jot.Dia,jot.DNDia, jot.Thickness,jot.Size,jot.WeldingLocationId, + CASE WHEN jot.WeldingDailyId IS NULL THEN '' ELSE '' END AS IsWelding, + P.PipelineCode,B.WeldTypeCode,M.WeldingMethodCode,L.WeldingLocationCode, + t.CanWelderCode,t.CanWelderId ,rod.ConsumablesName AS WeldingRodCode,T.CanWeldingRodName,T.CanWeldingWireName, + wire.ConsumablesName AS WeldingWireCode,jot.WeldingDailyId,p.PipeArea, + (case when charindex('/',jot.WeldJointCode)>0 +then RIGHT(jot.WeldJointCode,CHARINDEX('/',REVERSE(jot.WeldJointCode))-1) +else jot.WeldJointCode end) as WeldJointNum +from HJGL_WeldTask T +left join HJGL_WeldJoint jot on T.WeldJointId=jot.WeldJointId +LEFT JOIN dbo.SitePerson_Person cov ON cov.PersonId=t.CoverWelderId and cov.ProjectId=t.ProjectId +LEFT JOIN dbo.SitePerson_Person back ON back.PersonId=t.BackingWelderId and back.ProjectId=t.ProjectId +LEFT join HJGL_Pipeline P on jot.PipelineId=P.PipelineId +left join Base_WeldType B on jot.WeldTypeId=B.WeldTypeId +LEFT join Base_WeldingMethod M on jot.WeldingMethodId=M.WeldingMethodId +left join Base_WeldingLocation L on jot.WeldingLocationId=L.WeldingLocationId +LEFT JOIN Base_Consumables AS wire ON wire.ConsumablesId=jot.WeldingWire +LEFT JOIN Base_Consumables AS rod ON rod.ConsumablesId=jot.WeldingRod + + + +GO + + +ALTER VIEW [dbo].[View_HJGL_NoWeldJointFind] +AS +--δڲ +SELECT jot.WeldJointId, +jot.WeldJointCode, +(case when charindex('/',jot.WeldJointCode)>0 +then RIGHT(jot.WeldJointCode,CHARINDEX('/',REVERSE(jot.WeldJointCode))-1) +else jot.WeldJointCode end) as WeldJointNum, +jot.PipelineId, +jot.WeldingDailyId, +jot.JointAttribute, +jot.Dia, +jot.DNDia, +jot.Thickness, +jot.Remark, +WeldType.WeldTypeCode, +method.WeldingMethodCode, +rod.ConsumablesCode AS WeldingRodCode, +wire.ConsumablesCode AS WeldingWireCode, +mat1.MaterialCode AS Material1Code , +mat2.MaterialCode AS Material2Code +FROM dbo.HJGL_WeldJoint jot +LEFT JOIN dbo.HJGL_PreWeldingDaily pre ON pre.WeldJointId = jot.WeldJointId +LEFT JOIN Base_WeldType AS WeldType ON WeldType.WeldTypeId=jot.WeldTypeId +LEFT JOIN Base_WeldingMethod AS method ON method.WeldingMethodId=jot.WeldingMethodId +LEFT JOIN Base_Material AS mat1 ON mat1.MaterialId = jot.Material1Id +LEFT JOIN Base_Material AS mat2 ON mat2.MaterialId = jot.Material2Id +LEFT JOIN Base_Consumables AS wire ON wire.ConsumablesId=jot.WeldingWire +LEFT JOIN Base_Consumables AS rod ON rod.ConsumablesId=jot.WeldingRod +WHERE pre.PreWeldingDailyId IS NULL + +GO + + + + diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index e69de29b..83c803aa 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -0,0 +1,82 @@ +System.InvalidOperationException: 可为空的对象必须具有一个值。 + 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) + 在 System.Nullable`1.get_Value() + 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 +System.InvalidOperationException: 可为空的对象必须具有一个值。 + 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) + 在 System.Nullable`1.get_Value() + 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 +System.InvalidOperationException: 可为空的对象必须具有一个值。 + 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) + 在 System.Nullable`1.get_Value() + 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 +System.InvalidOperationException: 可为空的对象必须具有一个值。 + 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) + 在 System.Nullable`1.get_Value() + 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 +System.InvalidOperationException: 可为空的对象必须具有一个值。 + 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) + 在 System.Nullable`1.get_Value() + 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 +System.InvalidOperationException: 可为空的对象必须具有一个值。 + 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) + 在 System.Nullable`1.get_Value() + 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 +System.InvalidOperationException: 可为空的对象必须具有一个值。 + 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) + 在 System.Nullable`1.get_Value() + 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 +System.InvalidOperationException: 可为空的对象必须具有一个值。 + 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) + 在 System.Nullable`1.get_Value() + 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 +System.InvalidOperationException: 可为空的对象必须具有一个值。 + 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) + 在 System.Nullable`1.get_Value() + 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 +System.InvalidOperationException: 可为空的对象必须具有一个值。 + 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) + 在 System.Nullable`1.get_Value() + 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 +System.InvalidOperationException: 可为空的对象必须具有一个值。 + 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) + 在 System.Nullable`1.get_Value() + 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 +System.InvalidOperationException: 可为空的对象必须具有一个值。 + 在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) + 在 System.Nullable`1.get_Value() + 在 BLL.HJGL_MaterialService.isInStockByPipeline(String pipelineid, String projectid) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\BLL\HJGL\PreDesign\HJGL_MaterialService.cs:行号 284 + +错误信息开始=====> +错误类型:FormatException +错误信息:输入字符串的格式不正确。 +错误堆栈: + 在 System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) + 在 System.String.System.IConvertible.ToDouble(IFormatProvider provider) + 在 System.Convert.ToDouble(Object value) + 在 FineUIPro.RenderField.VQscVYXUOqxsrrrlgEYaXHIhTAZB(GridRow ) + 在 (GridColumn , GridRow ) + 在 FineUIPro.GridRow.BkpgFeAELTFlAvoTrOBrConfcLJbA() + 在 (GridRow ) + 在 FineUIPro.Grid.BkpgFeAELTFlAvoTrOBrConfcLJbA(Int32 , Object ) + 在 (Grid , Int32 , Object ) + 在 FineUIPro.Grid.LDChsdiaqdhUTcxBcQPMKyQFfjEDB(DataTable , Boolean ) + 在 (Grid , DataTable , Boolean ) + 在 FineUIPro.Grid.DataBind(Boolean keepCurrentData) + 在 (Grid , Boolean ) + 在 FineUIPro.Grid.DataBind() + 在 FineUIPro.Web.HJGL.WeldingManage.SelectTaskWeldJoint.BindGrid() 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\FineUIPro.Web\HJGL\WeldingManage\SelectTaskWeldJoint.aspx.cs:行号 339 + 在 FineUIPro.Web.HJGL.WeldingManage.SelectTaskWeldJoint.tvControlItem_NodeCommand(Object sender, TreeCommandEventArgs e) 位置 D:\诺必达\赛鼎\SGGL_SeDin\SGGL\FineUIPro.Web\HJGL\WeldingManage\SelectTaskWeldJoint.aspx.cs:行号 296 + 在 FineUIPro.Tree.OnNodeCommand(TreeCommandEventArgs e) + 在 (Tree , TreeCommandEventArgs ) + 在 FineUIPro.Tree.RaisePostBackEvent(String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:02/17/2023 15:15:39 +出错文件:http://localhost:4909/HJGL/WeldingManage/SelectTaskWeldJoint.aspx?strList=51f17d4a-92b5-4bbc-8935-fa0fced13bcb%7C1af885ff-b778-46c6-a13d-a21b304ac835%7C2022-12-01 +IP地址:::1 +操作人员:JT + +出错时间:02/17/2023 15:15:39 + diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx index 233ec9b7..cf072bbc 100644 --- a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx +++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx @@ -26,7 +26,7 @@ @@ -74,9 +74,14 @@ - - + + + + + @@ -101,7 +106,7 @@ + + diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.cs index 3290ca42..f9dd6429 100644 --- a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.cs @@ -1,4 +1,5 @@ using BLL; +using Model; using System; using System.Collections.Generic; using System.Data; @@ -257,6 +258,7 @@ namespace FineUIPro.Web.HJGL.PointTrust EnableClickEvent = true, }; var pipeline= PointBatchService.GetPointBatchById(item.PointBatchId); + string startdate = string.Format("{0:yyyy-MM-dd}", pipeline.StartDate); string PipeArea = ""; if (!string.IsNullOrEmpty(pipeline.PipelineId)) { @@ -273,19 +275,19 @@ namespace FineUIPro.Web.HJGL.PointTrust string code = "DK-" + item.PointBatchCode.Substring(item.PointBatchCode.Length - 4)+ PipeArea; if (!item.EndDate.HasValue) ////批 没有关闭 粉色 { - newNode.Text = "" + code + ""; + newNode.Text = "" + code +"【"+startdate + "】"+""; newNode.ToolTip = "批尚未关闭"; } // 当天批 else if (string.Format("{0:yyyy-MM-dd}", item.StartDate) == string.Format("{0:yyyy-MM-dd}", System.DateTime.Now) || string.Format("{0:yyyy-MM-dd}", item.EndDate) == string.Format("{0:yyyy-MM-dd}", System.DateTime.Now)) { - newNode.Text = "" + code + ""; + newNode.Text = "" + code + "【" + startdate + "】" + ""; newNode.ToolTip = "当天批"; } else { - newNode.Text = code; + newNode.Text = code+ "【" + startdate + "】"; } e.Node.Nodes.Add(newNode); @@ -449,6 +451,11 @@ namespace FineUIPro.Web.HJGL.PointTrust { listStr.Add(new SqlParameter("@PointBatchId", this.PointBatchId)); } + if (!string.IsNullOrEmpty(txtpipelinecode.Text.Trim())) + { + strSql += " and PipelineCode like @PipelineCode "; + listStr.Add(new SqlParameter("@PipelineCode", "%"+ txtpipelinecode.Text.Trim() + "%")); + } SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); @@ -483,6 +490,10 @@ namespace FineUIPro.Web.HJGL.PointTrust { this.BindGrid(); } + protected void btnQuery_Click(object sender, EventArgs e) + { + this.BindGrid(); + } #endregion #region 分页排序 @@ -624,7 +635,31 @@ namespace FineUIPro.Web.HJGL.PointTrust } + protected void btnManual_Click(object sender, EventArgs e) + { + var batch = BLL.PointBatchService.GetPointBatchById(this.PointBatchId); + if (!batch.EndDate.HasValue) + { + if (!string.IsNullOrEmpty(Grid1.SelectedRowID) ) + { + PointBatchDetailService.UpdatePointBatchDetail(Grid1.SelectedRowID, "1", System.DateTime.Now); + this.BindGrid(); + Alert.ShowInTop("已成功点口!", MessageBoxIcon.Success); + } + else + { + Alert.ShowInTop("请选择点口!", MessageBoxIcon.Warning); + } + + } + else + { + Alert.ShowInTop("批已关闭,不能点口!", MessageBoxIcon.Success); + } + + + } /// /// 手动点口关闭 /// diff --git a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.designer.cs index d1072669..cc1b5d5f 100644 --- a/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/PointTrust/PointBatch.aspx.designer.cs @@ -123,13 +123,31 @@ namespace FineUIPro.Web.HJGL.PointTrust protected global::FineUIPro.Toolbar Toolbar3; /// - /// txtPointBatchCode 控件。 + /// txtpipelinecode 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Label txtPointBatchCode; + protected global::FineUIPro.TextBox txtpipelinecode; + + /// + /// btnQuery 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnQuery; + + /// + /// btnManual 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnManual; /// /// btnAutoPoint 控件。 @@ -302,6 +320,15 @@ namespace FineUIPro.Web.HJGL.PointTrust /// protected global::FineUIPro.Toolbar Toolbar2; + /// + /// txtPointBatchCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtPointBatchCode; + /// /// txtStartDate 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx index c04e75d6..5cd0c3d7 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx @@ -31,6 +31,7 @@ EnablePostBack="true" OnClick="btnQuery_Click" runat="server"> + @@ -110,6 +111,10 @@ + + - + + + + TextAlign="Left" Width="120px" Hidden="true"> + HeaderTextAlign="Center" TextAlign="Left" Width="140px" ExpandUnusedSpace="true" Hidden="true"> + HeaderTextAlign="Center" TextAlign="Left" Width="120px" ExpandUnusedSpace="true" Hidden="true"> + HeaderTextAlign="Center" TextAlign="Left" Width="120px" ExpandUnusedSpace="true" Hidden="true"> diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs index b35c0e59..b734e473 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs @@ -85,9 +85,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } public List Tree_hJGL_Pipelines; - public int pageindex=1; - public int pageindex_2=1; - public int pageSize=20; + public int pageSize = PipelineService.pageSize; + #endregion #region 加载页面 @@ -102,8 +101,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage { HJGL_MaterialService.materialStockItems_FIELD = new List(); HJGL_MaterialService.materialStockItems_SHOP = new List(); - pageindex = 1; - pageindex_2 = 1; + Tree_hJGL_Pipelines =new List (); 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); @@ -166,77 +164,57 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// private void InitTreeMenu() { - pageindex = 1; - pageindex_2 = 1; this.tvControlItem.Nodes.Clear(); + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipelineService.PipeArea_SHOP && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count(); + int b = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipelineService.PipeArea_FIELD && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) select x).Count(); + TreeNode rootNode1 = new TreeNode(); rootNode1.NodeID = BLL.PipelineService.PipeArea_SHOP; rootNode1.Text = "工厂预制"; - rootNode1.CommandName = "工厂预制"; + rootNode1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); //页码|总页 rootNode1.EnableClickEvent = true; rootNode1.EnableExpandEvent = true; this.tvControlItem.Nodes.Add(rootNode1); - - int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipelineService.PipeArea_SHOP select x).Count(); if (a > 0) { - // BindNodes(tn1); TreeNode newNode = new TreeNode(); newNode.Text = "加载管线..."; newNode.NodeID = "加载管线..."; rootNode1.Nodes.Add(newNode); } - TreeNode rootNode2 = new TreeNode(); rootNode2.NodeID = BLL.PipelineService.PipeArea_FIELD; rootNode2.Text = "现场安装"; - rootNode2.CommandName = "现场安装"; + rootNode2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize); rootNode2.EnableClickEvent = true; rootNode2.EnableExpandEvent = true; this.tvControlItem.Nodes.Add(rootNode2); - int b = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == this.UnitWorkId && x.UnitId == this.UnitId && x.PipeArea == PipelineService.PipeArea_FIELD select x).Count(); if (b > 0) { - // BindNodes(tn1); - TreeNode newNode = new TreeNode(); + TreeNode newNode = new TreeNode(); newNode.Text = "加载管线..."; newNode.NodeID = "加载管线..."; rootNode2.Nodes.Add(newNode); } - //TreeNode rootNode = new TreeNode(); - //rootNode.Text = "管线号"; - //rootNode.NodeID = "0"; - //rootNode.Expanded = true; - //this.tvControlItem.Nodes.Add(rootNode); - - } void AddTreeNode(string PipeArea , TreeNode node ) - { - - var iso = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && 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) + { + var pipeline = (from x in Funs.DB.HJGL_Pipeline + where x.ProjectId == this.CurrUser.LoginProjectId + && x.UnitWorkId == this.UnitWorkId + && x.UnitId == this.UnitId + && x.PipeArea == PipeArea + && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) + orderby x.PipelineCode select x).ToList(); + var joints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); + int pageindex = int.Parse(node.CommandName.Split('|')[0]); + int pageCount = int.Parse(node.CommandName.Split('|')[1]); + + if (pageindex <= pageCount) { - case "1": - pagenum = pageindex; - break; - case "2": - pagenum = pageindex_2; - break; - } - - var Count = iso.Count(); - if (pagenum <= Funs.GetEndPageNumber(Count,pageSize)) - { - iso = iso.Skip(pageSize * (pagenum - 1)).Take(pageSize).ToList(); ; - var joints = (from x in Funs.DB.HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); - foreach (var item in iso) + pipeline = pipeline.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList(); ; + foreach (var item in pipeline) { TreeNode newNode = new TreeNode(); int totalJointNum = joints.Count(x => x.PipelineId == item.PipelineId); @@ -253,7 +231,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage node.Nodes.Add(newNode); } - if (pagenum < Count) + if (pageindex < pageCount) { TreeNode newNode = new TreeNode(); newNode.Text = "加载"; @@ -272,12 +250,12 @@ namespace FineUIPro.Web.HJGL.WeldingManage if (e.Node.Nodes[0].NodeID == "加载管线...") { e.Node.Nodes.Clear(); - if (e.Node.CommandName == "工厂预制") + if (e.Node.Text == "工厂预制") { AddTreeNode(BLL.PipelineService.PipeArea_SHOP, e.Node); } - else if (e.Node.CommandName == "现场安装") + else if (e.Node.Text == "现场安装") { AddTreeNode(BLL.PipelineService.PipeArea_FIELD, e.Node); @@ -285,12 +263,46 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } - #endregion + #endregion - #region 数据绑定 - /// - /// 数据绑定 - /// + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + if (e.Node.Text == "加载") + { + string CommandName = e.Node.ParentNode.CommandName; + e.Node.ParentNode.CommandName = (int.Parse(CommandName.Split('|')[0]) + 1) + "|" + int.Parse(CommandName.Split('|')[1]); + TreeNode treeNode = e.Node.ParentNode; + treeNode.Nodes.Remove(e.Node); + + if (e.Node.CommandName == "1") + { + AddTreeNode(BLL.PipelineService.PipeArea_SHOP, e.Node.ParentNode); + + } + else if (e.Node.CommandName == "2") + { + AddTreeNode(BLL.PipelineService.PipeArea_FIELD, e.Node.ParentNode); + + } + } + else + { + this.BindGrid(); + + } + } + #endregion + + #region 数据绑定 + /// + /// 数据绑定 + /// private void BindGrid() { string pipelineId = this.tvControlItem.SelectedNodeID; @@ -354,42 +366,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage } #endregion - #region 点击TreeView - /// - /// 点击TreeView - /// - /// - /// - protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) - { - if (e.Node.Text == "加载") - { - - 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 排序 /// /// 排序 diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 667067db..1f3e45a6 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -73392,7 +73392,7 @@ namespace Model OnCreated(); } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(15) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] public string MaterialCode { get @@ -73496,7 +73496,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialDef", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialDef", DbType="NVarChar(3000)")] public string MaterialDef { get @@ -77880,7 +77880,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(15)")] public string MaterialCode { get @@ -82228,7 +82228,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(1000)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(200)")] public string CanWelderCode { get @@ -232722,14 +232722,18 @@ namespace Model private string _JointAttribute; + private System.Nullable _Dia; + + private string _DNDia; + + private System.Nullable _Thickness; + + private string _Remark; + private string _WeldTypeCode; private string _WeldingMethodCode; - private System.Nullable _Dia; - - private System.Nullable _Thickness; - private string _WeldingRodCode; private string _WeldingWireCode; @@ -232838,6 +232842,70 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Dia", DbType="Decimal(8,3)")] + public System.Nullable Dia + { + get + { + return this._Dia; + } + set + { + if ((this._Dia != value)) + { + this._Dia = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DNDia", DbType="VarChar(50)")] + public string DNDia + { + get + { + return this._DNDia; + } + set + { + if ((this._DNDia != value)) + { + this._DNDia = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Thickness", DbType="Decimal(8,3)")] + public System.Nullable Thickness + { + get + { + return this._Thickness; + } + set + { + if ((this._Thickness != value)) + { + this._Thickness = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(200)")] + public string Remark + { + get + { + return this._Remark; + } + set + { + if ((this._Remark != value)) + { + this._Remark = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldTypeCode", DbType="NVarChar(50)")] public string WeldTypeCode { @@ -232870,38 +232938,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Dia", DbType="Decimal(8,3)")] - public System.Nullable Dia - { - get - { - return this._Dia; - } - set - { - if ((this._Dia != value)) - { - this._Dia = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Thickness", DbType="Decimal(8,3)")] - public System.Nullable Thickness - { - get - { - return this._Thickness; - } - set - { - if ((this._Thickness != value)) - { - this._Thickness = value; - } - } - } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldingRodCode", DbType="NVarChar(50)")] public string WeldingRodCode { @@ -234190,7 +234226,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(1000)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CanWelderCode", DbType="NVarChar(200)")] public string CanWelderCode { get