diff --git a/DataBase/版本日志/HJGLDB_DS_2026-03-30_bwj.sql b/DataBase/版本日志/HJGLDB_DS_2026-03-30_bwj.sql new file mode 100644 index 0000000..4b8439c --- /dev/null +++ b/DataBase/版本日志/HJGLDB_DS_2026-03-30_bwj.sql @@ -0,0 +1,141 @@ + +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuModule) +values('D4E0EBE8-C13B-4E61-8765-EE7BA77BFAB1','ܵѹһ','SYBData/PressureTestPackageList.aspx',40,'3EAFF140-E5CA-4978-B83D-D2C9F36E0D52','3') +go +insert into ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('246D9514-04C2-410F-A9B9-47FB4A2FB2C9','D4E0EBE8-C13B-4E61-8765-EE7BA77BFAB1','',1) +insert into ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('0970DAF6-0BEC-4362-871E-E2B2036CFD13','D4E0EBE8-C13B-4E61-8765-EE7BA77BFAB1','޸',2) +insert into ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('0171DAC6-F8C9-4803-B934-48F824A6F332','D4E0EBE8-C13B-4E61-8765-EE7BA77BFAB1','ɾ',3) +insert into ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('4E8F0CB9-BF6B-4041-AD7C-9D8E917D2F48','D4E0EBE8-C13B-4E61-8765-EE7BA77BFAB1','',4) +go + +CREATE TABLE [dbo].[SYBData_PressureTestPackageList]( + [PressureTestPackageListId] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [SerialNumber] [nvarchar](50) NULL, + [PipelineCode] [nvarchar](50) NULL, + [PressureTestPackageCode] [nvarchar](50) NULL, + [Remark] [nvarchar](500) NULL, + [CompileMan] [nvarchar](50) NULL, + [CompileDate] [datetime] NULL, + CONSTRAINT [PK_SYBData_PressureTestPackageList] PRIMARY KEY CLUSTERED +( + [PressureTestPackageListId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] +) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[SYBData_PressureTestPackageList] WITH CHECK ADD CONSTRAINT [FK_SYBData_PressureTestPackageList_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[SYBData_PressureTestPackageList] CHECK CONSTRAINT [FK_SYBData_PressureTestPackageList_Base_Project] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYBData_PressureTestPackageList', @level2type=N'COLUMN',@level2name=N'PressureTestPackageListId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYBData_PressureTestPackageList', @level2type=N'COLUMN',@level2name=N'ProjectId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYBData_PressureTestPackageList', @level2type=N'COLUMN',@level2name=N'SerialNumber' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ܵ/ߺ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYBData_PressureTestPackageList', @level2type=N'COLUMN',@level2name=N'PipelineCode' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ѹ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYBData_PressureTestPackageList', @level2type=N'COLUMN',@level2name=N'PressureTestPackageCode' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYBData_PressureTestPackageList', @level2type=N'COLUMN',@level2name=N'Remark' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYBData_PressureTestPackageList', @level2type=N'COLUMN',@level2name=N'CompileMan' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYBData_PressureTestPackageList', @level2type=N'COLUMN',@level2name=N'CompileDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ܵѹһ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYBData_PressureTestPackageList' +GO + +CREATE PROCEDURE [dbo].[SYB_TestPackagePipeList] +( + @projectId nvarchar(50), + @iso_no nvarchar(50)=null +) +/***************ܵѹһ*********************/ +AS +create table #SIS( +Number1 INT, +PipelineCode1 nvarchar(50), +TestPackageNo1 nvarchar(50), +Number2 INT, +PipelineCode2 nvarchar(50), +TestPackageNo2 nvarchar(50) +) + +BEGIN + DECLARE My_Cursor CURSOR + FOR SELECT ROW_NUMBER() OVER(ORDER BY pp.PipelineCode,pp.PressureTestPackageCode) AS Number, + pp.PipelineCode,pp.PressureTestPackageCode + FROM dbo.SYBData_PressureTestPackageList pp + --LEFT JOIN dbo.Pipeline_Pipeline pipe ON pipe.PipelineId = pp.PipelineId + --LEFT JOIN dbo.PTP_TestPackage pages ON pages.PTP_ID = pp.PTP_ID + WHERE pp.ProjectId=@projectId + and (pp.PipelineCode like @iso_no or @iso_no is null) + ORDER BY pp.PipelineCode,pp.PressureTestPackageCode + +OPEN My_Cursor; --α +DECLARE @Number int,@PipelineCode nvarchar(50),@TestPackageNo nvarchar(50) + +FETCH NEXT FROM My_Cursor into @Number,@PipelineCode,@TestPackageNo; --ȡһ +WHILE @@FETCH_STATUS = 0 + BEGIN + IF(@Number%2=1) + BEGIN + INSERT into #SIS values(@Number,@PipelineCode,@TestPackageNo,null,null,null) + END + ELSE + BEGIN + UPDATE #SIS SET Number2=@Number,PipelineCode2=@PipelineCode,TestPackageNo2=@TestPackageNo + WHERE Number1=@Number-1 + END + FETCH NEXT FROM My_Cursor into @Number,@PipelineCode,@TestPackageNo; --ȡһ + END +CLOSE My_Cursor; --رα +DEALLOCATE My_Cursor; --ͷα + +END +SELECT * from #SIS +DROP TABLE #SIS + +GO +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuModule) +values('ECFED5F8-59ED-4CF8-9FF4-893E095CBDF8','ܵӹ¼','JGZL/PipeWeldingWorkRecord.aspx',80,'3EAFF140-E5CA-4978-B83D-D2C9F36E0D52','3') +go +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuModule) +values('720F843F-3FDD-4072-9724-B320BDB9B6E0','ܵϵͳѹʵȷϼ¼','JGZL/PressureTestOfPipelineSystemConfirmationRecord.aspx',90,'3EAFF140-E5CA-4978-B83D-D2C9F36E0D52','3') +go +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuModule) +values('91F25D94-7A6E-422E-A5C8-7485A3D8B155','ܵϵͳѹʵ¼','JGZL/PressureTestOfPipelineSystemRecord.aspx',100,'3EAFF140-E5CA-4978-B83D-D2C9F36E0D52','3') +go + +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuModule) +values('784D8370-C0E0-4C81-AC85-AA72BAB6188B','','WeldMat/BaseInfo/TeamGrouop.aspx',40,'5BEECA92-7901-4D2B-843F-2053A085B9F3','7') +go +insert into ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('954F82BE-D41F-4D82-8E05-DA853A3769D2','784D8370-C0E0-4C81-AC85-AA72BAB6188B','',1) +insert into ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('6AD64688-2927-4F9A-94B4-E5D38691C03E','784D8370-C0E0-4C81-AC85-AA72BAB6188B','޸',2) +insert into ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('69CACA4F-21A8-4C5D-8D1A-29845CF73563','784D8370-C0E0-4C81-AC85-AA72BAB6188B','ɾ',3) +insert into ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('AF575CDF-5300-4FED-91F1-59AA7731C9DF','784D8370-C0E0-4C81-AC85-AA72BAB6188B','',4) +go + +alter table Base_TeamGroup add IsUsed bit +go \ No newline at end of file diff --git a/HJGL_DS/BLL/BLL.csproj b/HJGL_DS/BLL/BLL.csproj index 8fbfeda..c14737a 100644 --- a/HJGL_DS/BLL/BLL.csproj +++ b/HJGL_DS/BLL/BLL.csproj @@ -301,6 +301,7 @@ + diff --git a/HJGL_DS/BLL/Common/BaseInfo/Base_TeamGroupService.cs b/HJGL_DS/BLL/Common/BaseInfo/Base_TeamGroupService.cs index b6a0616..2c2f63d 100644 --- a/HJGL_DS/BLL/Common/BaseInfo/Base_TeamGroupService.cs +++ b/HJGL_DS/BLL/Common/BaseInfo/Base_TeamGroupService.cs @@ -11,118 +11,28 @@ namespace BLL { public class Base_TeamGroupService { - public static Model.SGGLDB db = Funs.DB; - /// - /// 记录数 + /// 根据主键获取班组信息 /// - public static int count - { - get; - set; - } - - /// - /// 定义变量 - /// - public static IQueryable qq = from x in db.Base_TeamGroup orderby x.TeamGroupCode select x; - - /// - /// 获取分页列表 - /// - /// - /// - /// - /// - /// - public static IEnumerable getListData(string projectId, string teamGroupCode, string teamGroupName, string unitId, int startRowIndex, int maximumRows) - { - IQueryable q = qq; - if (!string.IsNullOrEmpty(teamGroupCode)) - { - q = q.Where(e => e.TeamGroupCode.Contains(teamGroupCode)); - } - if (!string.IsNullOrEmpty(teamGroupName)) - { - q = q.Where(e => e.TeamGroupName.Contains(teamGroupName)); - } - if (unitId != "0") - { - q = q.Where(e => e.UnitId == unitId); - } - - if (projectId != "0") - { - q = q.Where(e => e.ProjectId == projectId); - } - - count = q.Count(); - if (count == 0) - { - return new object[] { "" }; - } - return from x in q.Skip(startRowIndex).Take(maximumRows) - select new - { - x.TeamGroupId, - x.TeamGroupCode, - x.TeamGroupName, - UnitName = (from y in db.Base_Unit where y.UnitId == x.UnitId select y.UnitName).First(), - ProjectName = (from y in db.Base_Project where y.ProjectId == x.ProjectId select y.ProjectName).First(), - Area = (from y in db.Project_WorkArea where y.WorkAreaId == x.Area select y.WorkAreaCode).First(), - x.Remark - }; - } - - /// - /// 获取列表数 - /// - /// - /// - /// - /// - public static int GetListCount(string projectId, string teamGroupCode, string teamGroupName, string unitId) - { - return count; - } - - /// - /// 根据 - /// - /// + /// /// public static Model.Base_TeamGroup GetTeamGroupByTeamGroupId(string teamGroupId) { return Funs.DB.Base_TeamGroup.FirstOrDefault(e => e.TeamGroupId == teamGroupId); } - /// - /// 根据班组名称获取班组信息 - /// - /// - /// - public static Model.Base_TeamGroup GetTeamGroupByTeamGroupName(string projectId, string teamGroupName) - { - return Funs.DB.Base_TeamGroup.FirstOrDefault(e =>e.ProjectId==projectId && e.TeamGroupName == teamGroupName); - } - /// /// 添加班组信息 /// - /// + /// public static void AddTeamGroup(Model.Base_TeamGroup teamGroup) { - Model.SGGLDB db = Funs.DB; - string newKeyID = SQLHelper.GetNewID(typeof(Model.Base_TeamGroup)); - Model.Base_TeamGroup newTeamGroup = new Model.Base_TeamGroup(); - newTeamGroup.TeamGroupId = newKeyID; + SGGLDB db = Funs.DB; + Model.Base_TeamGroup newTeamGroup = new Base_TeamGroup(); + newTeamGroup.TeamGroupId = teamGroup.TeamGroupId; newTeamGroup.TeamGroupCode = teamGroup.TeamGroupCode; newTeamGroup.TeamGroupName = teamGroup.TeamGroupName; - newTeamGroup.UnitId = teamGroup.UnitId; - newTeamGroup.ProjectId = teamGroup.ProjectId; - newTeamGroup.Remark = teamGroup.Remark; - newTeamGroup.Area = teamGroup.Area; - + newTeamGroup.IsUsed = teamGroup.IsUsed; db.Base_TeamGroup.InsertOnSubmit(newTeamGroup); db.SubmitChanges(); } @@ -133,27 +43,42 @@ namespace BLL /// public static void UpdateTeamGroup(Model.Base_TeamGroup teamGroup) { - Model.SGGLDB db = Funs.DB; - Model.Base_TeamGroup newTeamGroup = db.Base_TeamGroup.First(e => e.TeamGroupId == teamGroup.TeamGroupId); - newTeamGroup.TeamGroupCode = teamGroup.TeamGroupCode; - newTeamGroup.TeamGroupName = teamGroup.TeamGroupName; - newTeamGroup.UnitId = teamGroup.UnitId; - newTeamGroup.ProjectId = teamGroup.ProjectId; - newTeamGroup.Remark = teamGroup.Remark; - newTeamGroup.Area = teamGroup.Area; - - db.SubmitChanges(); + SGGLDB db = Funs.DB; + Model.Base_TeamGroup newTeamGroup = db.Base_TeamGroup.FirstOrDefault(e => e.TeamGroupId == teamGroup.TeamGroupId); + if (newTeamGroup != null) + { + newTeamGroup.TeamGroupCode = teamGroup.TeamGroupCode; + newTeamGroup.TeamGroupName = teamGroup.TeamGroupName; + newTeamGroup.IsUsed = teamGroup.IsUsed; + db.SubmitChanges(); + } } /// - /// 是否存在班组编号 + /// 根据主键删除班组信息 /// - /// - /// true-存在,false-不存在 - public static bool IsExistTeamGroupCode(string projectId, string teamGroupCode) + /// + public static void DeleteTeamGroupById(string teamGroupId) { - var q = from x in Funs.DB.Base_TeamGroup where x.ProjectId == projectId && x.TeamGroupCode == teamGroupCode select x; - if (q.Count() > 0) + SGGLDB db = Funs.DB; + Model.Base_TeamGroup teamGroup = db.Base_TeamGroup.FirstOrDefault(e => e.TeamGroupId == teamGroupId); + if (teamGroup != null) + { + db.Base_TeamGroup.DeleteOnSubmit(teamGroup); + db.SubmitChanges(); + } + } + + /// + /// 判断是否存在 + /// + /// + /// + /// + public static bool IsExitTeamGroupName(string teamGroupName, string id) + { + var q = Funs.DB.Base_TeamGroup.FirstOrDefault(x => x.TeamGroupName == teamGroupName && x.TeamGroupId != id); + if (q != null) { return true; } @@ -162,33 +87,6 @@ namespace BLL return false; } } - - /// - /// 删除班组信息 - /// - /// - public static void DeleteTeamGroup(string teamGroupId) - { - Model.SGGLDB db = Funs.DB; - Model.Base_TeamGroup teamGroup = db.Base_TeamGroup.First(e => e.TeamGroupId == teamGroupId); - db.Base_TeamGroup.DeleteOnSubmit(teamGroup); - db.SubmitChanges(); - } - - /// - /// 根据单位Id和项目ID查询班组信息 - /// - /// 项目Id - /// 单位Id - /// 班组信息 - public static List GetTeamGroupByUnit(string projectId, string unitId) - { - return (from x in Funs.DB.Base_TeamGroup - where x.ProjectId==projectId && x.UnitId==unitId - orderby x.TeamGroupCode - select x).ToList(); - } - /// /// 根据单位Id和项目ID查询班组信息 /// @@ -198,6 +96,7 @@ namespace BLL public static List GetTeamGroupByUnit() { return (from x in Funs.DB.Base_TeamGroup + where x.IsUsed == true orderby x.TeamGroupCode select x).ToList(); } diff --git a/HJGL_DS/BLL/Common/Const.cs b/HJGL_DS/BLL/Common/Const.cs index 252837d..59b8677 100644 --- a/HJGL_DS/BLL/Common/Const.cs +++ b/HJGL_DS/BLL/Common/Const.cs @@ -1641,6 +1641,11 @@ namespace BLL /// 供应商信息 /// public const string CLGL_SupplierMenuId = "6B118D39-8B13-423C-A063-4C474E66FB90"; + + /// + /// 班组设置 + /// + public const string CLGL_TeamGroupMenuId = "784D8370-C0E0-4C81-AC85-AA72BAB6188B"; #endregion #region 库存维护 @@ -1932,6 +1937,11 @@ namespace BLL /// 工艺管道试压包报审/报验申请表 /// public const string SYBData_ApplicationFormMenuId = "71F70139-5281-480D-9787-7065BDA8A290"; + + /// + /// 管道试压包一览表 + /// + public const string SYBData_PressureTestPackageListMenuId = "D4E0EBE8-C13B-4E61-8765-EE7BA77BFAB1"; #endregion #region 报表对应ID diff --git a/HJGL_DS/BLL/SYBData/PressureTestPackageListService.cs b/HJGL_DS/BLL/SYBData/PressureTestPackageListService.cs new file mode 100644 index 0000000..5fac18c --- /dev/null +++ b/HJGL_DS/BLL/SYBData/PressureTestPackageListService.cs @@ -0,0 +1,60 @@ +using Model; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// 管道试压包一览表 + /// + public class PressureTestPackageListService + { + /// + /// 根据项目Id获取一览表信息 + /// + /// + /// + public static List GetListsByProjectId(string projectId) + { + return (from x in Funs.DB.SYBData_PressureTestPackageList where x.ProjectId == projectId select x).ToList(); + } + + /// + /// 添加试压包一览表 + /// + /// + public static void AddLists(Model.SYBData_PressureTestPackageList list) + { + SGGLDB db = Funs.DB; + Model.SYBData_PressureTestPackageList newLists = new SYBData_PressureTestPackageList(); + newLists.PressureTestPackageListId = list.PressureTestPackageListId; + newLists.ProjectId = list.ProjectId; + newLists.SerialNumber = list.SerialNumber; + newLists.PipelineCode = list.PipelineCode; + newLists.PressureTestPackageCode = list.PressureTestPackageCode; + newLists.Remark = list.Remark; + newLists.CompileMan = list.CompileMan; + newLists.CompileDate = list.CompileDate; + db.SYBData_PressureTestPackageList.InsertOnSubmit(newLists); + db.SubmitChanges(); + } + + /// + /// 根据项目Id删除一览表信息 + /// + /// + public static void DeleteListsByProjectId(string projectId) + { + SGGLDB db = Funs.DB; + var list = (from x in db.SYBData_PressureTestPackageList where x.ProjectId == projectId select x).ToList(); + if (list.Count > 0) + { + db.SYBData_PressureTestPackageList.DeleteAllOnSubmit(list); + db.SubmitChanges(); + } + } + } +} diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/SYBData/管道试压包一览表.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/SYBData/管道试压包一览表.frx new file mode 100644 index 0000000..28d2400 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/SYBData/管道试压包一览表.frx @@ -0,0 +1,156 @@ + + + using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Data; +using FastReport; +using FastReport.Data; +using FastReport.Dialog; +using FastReport.Barcode; +using FastReport.Table; +using FastReport.Utils; + +namespace FastReport +{ + public class ReportScript + { + + private void Table3_ManualBuild(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("Data"); + // init the data source + rowData.Init(); + + // print the first table row - it is a header + + // now enumerate the data source and print the table body + while (rowData.HasMoreRows) + { + // print the table body + Table3.PrintRow(0); + Table3.PrintColumns(); + + // go next data source row + rowData.Next(); + } + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj index fc999c7..4e853cd 100644 --- a/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj +++ b/HJGL_DS/FineUIPro.Web/FineUIPro.Web.csproj @@ -1362,6 +1362,7 @@ + @@ -1380,6 +1381,7 @@ + @@ -7244,6 +7246,13 @@ WelderTrain.aspx + + PressureTestPackageList.aspx + ASPXCodeBehind + + + PressureTestPackageList.aspx + SYBDataList.aspx ASPXCodeBehind @@ -7367,6 +7376,13 @@ Supplier.aspx + + TeamGrouop.aspx + ASPXCodeBehind + + + TeamGrouop.aspx + UnitStore.aspx ASPXCodeBehind diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx new file mode 100644 index 0000000..bb2cd33 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx @@ -0,0 +1,102 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PressureTestPackageList.aspx.cs" Inherits="FineUIPro.Web.SYBData.PressureTestPackageList" %> + + + + + + + 管道试压包一览表 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx.cs b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx.cs new file mode 100644 index 0000000..27d3abe --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx.cs @@ -0,0 +1,463 @@ +using BLL; +using Newtonsoft.Json.Linq; +using NPOI.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.SYBData +{ + public partial class PressureTestPackageList : PageBase + { + #region 定义项 + + /// + /// 主键 + /// + private string PressureTestPackageListId + { + get { return (string)ViewState["PressureTestPackageListId"]; } + set { ViewState["PressureTestPackageListId"] = value; } + } + + /// + /// 项目Id + /// + private string ProjectId + { + get { return (string)ViewState["ProjectId"]; } + set { ViewState["ProjectId"] = value; } + } + + /// + /// 定义集合 + /// + private static List items = new List(); + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + + this.drpProjectId.DataTextField = "ProjectCode"; + this.drpProjectId.DataValueField = "ProjectId"; + this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + this.drpProjectId.DataBind(); + Funs.FineUIPleaseSelect(this.drpProjectId); + this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; + this.InitTreeMenu();//加载树 + this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + this.ProjectId = this.tvControlItem.SelectedNodeID; + + //管线 + this.drpIsoId.DataTextField = "ISO_IsoNo"; + this.drpIsoId.DataValueField = "ISO_IsoNo"; + this.drpIsoId.DataSource = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + this.drpIsoId.DataBind(); + + PageInfo(); + } + } + + private void PageInfo() + { + items.Clear(); + if (!string.IsNullOrEmpty(this.ProjectId)) + { + var reportLists = BLL.PressureTestPackageListService.GetListsByProjectId(this.ProjectId); + if (reportLists.Count > 0) + { + var isoLists = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + foreach (var item in isoLists) + { + var iso = (from x in Funs.DB.SYBData_PressureTestPackageList where x.ProjectId == this.ProjectId && x.PipelineCode == item.ISO_IsoNo select x).FirstOrDefault(); + if (iso == null) + { + Model.SYBData_PressureTestPackageList newReport = new Model.SYBData_PressureTestPackageList(); + newReport.PressureTestPackageListId = SQLHelper.GetNewID(); + newReport.ProjectId = this.ProjectId; + newReport.PipelineCode = item.ISO_IsoNo; + newReport.PressureTestPackageCode = ""; + reportLists.Add(newReport); + } + } + if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null) + { + reportLists = reportLists.Where(x => x.PipelineCode.Contains(this.drpIsoId.SelectedValue)).ToList(); + } + this.Grid1.DataSource = reportLists; + this.Grid1.DataBind(); + } + else + { + var isoLists = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + foreach (var iso in isoLists) + { + Model.SYBData_PressureTestPackageList newReport = new Model.SYBData_PressureTestPackageList(); + newReport.PressureTestPackageListId = SQLHelper.GetNewID(); + newReport.ProjectId = this.ProjectId; + newReport.PipelineCode = iso.ISO_IsoNo; + newReport.PressureTestPackageCode = ""; + items.Add(newReport); + } + if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null) + { + items = items.Where(x => x.PipelineCode.Contains(this.drpIsoId.SelectedValue)).ToList(); + } + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } + } + } + #endregion + + #region 加载树项目 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + TreeNode rootNode = new TreeNode(); + rootNode.Text = "项目"; + rootNode.ToolTip = "项目"; + rootNode.NodeID = "0"; + rootNode.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode); + + List projects = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); + + // 默认显示选中的项目 + string selectedProjectId = this.drpProjectId.SelectedValue; + if (!string.IsNullOrEmpty(selectedProjectId) && selectedProjectId != BLL.Const._Null) + { + projects = projects.Where(e => e.ProjectId == selectedProjectId).ToList(); + + // 如果项目存在,则选中该节点 + if (projects.Any()) + { + this.tvControlItem.SelectedNodeID = selectedProjectId; + } + } + + if (this.drpProjectId.SelectedValue != BLL.Const._Null) + { + projects = projects.Where(e => e.ProjectId == this.drpProjectId.SelectedValue).ToList(); + } + foreach (var item in projects) + { + TreeNode rootProjectNode = new TreeNode();//定义根节点 + rootProjectNode.Text = item.ProjectCode; + rootProjectNode.NodeID = item.ProjectId; + rootProjectNode.EnableClickEvent = true; + rootProjectNode.Expanded = true; + rootProjectNode.ToolTip = item.ProjectName; + rootProjectNode.CommandName = "项目名称"; + rootNode.Nodes.Add(rootProjectNode); + } + } + #endregion + + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + if (this.tvControlItem.SelectedNodeID != "0") + { + this.ProjectId = this.tvControlItem.SelectedNodeID; + this.BindGrid(); + } + } + #endregion + + #region 数据绑定 + /// + /// 数据绑定 + /// + private void BindGrid() + { + string strSql = @"SELECT * FROM SYBData_PressureTestPackageList where ProjectId=@projectId"; + List listStr = new List(); + listStr.Add(new SqlParameter("@projectId", this.ProjectId)); + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + #endregion + + #region 分页排序 + #region 页索引改变事件 + /// + /// 页索引改变事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + #endregion + + #region 分页选择下拉改变事件 + /// + /// 分页选择下拉改变事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + #endregion + #endregion + + #region 查询 + /// + ///查询 + /// + /// + /// + protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) + { + this.ProjectId = this.drpProjectId.SelectedValue; + this.InitTreeMenu(); + this.tvControlItem.SelectedNodeID = this.ProjectId; + BindGrid(); + } + + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 打印 + /// + /// 打印 + /// + /// + /// + protected void btnPrint_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.ProjectId)) + { + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + List listStr = new List(); + if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + { + listStr.Add(new SqlParameter("@projectId", this.tvControlItem.SelectedNodeID)); + } + if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null) + { + listStr.Add(new SqlParameter("@iso_no", "%" + this.drpIsoId.SelectedValue + "%")); + } + else + { + listStr.Add(new SqlParameter("@iso_no", null)); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunProc("SYB_TestPackagePipeList", parameter); + + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("Number1"); + dt.Columns.Add("PipelineCode1"); + dt.Columns.Add("TestPackageNo1"); + dt.Columns.Add("Number2"); + dt.Columns.Add("PipelineCode2"); + dt.Columns.Add("TestPackageNo2"); + + DataRow[] rows = tb.DefaultView.ToTable().Select(); + foreach (var row in rows) + { + var newRow = dt.NewRow(); + newRow["Number1"] = row["Number1"].ToString(); + newRow["PipelineCode1"] = row["PipelineCode1"].ToString(); + newRow["TestPackageNo1"] = row["TestPackageNo1"].ToString(); + newRow["Number2"] = row["Number2"].ToString(); + newRow["PipelineCode2"] = row["PipelineCode2"].ToString(); + newRow["TestPackageNo2"] = row["TestPackageNo2"].ToString(); + dt.Rows.Add(newRow); + } + BLL.Common.FastReportService.AddFastreportTable(dt); + + + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId).ProjectName); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + initTemplatePath = "File\\Fastreport\\SYBData\\管道试压包一览表.frx"; + if (File.Exists(rootPath + initTemplatePath)) + { + PageContext.RegisterStartupScript(WindowPrint.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + } + } + else + { + Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + #region 维护 + /// + /// 增加 + /// + /// + /// + protected void btnAdd_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + { + JArray teamGroupData = Grid1.GetMergedData(); + List list = new List(); + foreach (JObject teamGroupRow in teamGroupData) + { + JObject values = teamGroupRow.Value("values"); + list.Add(values); + } + + JObject defaultObj = new JObject + { + { "PressureTestPackageListId", Guid.NewGuid() }, + { "PipelineCode", "" }, + { "PressureTestPackageCode", "" }, + { + "Delete3", + String.Format("", + GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete)) + } + }; + list.Add(defaultObj); + Grid1.DataSource = list; + Grid1.DataBind(); + } + else + { + Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + return; + } + } + protected void Grid1_PreDataBound(object sender, EventArgs e) + { + // 设置LinkButtonField的点击客户端事件 + LinkButtonField deleteField = Grid1.FindColumn("Delete3") as LinkButtonField; + deleteField.OnClientClick = GetDeleteScriptGrid1(); + } + + /// + /// 删除提示 + /// + /// + private string GetDeleteScriptGrid1() + { + return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, + Grid1.GetDeleteSelectedRowsReference(), String.Empty); + } + + #endregion + + #region 提交按钮 + /// + /// 提交按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.SYBData_PressureTestPackageListMenuId, Const.BtnSave)) + { + items.Clear(); + BLL.PressureTestPackageListService.DeleteListsByProjectId(this.ProjectId); + JArray teamGroupData = Grid1.GetMergedData(); + int i = 0; + foreach (JObject teamGroupRow in teamGroupData) + { + JObject values = teamGroupRow.Value("values"); + int rowIndex = teamGroupRow.Value("index"); + Model.SYBData_PressureTestPackageList newDetail = new Model.SYBData_PressureTestPackageList + { + PressureTestPackageListId = values.Value("PressureTestPackageListId"), + ProjectId = this.ProjectId, + SerialNumber = (i + 1).ToString(), + PipelineCode = values.Value("PipelineCode"), + PressureTestPackageCode = values.Value("PressureTestPackageCode"), + CompileMan = this.CurrUser.UserId, + CompileDate = DateTime.Now + }; + items.Add(newDetail); + i++; + } + try + { + if (items.Count > 0) + { + Funs.DB.SYBData_PressureTestPackageList.InsertAllOnSubmit(items); + } + Funs.DB.SubmitChanges(); + } + catch (Exception) + { + return; + } + ShowNotify("保存成功!", MessageBoxIcon.Success); + //PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + protected void drpIsoId_SelectedIndexChanged(object sender, EventArgs e) + { + PageInfo(); + } + } +} \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx.designer.cs new file mode 100644 index 0000000..64c7566 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/SYBData/PressureTestPackageList.aspx.designer.cs @@ -0,0 +1,206 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.SYBData +{ + + + public partial class PressureTestPackageList + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpProjectId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProjectId; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpIsoId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpIsoId; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnAdd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAdd; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPrint; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// txtPipelineCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipelineCode; + + /// + /// txtPressureTestPackageCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPressureTestPackageCode; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// WindowPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowPrint; + } +} diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/TeamGrouop.aspx b/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/TeamGrouop.aspx new file mode 100644 index 0000000..62ce4dc --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/TeamGrouop.aspx @@ -0,0 +1,157 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TeamGrouop.aspx.cs" Inherits="FineUIPro.Web.WeldMat.BaseInfo.TeamGrouop" %> + + + + + + + 班组 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/TeamGrouop.aspx.cs b/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/TeamGrouop.aspx.cs new file mode 100644 index 0000000..a962100 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/TeamGrouop.aspx.cs @@ -0,0 +1,328 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; + +namespace FineUIPro.Web.WeldMat.BaseInfo +{ + public partial class TeamGrouop : PageBase + { + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + BindGrid(); + + } + } + #endregion + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT t.TeamGroupId,t.TeamGroupCode,t.TeamGroupName,t.IsUsed + FROM dbo.Base_TeamGroup t + WHERE 1=1"; + List listStr = new List(); + if (!string.IsNullOrEmpty(this.txtTeamGropNameS.Text.Trim())) + { + strSql += " AND t.TeamGroupName like @teamGroupName"; + listStr.Add(new SqlParameter("@teamGroupName", "%" + this.txtTeamGropNameS.Text.Trim() + "%")); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + // 2.获取当前分页数据 + //var table = this.GetPagedDataTable(Grid1, tb1); + Grid1.RecordCount = tb.Rows.Count; + tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + + Grid1.DataSource = table; + Grid1.DataBind(); + } + #endregion + + #region 分页排序 + /// + /// + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + /// + /// 分页下拉选择 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// + /// + /// + /// + protected void Grid1_FilterChange(object sender, EventArgs e) + { + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + BindGrid(); + } + #endregion + + #region 删除事件 + /// + /// 删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.CLGL_TeamGroupMenuId, Const.BtnDelete)) + { + if (judgementDelete(hfFormID.Text, true)) + { + BLL.Base_TeamGroupService.DeleteTeamGroupById(hfFormID.Text); + BLL.Sys_LogService.AddLog(BLL.Const.System_7, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除班组"); + // 重新绑定表格,并模拟点击[新增按钮] + BindGrid(); + PageContext.RegisterStartupScript("onNewButtonClick();"); + } + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.CLGL_TeamGroupMenuId, Const.BtnDelete)) + { + this.DeleteData(); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + + /// + /// 删除方法 + /// + private void DeleteData() + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + bool isShow = true; + if (Grid1.SelectedRowIndexArray.Length > 1) + { + isShow = false; + } + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + if (judgementDelete(rowID, isShow)) + { + BLL.Base_TeamGroupService.DeleteTeamGroupById(rowID); + BLL.Sys_LogService.AddLog(BLL.Const.System_7, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除班组"); + ShowNotify("删除完成!", MessageBoxIcon.Success); + } + } + + BindGrid(); + PageContext.RegisterStartupScript("onNewButtonClick();"); + } + } + #endregion + + #region 编辑 + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.CLGL_TeamGroupMenuId, Const.BtnModify)) + { + this.EditData(); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + this.txtTeamGroupCode.Text = string.Empty; + this.txtTeamGroupName.Text = string.Empty; + this.cbIsUsed.Checked = false; + + string Id = Grid1.SelectedRowID; + var teamGroup = BLL.Base_TeamGroupService.GetTeamGroupByTeamGroupId(Id); + if (teamGroup != null) + { + this.txtTeamGroupCode.Text = teamGroup.TeamGroupCode; + this.txtTeamGroupName.Text = teamGroup.TeamGroupName; + if (teamGroup.IsUsed == true) + { + this.cbIsUsed.Checked = true; + } + hfFormID.Text = Id; + this.btnDelete.Enabled = true; + } + } + #endregion + + #region 提交按钮 + /// + /// 提交按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.CLGL_TeamGroupMenuId, Const.BtnSave)) + { + string strRowID = hfFormID.Text; + if (BLL.Base_TeamGroupService.IsExitTeamGroupName(this.txtTeamGroupName.Text.Trim(),strRowID)) + { + Alert.ShowInTop("此班组名称已存在!", MessageBoxIcon.Warning); + return; + } + + Model.Base_TeamGroup teamGroup = new Model.Base_TeamGroup(); + teamGroup.TeamGroupCode = this.txtTeamGroupCode.Text.Trim(); + teamGroup.TeamGroupName = this.txtTeamGroupName.Text.Trim(); + teamGroup.IsUsed = this.cbIsUsed.Checked; + if (string.IsNullOrEmpty(strRowID)) + { + strRowID = SQLHelper.GetNewID(typeof(Model.Base_TeamGroup)); + teamGroup.TeamGroupId = strRowID; + BLL.Base_TeamGroupService.AddTeamGroup(teamGroup); + BLL.Sys_LogService.AddLog(BLL.Const.System_7, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "添加班组"); + } + else + { + teamGroup.TeamGroupId = strRowID; + BLL.Base_TeamGroupService.UpdateTeamGroup(teamGroup); + BLL.Sys_LogService.AddLog(BLL.Const.System_7, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "修改班组"); + } + + // 重新绑定表格,并点击当前编辑或者新增的行 + BindGrid(); + + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript("onNewButtonClick();"); + //PageContext.RegisterStartupScript(String.Format("F('{0}').selectRow('{1}');", Grid1.ClientID, UnitQualitySort.UnitQualitySortId)); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + #region 判断是否可删除 + /// + /// 判断是否可以删除 + /// + /// + private bool judgementDelete(string id, bool isShow) + { + string content = string.Empty; + //if (BLL.WeldInfoService.GetWeldInfoByWeldTypeId(id) > 0) + //{ + // content = "焊材信息设置中已经使用了该焊材类型,不能删除!"; + //} + if (string.IsNullOrEmpty(content)) + { + return true; + } + else + { + if (isShow) + { + Alert.ShowInTop(content, MessageBoxIcon.Error); + } + return false; + } + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region Grid行点击事件 + /// + /// Grid行点击事件 + /// + /// + /// + protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + #endregion + + } +} \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/TeamGrouop.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/TeamGrouop.aspx.designer.cs new file mode 100644 index 0000000..a42dc34 --- /dev/null +++ b/HJGL_DS/FineUIPro.Web/WeldMat/BaseInfo/TeamGrouop.aspx.designer.cs @@ -0,0 +1,215 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.WeldMat.BaseInfo +{ + + + public partial class TeamGrouop + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// txtTeamGropNameS 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTeamGropNameS; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.SimpleForm SimpleForm1; + + /// + /// hfFormID 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hfFormID; + + /// + /// txtTeamGroupCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTeamGroupCode; + + /// + /// txtTeamGroupName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTeamGroupName; + + /// + /// cbIsUsed 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBox cbIsUsed; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/HJGL_DS/FineUIPro.Web/common/ProjectSet/EditOrganization.aspx.cs b/HJGL_DS/FineUIPro.Web/common/ProjectSet/EditOrganization.aspx.cs index b74d022..42ffcef 100644 --- a/HJGL_DS/FineUIPro.Web/common/ProjectSet/EditOrganization.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/common/ProjectSet/EditOrganization.aspx.cs @@ -244,7 +244,7 @@ namespace FineUIPro.Web.common.ProjectSet foreach (int i in Grid2.GetDeletedList()) { string rowID = Grid2.DataKeys[i][0].ToString(); - BLL.Base_TeamGroupService.DeleteTeamGroup(rowID); + BLL.Base_TeamGroupService.DeleteTeamGroupById(rowID); } } diff --git a/HJGL_DS/Model/Model.cs b/HJGL_DS/Model/Model.cs index efae821..fc03a5a 100644 --- a/HJGL_DS/Model/Model.cs +++ b/HJGL_DS/Model/Model.cs @@ -605,6 +605,9 @@ namespace Model partial void InsertSYBData_FileDirectory(SYBData_FileDirectory instance); partial void UpdateSYBData_FileDirectory(SYBData_FileDirectory instance); partial void DeleteSYBData_FileDirectory(SYBData_FileDirectory instance); + partial void InsertSYBData_PressureTestPackageList(SYBData_PressureTestPackageList instance); + partial void UpdateSYBData_PressureTestPackageList(SYBData_PressureTestPackageList instance); + partial void DeleteSYBData_PressureTestPackageList(SYBData_PressureTestPackageList instance); partial void InsertSys_ButtonPower(Sys_ButtonPower instance); partial void UpdateSys_ButtonPower(Sys_ButtonPower instance); partial void DeleteSys_ButtonPower(Sys_ButtonPower instance); @@ -2547,6 +2550,14 @@ namespace Model } } + public System.Data.Linq.Table SYBData_PressureTestPackageList + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table Sys_ButtonPower { get @@ -4890,6 +4901,8 @@ namespace Model private EntitySet _SYBData_FileDirectory; + private EntitySet _SYBData_PressureTestPackageList; + private EntitySet _Weld_ProjectPlan; private EntitySet _Weld_RecycleMat; @@ -5039,6 +5052,7 @@ namespace Model this._SYBData_ApplicationForm = new EntitySet(new Action(this.attach_SYBData_ApplicationForm), new Action(this.detach_SYBData_ApplicationForm)); this._SYBData_Cover = new EntitySet(new Action(this.attach_SYBData_Cover), new Action(this.detach_SYBData_Cover)); this._SYBData_FileDirectory = new EntitySet(new Action(this.attach_SYBData_FileDirectory), new Action(this.detach_SYBData_FileDirectory)); + this._SYBData_PressureTestPackageList = new EntitySet(new Action(this.attach_SYBData_PressureTestPackageList), new Action(this.detach_SYBData_PressureTestPackageList)); this._Weld_ProjectPlan = new EntitySet(new Action(this.attach_Weld_ProjectPlan), new Action(this.detach_Weld_ProjectPlan)); this._Weld_RecycleMat = new EntitySet(new Action(this.attach_Weld_RecycleMat), new Action(this.detach_Weld_RecycleMat)); this._Weld_RecycleMatTop = new EntitySet(new Action(this.attach_Weld_RecycleMatTop), new Action(this.detach_Weld_RecycleMatTop)); @@ -6681,6 +6695,19 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_PressureTestPackageList_Base_Project", Storage="_SYBData_PressureTestPackageList", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")] + public EntitySet SYBData_PressureTestPackageList + { + get + { + return this._SYBData_PressureTestPackageList; + } + set + { + this._SYBData_PressureTestPackageList.Assign(value); + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Weld_ProjectPlan_Base_Project", Storage="_Weld_ProjectPlan", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")] public EntitySet Weld_ProjectPlan { @@ -7749,6 +7776,18 @@ namespace Model entity.Base_Project = null; } + private void attach_SYBData_PressureTestPackageList(SYBData_PressureTestPackageList entity) + { + this.SendPropertyChanging(); + entity.Base_Project = this; + } + + private void detach_SYBData_PressureTestPackageList(SYBData_PressureTestPackageList entity) + { + this.SendPropertyChanging(); + entity.Base_Project = null; + } + private void attach_Weld_ProjectPlan(Weld_ProjectPlan entity) { this.SendPropertyChanging(); @@ -7818,6 +7857,8 @@ namespace Model private string _Area; + private System.Nullable _IsUsed; + private EntityRef _Base_Project; #region 可扩展性方法定义 @@ -7838,6 +7879,8 @@ namespace Model partial void OnRemarkChanged(); partial void OnAreaChanging(string value); partial void OnAreaChanged(); + partial void OnIsUsedChanging(System.Nullable value); + partial void OnIsUsedChanged(); #endregion public Base_TeamGroup() @@ -7990,6 +8033,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsUsed", DbType="Bit")] + public System.Nullable IsUsed + { + get + { + return this._IsUsed; + } + set + { + if ((this._IsUsed != value)) + { + this.OnIsUsedChanging(value); + this.SendPropertyChanging(); + this._IsUsed = value; + this.SendPropertyChanged("IsUsed"); + this.OnIsUsedChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_TeamGroup_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -87144,7 +87207,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CertificateId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CertificateId", DbType="NVarChar(50)")] public string CertificateId { get @@ -117702,6 +117765,277 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SYBData_PressureTestPackageList")] + public partial class SYBData_PressureTestPackageList : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _PressureTestPackageListId; + + private string _ProjectId; + + private string _SerialNumber; + + private string _PipelineCode; + + private string _PressureTestPackageCode; + + private string _Remark; + + private string _CompileMan; + + private System.Nullable _CompileDate; + + private EntityRef _Base_Project; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnPressureTestPackageListIdChanging(string value); + partial void OnPressureTestPackageListIdChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnSerialNumberChanging(string value); + partial void OnSerialNumberChanged(); + partial void OnPipelineCodeChanging(string value); + partial void OnPipelineCodeChanged(); + partial void OnPressureTestPackageCodeChanging(string value); + partial void OnPressureTestPackageCodeChanged(); + partial void OnRemarkChanging(string value); + partial void OnRemarkChanged(); + partial void OnCompileManChanging(string value); + partial void OnCompileManChanged(); + partial void OnCompileDateChanging(System.Nullable value); + partial void OnCompileDateChanged(); + #endregion + + public SYBData_PressureTestPackageList() + { + this._Base_Project = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PressureTestPackageListId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string PressureTestPackageListId + { + get + { + return this._PressureTestPackageListId; + } + set + { + if ((this._PressureTestPackageListId != value)) + { + this.OnPressureTestPackageListIdChanging(value); + this.SendPropertyChanging(); + this._PressureTestPackageListId = value; + this.SendPropertyChanged("PressureTestPackageListId"); + this.OnPressureTestPackageListIdChanged(); + } + } + } + + [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="_SerialNumber", DbType="NVarChar(50)")] + public string SerialNumber + { + get + { + return this._SerialNumber; + } + set + { + if ((this._SerialNumber != value)) + { + this.OnSerialNumberChanging(value); + this.SendPropertyChanging(); + this._SerialNumber = value; + this.SendPropertyChanged("SerialNumber"); + this.OnSerialNumberChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipelineCode", DbType="NVarChar(50)")] + public string PipelineCode + { + get + { + return this._PipelineCode; + } + set + { + if ((this._PipelineCode != value)) + { + this.OnPipelineCodeChanging(value); + this.SendPropertyChanging(); + this._PipelineCode = value; + this.SendPropertyChanged("PipelineCode"); + this.OnPipelineCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PressureTestPackageCode", DbType="NVarChar(50)")] + public string PressureTestPackageCode + { + get + { + return this._PressureTestPackageCode; + } + set + { + if ((this._PressureTestPackageCode != value)) + { + this.OnPressureTestPackageCodeChanging(value); + this.SendPropertyChanging(); + this._PressureTestPackageCode = value; + this.SendPropertyChanged("PressureTestPackageCode"); + this.OnPressureTestPackageCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(500)")] + public string Remark + { + get + { + return this._Remark; + } + set + { + if ((this._Remark != value)) + { + this.OnRemarkChanging(value); + this.SendPropertyChanging(); + this._Remark = value; + this.SendPropertyChanged("Remark"); + this.OnRemarkChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileMan", DbType="NVarChar(50)")] + public string CompileMan + { + get + { + return this._CompileMan; + } + set + { + if ((this._CompileMan != value)) + { + this.OnCompileManChanging(value); + this.SendPropertyChanging(); + this._CompileMan = value; + this.SendPropertyChanged("CompileMan"); + this.OnCompileManChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileDate", DbType="DateTime")] + public System.Nullable CompileDate + { + get + { + return this._CompileDate; + } + set + { + if ((this._CompileDate != value)) + { + this.OnCompileDateChanging(value); + this.SendPropertyChanging(); + this._CompileDate = value; + this.SendPropertyChanged("CompileDate"); + this.OnCompileDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SYBData_PressureTestPackageList_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.SYBData_PressureTestPackageList.Remove(this); + } + this._Base_Project.Entity = value; + if ((value != null)) + { + value.SYBData_PressureTestPackageList.Add(this); + this._ProjectId = value.ProjectId; + } + else + { + this._ProjectId = default(string); + } + this.SendPropertyChanged("Base_Project"); + } + } + } + + 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.Sys_ButtonPower")] public partial class Sys_ButtonPower : INotifyPropertyChanging, INotifyPropertyChanged {