20250513 排产计划

This commit is contained in:
2025-05-13 11:18:34 +08:00
parent 58e33c9576
commit ef5993ae75
9 changed files with 1606 additions and 0 deletions
@@ -0,0 +1,94 @@
insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
values('53948077-B51D-4FF3-BFB0-AB4E27C42875','排产计划','HJGL/PreDesign/ProductionSchedulingPlan.aspx',70,'1E36EA73-D536-4215-BFB9-A8771937BD89','Menu_HJGL',0,1,1)
go
insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
values('824DDB94-628F-4A4D-9977-E38F039578AA','53948077-B51D-4FF3-BFB0-AB4E27C42875','增加',1)
insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
values('5491A74E-F3EC-4C1D-AA5D-BB0283C7E36D','53948077-B51D-4FF3-BFB0-AB4E27C42875','修改',2)
insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
values('9B72FF93-6E2F-41DF-8BA9-3A1C82923B3B','53948077-B51D-4FF3-BFB0-AB4E27C42875','删除',3)
insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
values('8AD82894-12DA-47E8-8382-3E27633750E0','53948077-B51D-4FF3-BFB0-AB4E27C42875','保存',4)
go
CREATE TABLE [dbo].[HJGL_ProductionSchedulingPlan](
[ProductionSchedulingPlanId] [nvarchar](50) NOT NULL,
[ProjectId] [nvarchar](50) NULL,
[PipelineId] [nvarchar](50) NULL,
[FlowNum] [nvarchar](50) NULL,
[MainItemName] [nvarchar](50) NULL,
[Material] [nvarchar](50) NULL,
[Caliber] [nvarchar](50) NULL,
[Dain] [decimal](18, 2) NULL,
[TotalDyne] [decimal](18, 2) NULL,
[TotalPriority] [nvarchar](50) NULL,
[PriorityTotalDyne] [decimal](18, 2) NULL,
[PlanStartDate] [datetime] NULL,
[PlanEndDate] [datetime] NULL,
[Days] [int] NULL,
[AvgDailyWorkload] [numeric](18, 2) NULL,
CONSTRAINT [PK_HJGL_ProductionSchedulingPlan] PRIMARY KEY CLUSTERED
(
[ProductionSchedulingPlanId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[HJGL_ProductionSchedulingPlan] WITH CHECK ADD CONSTRAINT [FK_HJGL_ProductionSchedulingPlan_Base_Project] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[Base_Project] ([ProjectId])
GO
ALTER TABLE [dbo].[HJGL_ProductionSchedulingPlan] CHECK CONSTRAINT [FK_HJGL_ProductionSchedulingPlan_Base_Project]
GO
ALTER TABLE [dbo].[HJGL_ProductionSchedulingPlan] WITH CHECK ADD CONSTRAINT [FK_HJGL_ProductionSchedulingPlan_HJGL_Pipeline] FOREIGN KEY([PipelineId])
REFERENCES [dbo].[HJGL_Pipeline] ([PipelineId])
GO
ALTER TABLE [dbo].[HJGL_ProductionSchedulingPlan] CHECK CONSTRAINT [FK_HJGL_ProductionSchedulingPlan_HJGL_Pipeline]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管线Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'PipelineId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'流水段号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'FlowNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主项名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'MainItemName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'材质' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'Material'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'口径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'Caliber'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'达因数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'Dain'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'总达因' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'TotalDyne'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'总优先级' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'TotalPriority'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'优先级总达因' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'PriorityTotalDyne'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'计划开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'PlanStartDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'计划结束时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'PlanEndDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'天数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'Days'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'平均每天工作量' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan', @level2type=N'COLUMN',@level2name=N'AvgDailyWorkload'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排产计划' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'HJGL_ProductionSchedulingPlan'
GO
+1
View File
@@ -407,6 +407,7 @@
<Compile Include="HJGL\PreDesign\HJGL_MaterialService.cs" />
<Compile Include="HJGL\PreDesign\PackagingmanagedetailService.cs" />
<Compile Include="HJGL\PreDesign\PackagingManageService .cs" />
<Compile Include="HJGL\PreDesign\ProductionSchedulingPlanService.cs" />
<Compile Include="HJGL\PreDesign\TrainNumberManageService.cs" />
<Compile Include="HJGL\PreDesign\YardPlanningService.cs" />
<Compile Include="HJGL\PurgingCleaning\PC_ItemEndCheckService.cs" />
@@ -0,0 +1,124 @@
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 排产计划
/// </summary>
public class ProductionSchedulingPlanService
{
/// <summary>
/// 根据主键获取排产计划
/// </summary>
/// <param name="productionSchedulingPlanId"></param>
/// <returns></returns>
public static Model.HJGL_ProductionSchedulingPlan GetProductionSchedulingPlanById(string productionSchedulingPlanId)
{
return Funs.DB.HJGL_ProductionSchedulingPlan.FirstOrDefault(e => e.ProductionSchedulingPlanId == productionSchedulingPlanId);
}
/// <summary>
/// 根据管线Id获取排产计划
/// </summary>
/// <param name="projectId"></param>
/// <param name="pipelineId"></param>
/// <returns></returns>
public static Model.HJGL_ProductionSchedulingPlan GetProductionSchedulingPlanByPipelineId(string projectId, string pipelineId)
{
return Funs.DB.HJGL_ProductionSchedulingPlan.FirstOrDefault(e => e.ProjectId == projectId && e.PipelineId == pipelineId);
}
/// <summary>
/// 增加排产计划
/// </summary>
/// <param name="plan"></param>
public static void AddProductionSchedulingPlan(Model.HJGL_ProductionSchedulingPlan plan)
{
SGGLDB db = Funs.DB;
Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan();
newPlan.ProductionSchedulingPlanId = plan.ProductionSchedulingPlanId;
newPlan.ProjectId = plan.ProjectId;
newPlan.PipelineId = plan.PipelineId;
newPlan.FlowNum = plan.FlowNum;
newPlan.MainItemName = plan.MainItemName;
newPlan.Material = plan.Material;
newPlan.Caliber = plan.Caliber;
newPlan.Dain = plan.Dain;
newPlan.TotalDyne = plan.TotalDyne;
newPlan.TotalPriority = plan.TotalPriority;
newPlan.PriorityTotalDyne = plan.PriorityTotalDyne;
newPlan.PlanStartDate = plan.PlanStartDate;
newPlan.PlanEndDate = plan.PlanEndDate;
newPlan.Days = plan.Days;
newPlan.AvgDailyWorkload = plan.Days;
db.HJGL_ProductionSchedulingPlan.InsertOnSubmit(newPlan);
db.SubmitChanges();
}
/// <summary>
/// 修改排产计划
/// </summary>
/// <param name="plan"></param>
public static void UpdateProductionSchedulingPlan(Model.HJGL_ProductionSchedulingPlan plan)
{
Model.SGGLDB db = Funs.DB;
Model.HJGL_ProductionSchedulingPlan newPlan = db.HJGL_ProductionSchedulingPlan.FirstOrDefault(e => e.ProductionSchedulingPlanId == plan.ProductionSchedulingPlanId);
if (newPlan != null)
{
newPlan.PipelineId = plan.PipelineId;
newPlan.FlowNum = plan.FlowNum;
newPlan.MainItemName = plan.MainItemName;
newPlan.Material = plan.Material;
newPlan.Caliber = plan.Caliber;
newPlan.Dain = plan.Dain;
newPlan.TotalDyne = plan.TotalDyne;
newPlan.TotalPriority = plan.TotalPriority;
newPlan.PriorityTotalDyne = plan.PriorityTotalDyne;
newPlan.PlanStartDate = plan.PlanStartDate;
newPlan.PlanEndDate = plan.PlanEndDate;
newPlan.Days = plan.Days;
newPlan.AvgDailyWorkload = plan.Days;
try
{
db.SubmitChanges(System.Data.Linq.ConflictMode.ContinueOnConflict);
}
catch (System.Data.Linq.ChangeConflictException ex)
{
foreach (System.Data.Linq.ObjectChangeConflict occ in db.ChangeConflicts)
{
//以下是解决冲突的三种方法,选一种即可
// 使用当前数据库中的值,覆盖Linq缓存中实体对象的值
occ.Resolve(System.Data.Linq.RefreshMode.OverwriteCurrentValues);
// 使用Linq缓存中实体对象的值,覆盖当前数据库中的值
occ.Resolve(System.Data.Linq.RefreshMode.KeepCurrentValues);
// 只更新实体对象中改变的字段的值,其他的保留不变
occ.Resolve(System.Data.Linq.RefreshMode.KeepChanges);
}
// 这个地方要注意,Catch方法中,我们前面只是指明了怎样来解决冲突,这个地方还需要再次提交更新,这样的话,值 //才会提交到数据库。
db.SubmitChanges();
}
}
}
/// <summary>
/// 根据主键删除排产计划
/// </summary>
/// <param name="productionSchedulingPlanId"></param>
public static void DeleteProductionSchedulingPlanById(string productionSchedulingPlanId)
{
SGGLDB db = Funs.DB;
Model.HJGL_ProductionSchedulingPlan plan = db.HJGL_ProductionSchedulingPlan.FirstOrDefault(e => e.ProductionSchedulingPlanId == productionSchedulingPlanId);
if (plan != null)
{
db.HJGL_ProductionSchedulingPlan.DeleteOnSubmit(plan);
db.SubmitChanges();
}
}
}
}
+8
View File
@@ -1558,6 +1558,7 @@
<Content Include="HJGL\PreDesign\PackagingManageView.aspx" />
<Content Include="HJGL\PreDesign\InstallList.aspx" />
<Content Include="HJGL\PreDesign\PrePipelineQRCodeIn.aspx" />
<Content Include="HJGL\PreDesign\ProductionSchedulingPlan.aspx" />
<Content Include="HJGL\PreDesign\TrainNumberManager.aspx" />
<Content Include="HJGL\PreDesign\TrainNumberManageEdit.aspx" />
<Content Include="HJGL\PreDesign\YardPlanning.aspx" />
@@ -10584,6 +10585,13 @@
<Compile Include="HJGL\PreDesign\PrePipelineQRCodeIn.aspx.designer.cs">
<DependentUpon>PrePipelineQRCodeIn.aspx</DependentUpon>
</Compile>
<Compile Include="HJGL\PreDesign\ProductionSchedulingPlan.aspx.cs">
<DependentUpon>ProductionSchedulingPlan.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HJGL\PreDesign\ProductionSchedulingPlan.aspx.designer.cs">
<DependentUpon>ProductionSchedulingPlan.aspx</DependentUpon>
</Compile>
<Compile Include="HJGL\PreDesign\TrainNumberManager.aspx.cs">
<DependentUpon>TrainNumberManager.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -0,0 +1,171 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductionSchedulingPlan.aspx.cs" Inherits="FineUIPro.Web.HJGL.PreDesign.ProductionSchedulingPlan" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>排产计划</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
EnableCollapse="true" Width="300px" Title="WBS目录"
ShowBorder="true" Layout="VBox" ShowHeader="true" AutoScroll="true" BodyPadding="5px"
IconFont="ArrowCircleLeft">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtPipelineCode" runat="server" Label="管线"
EmptyText="输入查询条件" Width="280px" LabelWidth="60px">
</f:TextBox>
<f:HiddenField runat="server" ID="hdUnitWorkId"></f:HiddenField>
</Items>
</f:Toolbar>
<f:Toolbar runat="server" ToolbarAlign="Right">
<Items>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnTreeFind" ToolTip="查询" Icon="SystemSearch"
EnablePostBack="true" OnClick="btnTreeFind_Click" runat="server">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Tree ID="tvControlItem" ShowHeader="false" Height="560px" Title="单位工程"
OnNodeCommand="tvControlItem_NodeCommand" runat="server" ShowBorder="false" EnableCollapse="true"
EnableSingleClickExpand="false" AutoLeafIdentification="true" OnNodeExpand="tvControlItem_TreeNodeExpanded"
EnableTextSelection="true">
</f:Tree>
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="排产计划"
TitleToolTip="排产计划" AutoScroll="true">
<Toolbars>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="保存" Icon="SystemSave"></f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出"
Icon="TableGo" EnableAjax="false" EnablePostBack="true" Hidden="true">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="排产计划" ForceFit="false"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="ProductionSchedulingPlanId" AllowCellEditing="true"
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="1" DataIDField="ProductionSchedulingPlanId"
AllowSorting="true" SortField="FlowNum" SortDirection="ASC" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="True">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField HeaderText="流水段号" ColumnID="FlowNum"
DataField="FlowNum" SortField="FlowNum" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="主项名称" ColumnID="MainItemName"
DataField="MainItemName" SortField="MainItemName" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="120px">
</f:RenderField>
<f:RenderField HeaderText="材质" ColumnID="Material"
DataField="Material" SortField="Material" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="100px">
</f:RenderField>
<f:RenderField HeaderText="口径" ColumnID="Caliber"
DataField="Caliber" SortField="Caliber" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="100px">
</f:RenderField>
<f:RenderField HeaderText="达因数" ColumnID="Dain"
DataField="Dain" SortField="Dain" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
Width="90px">
</f:RenderField>
<f:RenderField HeaderText="总达因" ColumnID="TotalDyne"
DataField="TotalDyne" SortField="TotalDyne" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
Width="90px">
</f:RenderField>
<f:RenderField HeaderText="总优先级" ColumnID="TotalPriority"
DataField="TotalPriority" SortField="TotalPriority" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="100px">
<Editor>
<f:TextBox ID="txtTotalPriority" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="优先级总达因" ColumnID="PriorityTotalDyne"
DataField="PriorityTotalDyne" SortField="PriorityTotalDyne" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
Width="120px">
<Editor>
<f:NumberBox ID="txtPriorityTotalDyne" runat="server"></f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="计划开始时间" ColumnID="PlanStartDate"
DataField="PlanStartDate" SortField="PlanStartDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderTextAlign="Center" TextAlign="Left"
Width="120px">
<Editor>
<f:DatePicker ID="txtPlanStartDate" runat="server"></f:DatePicker>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="计划结束时间" ColumnID="PlanEndDate"
DataField="PlanEndDate" SortField="PlanEndDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderTextAlign="Center" TextAlign="Left"
Width="120px">
<Editor>
<f:DatePicker ID="txtPlanEndDate" runat="server"></f:DatePicker>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="天数" ColumnID="Days"
DataField="Days" SortField="Days" FieldType="Int" HeaderTextAlign="Center" TextAlign="Left"
Width="90px">
<Editor>
<f:NumberBox ID="txtDays" runat="server" NoDecimal="true" NoNegative="true"></f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="平均每天工作量" ColumnID="AvgDailyWorkload"
DataField="AvgDailyWorkload" SortField="AvgDailyWorkload" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
Width="120px">
<Editor>
<f:NumberBox ID="txtAvgDailyWorkload" runat="server" NoDecimal="true" ></f:NumberBox>
</Editor>
</f:RenderField>
<%--<f:RenderField HeaderText="主键" ColumnID="ProductionSchedulingPlanId"
DataField="ProductionSchedulingPlanId" SortField="ProductionSchedulingPlanId" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="120px">
<Editor>
<f:TextBox ID="NumberBox1" runat="server"></f:TextBox>
</Editor>
</f:RenderField>--%>
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
<f:ListItem Text="所有行" Value="10000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
</form>
<script type="text/javascript">
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
</html>
@@ -0,0 +1,427 @@
using BLL;
using MiniExcelLibs;
using Model;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Web;
using System.Web.WebSockets;
namespace FineUIPro.Web.HJGL.PreDesign
{
public partial class ProductionSchedulingPlan : PageBase
{
public int pageSize = 20;
public static DataTable GridDataTable = new DataTable();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
this.InitTreeMenu();//加载树
//HJGL_PipelineComponentService.InitMainItemDownList(drpState, true);
//HJGL_PipelineComponentService.InitMainItemDownProductionStateList(drpProductionState, true);
//var pipeline = (from x in Funs.DB.HJGL_Pipeline
// where x.ProjectId == this.CurrUser.LoginProjectId
// select x.FlowingSection).Distinct().ToList();
//this.drpFlowingSection.DataTextField = "Value";
//this.drpFlowingSection.DataValueField = "Value";
//this.drpFlowingSection.DataSource = pipeline;
//this.drpFlowingSection.DataBind();
//Funs.FineUIPleaseSelect(drpFlowingSection);
}
}
#region --
/// <summary>
/// 加载树
/// </summary>
private void InitTreeMenu()
{
this.tvControlItem.Nodes.Clear();
TreeNode rootNode1 = new TreeNode();
rootNode1.NodeID = "1";
rootNode1.Text = "建筑工程";
rootNode1.CommandName = "建筑工程";
rootNode1.Selectable = false;
this.tvControlItem.Nodes.Add(rootNode1);
TreeNode rootNode2 = new TreeNode();
rootNode2.NodeID = "2";
rootNode2.Text = "安装工程";
rootNode2.CommandName = "安装工程";
rootNode2.Expanded = true;
this.tvControlItem.Nodes.Add(rootNode2);
var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
// 获取当前用户所在单位
var currUnit = pUnits.FirstOrDefault(x => x.UnitId == this.CurrUser.UnitId);
var unitWorkList = (from x in Funs.DB.WBS_UnitWork
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null
select x).ToList();
List<Model.WBS_UnitWork> unitWork1 = null;
List<Model.WBS_UnitWork> unitWork2 = null;
//// 当前为施工单位,只能操作本单位的数据
//if (currUnit != null && currUnit.UnitType == Const.ProjectUnitType_2)
//{
// unitWork1 = (from x in unitWorkList
// where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "1"
// select x).ToList();
// unitWork2 = (from x in unitWorkList
// where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "2"
// select x).ToList();
//}
//else
//{
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
//}
if (unitWork1.Count() > 0)
{
foreach (var q in unitWork1)
{
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" && x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) select x.FlowingSection).Distinct().Count();
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId;
//tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
tn1.Text = q.UnitWorkName;
tn1.ToolTip = "施工单位:" + unitNamesUnitIds;
tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
tn1.EnableClickEvent = true;
tn1.EnableExpandEvent = true;
rootNode1.Nodes.Add(tn1);
if (a > 0)
{
// BindNodes(tn1);
TreeNode newNode = new TreeNode();
newNode.Text = "加载流水段...";
newNode.NodeID = "加载流水段...";
tn1.Nodes.Add(newNode);
}
//if (a > 0)
//{
// BindNodes(tn1);
//}
}
}
if (unitWork2.Count() > 0)
{
foreach (var q in unitWork2)
{
int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == "1" && x.PipelineCode.Contains(txtPipelineCode.Text.Trim()) select x).Count();
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId;
tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
if (q.UnitWorkId == this.hdUnitWorkId.Text)
{
tn2.Expanded = true;
}
tn2.ToolTip = "施工单位:" + unitNamesUnitIds;
tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
tn2.EnableClickEvent = true;
tn2.EnableExpandEvent = true;
rootNode2.Nodes.Add(tn2);
if (a > 0)
{
// BindNodes(tn1);
TreeNode newNode = new TreeNode();
newNode.Text = "加载流水段...";
newNode.NodeID = "加载流水段...";
tn2.Nodes.Add(newNode);
}
//if (a > 0)
//{
// BindNodes(tn2);
//}
}
}
}
private void BindNodes(TreeNode node)
{
List<Model.HJGL_Pipeline> pipeline = new List<Model.HJGL_Pipeline>();
var pipelines = from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.PipeArea == "1" select x;
pipeline = (from x in pipelines
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID && x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
orderby x.PipelineCode
select x).ToList();
int pageindex = int.Parse(node.CommandName.Split('|')[0]);
int pageCount = int.Parse(node.CommandName.Split('|')[1]);
if (pageindex <= pageCount)
{
pipeline = pipeline.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList();
foreach (var item in pipeline)
{
var comCount = (from x in Funs.DB.HJGL_Pipeline_Component where x.PipelineId == item.PipelineId select x).Count();
TreeNode newNode = new TreeNode();
newNode.Text = item.PipelineCode + "【" + comCount.ToString() + " " + "组件" + "】";
newNode.ToolTip = "管线号【组件数】";
newNode.CommandName = "管线";
newNode.NodeID = item.PipelineId;
newNode.EnableClickEvent = true;
node.Nodes.Add(newNode);
}
if (pageindex < pageCount)
{
TreeNode newNode = new TreeNode();
newNode.Text = "加载";
newNode.NodeID = SQLHelper.GetNewID();
newNode.CommandName = "加载";
newNode.Icon = Icon.ArrowDown;
newNode.EnableClickEvent = true;
node.Nodes.Add(newNode);
}
}
}
#endregion
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
{
if (e.Node.Nodes[0].NodeID == "加载流水段...")
{
e.Node.Nodes.Clear();
BindNodes(e.Node);
}
}
#region TreeView
/// <summary>
/// 点击TreeView
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
{
if (e.CommandName.Split('|').Length == 2)
{
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNodeID;
}
else if (e.CommandName == "管线")
{
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID);
this.hdUnitWorkId.Text = string.Empty;
if (pipeline != null)
{
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
SaveProductionSchedulingPlan();
}
}
else if (e.CommandName == "加载")
{
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);
BindNodes(e.Node.ParentNode);
}
this.BindGrid();
}
/// <summary>
/// 保存数据
/// </summary>
/// <exception cref="NotImplementedException"></exception>
private void SaveProductionSchedulingPlan()
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
var schedulingPlan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlanByPipelineId(this.CurrUser.LoginProjectId, this.tvControlItem.SelectedNodeID);
if (schedulingPlan == null)
{
Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan();
newPlan.ProductionSchedulingPlanId = SQLHelper.GetNewID(typeof(Model.HJGL_ProductionSchedulingPlan));
newPlan.ProjectId = this.CurrUser.LoginProjectId;
newPlan.PipelineId = this.tvControlItem.SelectedNodeID;
var pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID);
if (pipeline!=null)
{
newPlan.FlowNum = pipeline.FlowingSection;
if (!string.IsNullOrEmpty(pipeline.UnitWorkId))
{
newPlan.MainItemName = BLL.UnitWorkService.getUnitWorkByUnitWorkId(pipeline.UnitWorkId).UnitWorkName;
}
if (!string.IsNullOrEmpty(pipeline.PipingClassId))
{
newPlan.Material = BLL.Base_PipingClassService.GetPipingClassByPipingClassId(pipeline.PipingClassId).SteelType;
}
}
BLL.ProductionSchedulingPlanService.AddProductionSchedulingPlan(newPlan);
}
}
}
#endregion
#region
/// <summary>
/// 数据绑定
/// </summary>
private void BindGrid()
{
if (tvControlItem.SelectedNode == null) return;
string strSql = @"SELECT p.ProductionSchedulingPlanId,
p.ProjectId,
p.PipelineId,
p.FlowNum,
p.MainItemName,
p.Material,
p.Caliber,
p.Dain,
p.TotalDyne,
p.TotalPriority,
p.PriorityTotalDyne,
p.PlanStartDate,
p.PlanEndDate,
p.Days,
p.AvgDailyWorkload,
pipeline.UnitWorkId
FROM HJGL_ProductionSchedulingPlan p
left join HJGL_Pipeline as pipeline on pipeline.PipelineId = p.PipelineId
WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2)
{
strSql += " and pipeline.UnitWorkId =@UnitWorkId";
listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNodeID));
}
else if (tvControlItem.SelectedNode.CommandName == "管线")
{
strSql += " and p.PipelineId = @PipelineId ";
listStr.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
GridDataTable = tb;
// 2.获取当前分页数据
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region
#region
/// <summary>
/// 页索引改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 分页选择下拉改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
#endregion
#endregion
#region
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
this.BindGrid();
}
protected void btnTreeFind_Click(object sender, EventArgs e)
{
this.InitTreeMenu();
}
#endregion
#region
/// <summary>
/// 保存
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (this.Grid1.Rows.Count > 0)
{
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int i = mergedRow.Value<int>("index");
string rowId = Grid1.Rows[i].RowID;
var newPlan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlanById(rowId);
if (newPlan != null)
{
newPlan.TotalPriority = values.Value<string>("TotalPriority");
newPlan.PriorityTotalDyne = Funs.GetNewDecimal(values.Value<string>("PriorityTotalDyne"));
newPlan.PlanStartDate = Funs.GetNewDateTime(values.Value<string>("PlanStartDate"));
newPlan.PlanEndDate = Funs.GetNewDateTime(values.Value<string>("PlanEndDate"));
newPlan.Days = Funs.GetNewInt(values.Value<string>("Days"));
newPlan.AvgDailyWorkload = Funs.GetNewDecimal(values.Value<string>("AvgDailyWorkload"));
BLL.ProductionSchedulingPlanService.UpdateProductionSchedulingPlan(newPlan);
}
}
ShowNotify("保存成功!", MessageBoxIcon.Success);
BindGrid();
}
}
#endregion
#region
protected void btnOut_Click(object sender, EventArgs e)
{
}
#endregion
}
}
@@ -0,0 +1,233 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HJGL.PreDesign
{
public partial class ProductionSchedulingPlan
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelLeftRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelLeftRegion;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// txtPipelineCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipelineCode;
/// <summary>
/// hdUnitWorkId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdUnitWorkId;
/// <summary>
/// btnTreeFind 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnTreeFind;
/// <summary>
/// tvControlItem 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Tree tvControlItem;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Toolbar3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// txtTotalPriority 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtTotalPriority;
/// <summary>
/// txtPriorityTotalDyne 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtPriorityTotalDyne;
/// <summary>
/// txtPlanStartDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtPlanStartDate;
/// <summary>
/// txtPlanEndDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtPlanEndDate;
/// <summary>
/// txtDays 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtDays;
/// <summary>
/// txtAvgDailyWorkload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtAvgDailyWorkload;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
}
}
+1
View File
@@ -16,6 +16,7 @@
<TreeNode id="F18CFC0E-47E0-477A-9AB3-72B88D438299" Text="堆场规划" NavigateUrl="HJGL/PreDesign/YardPlanning.aspx"></TreeNode>
<TreeNode id="25DED954-10C9-47CC-99F2-C44FDE9E0A81" Text="包装管理" NavigateUrl="HJGL/PreDesign/PackagingManage.aspx"></TreeNode>
<TreeNode id="EEC0D060-C15E-4D25-B015-C2B91F735DAC" Text="车次管理" NavigateUrl="HJGL/PreDesign/TrainNumberManager.aspx"></TreeNode>
<TreeNode id="53948077-B51D-4FF3-BFB0-AB4E27C42875" Text="排产计划" NavigateUrl="HJGL/PreDesign/ProductionSchedulingPlan.aspx"></TreeNode>
<TreeNode id="BD9C587E-17C2-49F1-82AE-A05117E41D89" Text="安装清单" NavigateUrl="HJGL/PreDesign/InstallList.aspx"></TreeNode>
</TreeNode>
<TreeNode id="9B828E92-733B-4AF9-9DD0-55ECD8B64AB8" Text="材料管理" NavigateUrl=""><TreeNode id="E29C1839-3530-45EC-A752-B26A0027E2CD" Text="入库管理" NavigateUrl=""><TreeNode id="324C72AF-447A-4308-AFB7-ABF788C58240" Text="入库申请" NavigateUrl="CLGL/InPlanMaster.aspx"></TreeNode>
+547
View File
@@ -686,6 +686,9 @@ namespace Model
partial void InsertHJGL_PreWeldingDaily(HJGL_PreWeldingDaily instance);
partial void UpdateHJGL_PreWeldingDaily(HJGL_PreWeldingDaily instance);
partial void DeleteHJGL_PreWeldingDaily(HJGL_PreWeldingDaily instance);
partial void InsertHJGL_ProductionSchedulingPlan(HJGL_ProductionSchedulingPlan instance);
partial void UpdateHJGL_ProductionSchedulingPlan(HJGL_ProductionSchedulingPlan instance);
partial void DeleteHJGL_ProductionSchedulingPlan(HJGL_ProductionSchedulingPlan instance);
partial void InsertHJGL_RepairRecord(HJGL_RepairRecord instance);
partial void UpdateHJGL_RepairRecord(HJGL_RepairRecord instance);
partial void DeleteHJGL_RepairRecord(HJGL_RepairRecord instance);
@@ -3646,6 +3649,14 @@ namespace Model
}
}
public System.Data.Linq.Table<HJGL_ProductionSchedulingPlan> HJGL_ProductionSchedulingPlan
{
get
{
return this.GetTable<HJGL_ProductionSchedulingPlan>();
}
}
public System.Data.Linq.Table<HJGL_RepairRecord> HJGL_RepairRecord
{
get
@@ -24315,6 +24326,8 @@ namespace Model
private EntitySet<HJGL_Pipeline> _HJGL_Pipeline;
private EntitySet<HJGL_ProductionSchedulingPlan> _HJGL_ProductionSchedulingPlan;
private EntitySet<HJGL_RepairRecord> _HJGL_RepairRecord;
private EntitySet<HJGL_WeldJoint> _HJGL_WeldJoint;
@@ -24681,6 +24694,7 @@ namespace Model
this._HJGL_MaterialManage = new EntitySet<HJGL_MaterialManage>(new Action<HJGL_MaterialManage>(this.attach_HJGL_MaterialManage), new Action<HJGL_MaterialManage>(this.detach_HJGL_MaterialManage));
this._HJGL_PC_PurgingCleaning = new EntitySet<HJGL_PC_PurgingCleaning>(new Action<HJGL_PC_PurgingCleaning>(this.attach_HJGL_PC_PurgingCleaning), new Action<HJGL_PC_PurgingCleaning>(this.detach_HJGL_PC_PurgingCleaning));
this._HJGL_Pipeline = new EntitySet<HJGL_Pipeline>(new Action<HJGL_Pipeline>(this.attach_HJGL_Pipeline), new Action<HJGL_Pipeline>(this.detach_HJGL_Pipeline));
this._HJGL_ProductionSchedulingPlan = new EntitySet<HJGL_ProductionSchedulingPlan>(new Action<HJGL_ProductionSchedulingPlan>(this.attach_HJGL_ProductionSchedulingPlan), new Action<HJGL_ProductionSchedulingPlan>(this.detach_HJGL_ProductionSchedulingPlan));
this._HJGL_RepairRecord = new EntitySet<HJGL_RepairRecord>(new Action<HJGL_RepairRecord>(this.attach_HJGL_RepairRecord), new Action<HJGL_RepairRecord>(this.detach_HJGL_RepairRecord));
this._HJGL_WeldJoint = new EntitySet<HJGL_WeldJoint>(new Action<HJGL_WeldJoint>(this.attach_HJGL_WeldJoint), new Action<HJGL_WeldJoint>(this.detach_HJGL_WeldJoint));
this._HJGL_HotProess_Trust = new EntitySet<HJGL_HotProess_Trust>(new Action<HJGL_HotProess_Trust>(this.attach_HJGL_HotProess_Trust), new Action<HJGL_HotProess_Trust>(this.detach_HJGL_HotProess_Trust));
@@ -26252,6 +26266,19 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HJGL_ProductionSchedulingPlan_Base_Project", Storage="_HJGL_ProductionSchedulingPlan", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")]
public EntitySet<HJGL_ProductionSchedulingPlan> HJGL_ProductionSchedulingPlan
{
get
{
return this._HJGL_ProductionSchedulingPlan;
}
set
{
this._HJGL_ProductionSchedulingPlan.Assign(value);
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HJGL_RepairRecord_Base_Project", Storage="_HJGL_RepairRecord", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")]
public EntitySet<HJGL_RepairRecord> HJGL_RepairRecord
{
@@ -28502,6 +28529,18 @@ namespace Model
entity.Base_Project = null;
}
private void attach_HJGL_ProductionSchedulingPlan(HJGL_ProductionSchedulingPlan entity)
{
this.SendPropertyChanging();
entity.Base_Project = this;
}
private void detach_HJGL_ProductionSchedulingPlan(HJGL_ProductionSchedulingPlan entity)
{
this.SendPropertyChanging();
entity.Base_Project = null;
}
private void attach_HJGL_RepairRecord(HJGL_RepairRecord entity)
{
this.SendPropertyChanging();
@@ -97327,6 +97366,8 @@ namespace Model
private EntitySet<HJGL_PipeLineMat> _HJGL_PipeLineMat;
private EntitySet<HJGL_ProductionSchedulingPlan> _HJGL_ProductionSchedulingPlan;
private EntitySet<HJGL_WeldJoint> _HJGL_WeldJoint;
private EntitySet<PTP_BItemEndCheck> _PTP_BItemEndCheck;
@@ -97422,6 +97463,7 @@ namespace Model
this._HJGL_Pipeline_Component = new EntitySet<HJGL_Pipeline_Component>(new Action<HJGL_Pipeline_Component>(this.attach_HJGL_Pipeline_Component), new Action<HJGL_Pipeline_Component>(this.detach_HJGL_Pipeline_Component));
this._WBS_UnitWork = default(EntityRef<WBS_UnitWork>);
this._HJGL_PipeLineMat = new EntitySet<HJGL_PipeLineMat>(new Action<HJGL_PipeLineMat>(this.attach_HJGL_PipeLineMat), new Action<HJGL_PipeLineMat>(this.detach_HJGL_PipeLineMat));
this._HJGL_ProductionSchedulingPlan = new EntitySet<HJGL_ProductionSchedulingPlan>(new Action<HJGL_ProductionSchedulingPlan>(this.attach_HJGL_ProductionSchedulingPlan), new Action<HJGL_ProductionSchedulingPlan>(this.detach_HJGL_ProductionSchedulingPlan));
this._HJGL_WeldJoint = new EntitySet<HJGL_WeldJoint>(new Action<HJGL_WeldJoint>(this.attach_HJGL_WeldJoint), new Action<HJGL_WeldJoint>(this.detach_HJGL_WeldJoint));
this._PTP_BItemEndCheck = new EntitySet<PTP_BItemEndCheck>(new Action<PTP_BItemEndCheck>(this.attach_PTP_BItemEndCheck), new Action<PTP_BItemEndCheck>(this.detach_PTP_BItemEndCheck));
this._PTP_ItemEndCheck = new EntitySet<PTP_ItemEndCheck>(new Action<PTP_ItemEndCheck>(this.attach_PTP_ItemEndCheck), new Action<PTP_ItemEndCheck>(this.detach_PTP_ItemEndCheck));
@@ -98458,6 +98500,19 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HJGL_ProductionSchedulingPlan_HJGL_Pipeline", Storage="_HJGL_ProductionSchedulingPlan", ThisKey="PipelineId", OtherKey="PipelineId", DeleteRule="NO ACTION")]
public EntitySet<HJGL_ProductionSchedulingPlan> HJGL_ProductionSchedulingPlan
{
get
{
return this._HJGL_ProductionSchedulingPlan;
}
set
{
this._HJGL_ProductionSchedulingPlan.Assign(value);
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HJGL_WeldJoint_HJGL_Pipeline", Storage="_HJGL_WeldJoint", ThisKey="PipelineId", OtherKey="PipelineId", DeleteRule="NO ACTION")]
public EntitySet<HJGL_WeldJoint> HJGL_WeldJoint
{
@@ -98590,6 +98645,18 @@ namespace Model
entity.HJGL_Pipeline = null;
}
private void attach_HJGL_ProductionSchedulingPlan(HJGL_ProductionSchedulingPlan entity)
{
this.SendPropertyChanging();
entity.HJGL_Pipeline = this;
}
private void detach_HJGL_ProductionSchedulingPlan(HJGL_ProductionSchedulingPlan entity)
{
this.SendPropertyChanging();
entity.HJGL_Pipeline = null;
}
private void attach_HJGL_WeldJoint(HJGL_WeldJoint entity)
{
this.SendPropertyChanging();
@@ -99970,6 +100037,486 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HJGL_ProductionSchedulingPlan")]
public partial class HJGL_ProductionSchedulingPlan : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private string _ProductionSchedulingPlanId;
private string _ProjectId;
private string _PipelineId;
private string _FlowNum;
private string _MainItemName;
private string _Material;
private string _Caliber;
private System.Nullable<decimal> _Dain;
private System.Nullable<decimal> _TotalDyne;
private string _TotalPriority;
private System.Nullable<decimal> _PriorityTotalDyne;
private System.Nullable<System.DateTime> _PlanStartDate;
private System.Nullable<System.DateTime> _PlanEndDate;
private System.Nullable<int> _Days;
private System.Nullable<decimal> _AvgDailyWorkload;
private EntityRef<Base_Project> _Base_Project;
private EntityRef<HJGL_Pipeline> _HJGL_Pipeline;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnProductionSchedulingPlanIdChanging(string value);
partial void OnProductionSchedulingPlanIdChanged();
partial void OnProjectIdChanging(string value);
partial void OnProjectIdChanged();
partial void OnPipelineIdChanging(string value);
partial void OnPipelineIdChanged();
partial void OnFlowNumChanging(string value);
partial void OnFlowNumChanged();
partial void OnMainItemNameChanging(string value);
partial void OnMainItemNameChanged();
partial void OnMaterialChanging(string value);
partial void OnMaterialChanged();
partial void OnCaliberChanging(string value);
partial void OnCaliberChanged();
partial void OnDainChanging(System.Nullable<decimal> value);
partial void OnDainChanged();
partial void OnTotalDyneChanging(System.Nullable<decimal> value);
partial void OnTotalDyneChanged();
partial void OnTotalPriorityChanging(string value);
partial void OnTotalPriorityChanged();
partial void OnPriorityTotalDyneChanging(System.Nullable<decimal> value);
partial void OnPriorityTotalDyneChanged();
partial void OnPlanStartDateChanging(System.Nullable<System.DateTime> value);
partial void OnPlanStartDateChanged();
partial void OnPlanEndDateChanging(System.Nullable<System.DateTime> value);
partial void OnPlanEndDateChanged();
partial void OnDaysChanging(System.Nullable<int> value);
partial void OnDaysChanged();
partial void OnAvgDailyWorkloadChanging(System.Nullable<decimal> value);
partial void OnAvgDailyWorkloadChanged();
#endregion
public HJGL_ProductionSchedulingPlan()
{
this._Base_Project = default(EntityRef<Base_Project>);
this._HJGL_Pipeline = default(EntityRef<HJGL_Pipeline>);
OnCreated();
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProductionSchedulingPlanId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string ProductionSchedulingPlanId
{
get
{
return this._ProductionSchedulingPlanId;
}
set
{
if ((this._ProductionSchedulingPlanId != value))
{
this.OnProductionSchedulingPlanIdChanging(value);
this.SendPropertyChanging();
this._ProductionSchedulingPlanId = value;
this.SendPropertyChanged("ProductionSchedulingPlanId");
this.OnProductionSchedulingPlanIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")]
public string ProjectId
{
get
{
return this._ProjectId;
}
set
{
if ((this._ProjectId != value))
{
if (this._Base_Project.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnProjectIdChanging(value);
this.SendPropertyChanging();
this._ProjectId = value;
this.SendPropertyChanged("ProjectId");
this.OnProjectIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipelineId", DbType="NVarChar(50)")]
public string PipelineId
{
get
{
return this._PipelineId;
}
set
{
if ((this._PipelineId != value))
{
if (this._HJGL_Pipeline.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnPipelineIdChanging(value);
this.SendPropertyChanging();
this._PipelineId = value;
this.SendPropertyChanged("PipelineId");
this.OnPipelineIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FlowNum", DbType="NVarChar(50)")]
public string FlowNum
{
get
{
return this._FlowNum;
}
set
{
if ((this._FlowNum != value))
{
this.OnFlowNumChanging(value);
this.SendPropertyChanging();
this._FlowNum = value;
this.SendPropertyChanged("FlowNum");
this.OnFlowNumChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MainItemName", DbType="NVarChar(50)")]
public string MainItemName
{
get
{
return this._MainItemName;
}
set
{
if ((this._MainItemName != value))
{
this.OnMainItemNameChanging(value);
this.SendPropertyChanging();
this._MainItemName = value;
this.SendPropertyChanged("MainItemName");
this.OnMainItemNameChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Material", DbType="NVarChar(50)")]
public string Material
{
get
{
return this._Material;
}
set
{
if ((this._Material != value))
{
this.OnMaterialChanging(value);
this.SendPropertyChanging();
this._Material = value;
this.SendPropertyChanged("Material");
this.OnMaterialChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Caliber", DbType="NVarChar(50)")]
public string Caliber
{
get
{
return this._Caliber;
}
set
{
if ((this._Caliber != value))
{
this.OnCaliberChanging(value);
this.SendPropertyChanging();
this._Caliber = value;
this.SendPropertyChanged("Caliber");
this.OnCaliberChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Dain", DbType="Decimal(18,2)")]
public System.Nullable<decimal> Dain
{
get
{
return this._Dain;
}
set
{
if ((this._Dain != value))
{
this.OnDainChanging(value);
this.SendPropertyChanging();
this._Dain = value;
this.SendPropertyChanged("Dain");
this.OnDainChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalDyne", DbType="Decimal(18,2)")]
public System.Nullable<decimal> TotalDyne
{
get
{
return this._TotalDyne;
}
set
{
if ((this._TotalDyne != value))
{
this.OnTotalDyneChanging(value);
this.SendPropertyChanging();
this._TotalDyne = value;
this.SendPropertyChanged("TotalDyne");
this.OnTotalDyneChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalPriority", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
public string TotalPriority
{
get
{
return this._TotalPriority;
}
set
{
if ((this._TotalPriority != value))
{
this.OnTotalPriorityChanging(value);
this.SendPropertyChanging();
this._TotalPriority = value;
this.SendPropertyChanged("TotalPriority");
this.OnTotalPriorityChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PriorityTotalDyne", DbType="Decimal(18,2)")]
public System.Nullable<decimal> PriorityTotalDyne
{
get
{
return this._PriorityTotalDyne;
}
set
{
if ((this._PriorityTotalDyne != value))
{
this.OnPriorityTotalDyneChanging(value);
this.SendPropertyChanging();
this._PriorityTotalDyne = value;
this.SendPropertyChanged("PriorityTotalDyne");
this.OnPriorityTotalDyneChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlanStartDate", DbType="DateTime")]
public System.Nullable<System.DateTime> PlanStartDate
{
get
{
return this._PlanStartDate;
}
set
{
if ((this._PlanStartDate != value))
{
this.OnPlanStartDateChanging(value);
this.SendPropertyChanging();
this._PlanStartDate = value;
this.SendPropertyChanged("PlanStartDate");
this.OnPlanStartDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlanEndDate", DbType="DateTime")]
public System.Nullable<System.DateTime> PlanEndDate
{
get
{
return this._PlanEndDate;
}
set
{
if ((this._PlanEndDate != value))
{
this.OnPlanEndDateChanging(value);
this.SendPropertyChanging();
this._PlanEndDate = value;
this.SendPropertyChanged("PlanEndDate");
this.OnPlanEndDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Days", DbType="Int")]
public System.Nullable<int> Days
{
get
{
return this._Days;
}
set
{
if ((this._Days != value))
{
this.OnDaysChanging(value);
this.SendPropertyChanging();
this._Days = value;
this.SendPropertyChanged("Days");
this.OnDaysChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AvgDailyWorkload", DbType="Decimal(18,2)")]
public System.Nullable<decimal> AvgDailyWorkload
{
get
{
return this._AvgDailyWorkload;
}
set
{
if ((this._AvgDailyWorkload != value))
{
this.OnAvgDailyWorkloadChanging(value);
this.SendPropertyChanging();
this._AvgDailyWorkload = value;
this.SendPropertyChanged("AvgDailyWorkload");
this.OnAvgDailyWorkloadChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HJGL_ProductionSchedulingPlan_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
public Base_Project Base_Project
{
get
{
return this._Base_Project.Entity;
}
set
{
Base_Project previousValue = this._Base_Project.Entity;
if (((previousValue != value)
|| (this._Base_Project.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Base_Project.Entity = null;
previousValue.HJGL_ProductionSchedulingPlan.Remove(this);
}
this._Base_Project.Entity = value;
if ((value != null))
{
value.HJGL_ProductionSchedulingPlan.Add(this);
this._ProjectId = value.ProjectId;
}
else
{
this._ProjectId = default(string);
}
this.SendPropertyChanged("Base_Project");
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_HJGL_ProductionSchedulingPlan_HJGL_Pipeline", Storage="_HJGL_Pipeline", ThisKey="PipelineId", OtherKey="PipelineId", IsForeignKey=true)]
public HJGL_Pipeline HJGL_Pipeline
{
get
{
return this._HJGL_Pipeline.Entity;
}
set
{
HJGL_Pipeline previousValue = this._HJGL_Pipeline.Entity;
if (((previousValue != value)
|| (this._HJGL_Pipeline.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._HJGL_Pipeline.Entity = null;
previousValue.HJGL_ProductionSchedulingPlan.Remove(this);
}
this._HJGL_Pipeline.Entity = value;
if ((value != null))
{
value.HJGL_ProductionSchedulingPlan.Add(this);
this._PipelineId = value.PipelineId;
}
else
{
this._PipelineId = default(string);
}
this.SendPropertyChanged("HJGL_Pipeline");
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HJGL_RepairRecord")]
public partial class HJGL_RepairRecord : INotifyPropertyChanging, INotifyPropertyChanged
{