fix:问题修改

This commit is contained in:
geh 2025-02-19 15:09:13 +08:00
parent 8f471923bf
commit 0a70ab9af7
39 changed files with 6541 additions and 64 deletions

View File

@ -0,0 +1,334 @@
CREATE TABLE [dbo].[Technique_ProtectionStandards] (
[ProtectionStandardsId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[ProtectionStandardsCode] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ProtectionStandardsName] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[CompileMan] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CompileDate] datetime NULL,
[AttachUrl] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL,
[AuditMan] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AuditDate] datetime NULL,
[IsPass] bit NULL,
[IsBuild] bit NULL,
[UpState] char(1) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_Technique_ProtectionStandards] PRIMARY KEY CLUSTERED ([ProtectionStandardsId])
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].[Technique_ProtectionStandards] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Technique_ProtectionStandards',
'COLUMN', N'ProtectionStandardsCode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'Technique_ProtectionStandards',
'COLUMN', N'ProtectionStandardsName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'编制人',
'SCHEMA', N'dbo',
'TABLE', N'Technique_ProtectionStandards',
'COLUMN', N'CompileMan'
GO
EXEC sp_addextendedproperty
'MS_Description', N'编制日期',
'SCHEMA', N'dbo',
'TABLE', N'Technique_ProtectionStandards',
'COLUMN', N'CompileDate'
GO
EXEC sp_addextendedproperty
'MS_Description', N'附件',
'SCHEMA', N'dbo',
'TABLE', N'Technique_ProtectionStandards',
'COLUMN', N'AttachUrl'
GO
EXEC sp_addextendedproperty
'MS_Description', N'防护标准表',
'SCHEMA', N'dbo',
'TABLE', N'Technique_ProtectionStandards'
INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed], [MenuEnName])
VALUES (N'8E3A5EDC-62CA-4F64-A4E7-CD3D473A6201', N'防护标准', NULL, N'HSSE/Technique/ProtectionStandards.aspx', 90, N'D70D9BF5-C72E-414D-941B-CF9B4065F6BA', N'Menu_DigData', '1', '1', '1', NULL);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'8E3A5EDC-62CA-4F64-A4E7-CD3D473A6201', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'8E3A5EDC-62CA-4F64-A4E7-CD3D473A6201', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'8E3A5EDC-62CA-4F64-A4E7-CD3D473A6201', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'8E3A5EDC-62CA-4F64-A4E7-CD3D473A6201', N'保存', 4);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'8E3A5EDC-62CA-4F64-A4E7-CD3D473A6201', N'导出', 5);
CREATE TABLE [dbo].[Technique_SafetyResponsibilities] (
[SafetyResponsibilitiesId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[SafetyResponsibilitiesCode] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[SafetyResponsibilitiesName] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[CompileMan] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CompileDate] datetime NULL,
[AttachUrl] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL,
[AuditMan] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AuditDate] datetime NULL,
[IsPass] bit NULL,
[IsBuild] bit NULL,
[UpState] char(1) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_Technique_SafetyResponsibilities] PRIMARY KEY CLUSTERED ([SafetyResponsibilitiesId])
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].[Technique_SafetyResponsibilities] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Technique_SafetyResponsibilities',
'COLUMN', N'SafetyResponsibilitiesCode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'Technique_SafetyResponsibilities',
'COLUMN', N'SafetyResponsibilitiesName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'编制人',
'SCHEMA', N'dbo',
'TABLE', N'Technique_SafetyResponsibilities',
'COLUMN', N'CompileMan'
GO
EXEC sp_addextendedproperty
'MS_Description', N'编制日期',
'SCHEMA', N'dbo',
'TABLE', N'Technique_SafetyResponsibilities',
'COLUMN', N'CompileDate'
GO
EXEC sp_addextendedproperty
'MS_Description', N'附件',
'SCHEMA', N'dbo',
'TABLE', N'Technique_SafetyResponsibilities',
'COLUMN', N'AttachUrl'
GO
EXEC sp_addextendedproperty
'MS_Description', N'安全职责表',
'SCHEMA', N'dbo',
'TABLE', N'Technique_SafetyResponsibilities'
INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed], [MenuEnName])
VALUES (N'6D75EA6C-0E49-4B04-850B-930B628EE1DF', N'安全职责', NULL, N'HSSE/Technique/SafetyResponsibilities.aspx', 100, N'D70D9BF5-C72E-414D-941B-CF9B4065F6BA', N'Menu_DigData', '1', '1', '1', NULL);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'6D75EA6C-0E49-4B04-850B-930B628EE1DF', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'6D75EA6C-0E49-4B04-850B-930B628EE1DF', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'6D75EA6C-0E49-4B04-850B-930B628EE1DF', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'6D75EA6C-0E49-4B04-850B-930B628EE1DF', N'保存', 4);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'6D75EA6C-0E49-4B04-850B-930B628EE1DF', N'导出', 5);
CREATE TABLE [dbo].[Technique_ConstructionStandards] (
[ConstructionStandardsId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[ConstructionStandardsCode] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ConstructionStandardsName] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[CompileMan] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CompileDate] datetime NULL,
[AttachUrl] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL,
[AuditMan] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AuditDate] datetime NULL,
[IsPass] bit NULL,
[IsBuild] bit NULL,
[UpState] char(1) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_Technique_ConstructionStandards] PRIMARY KEY CLUSTERED ([ConstructionStandardsId])
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].[Technique_ConstructionStandards] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Technique_ConstructionStandards',
'COLUMN', N'ConstructionStandardsCode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'Technique_ConstructionStandards',
'COLUMN', N'ConstructionStandardsName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'编制人',
'SCHEMA', N'dbo',
'TABLE', N'Technique_ConstructionStandards',
'COLUMN', N'CompileMan'
GO
EXEC sp_addextendedproperty
'MS_Description', N'编制日期',
'SCHEMA', N'dbo',
'TABLE', N'Technique_ConstructionStandards',
'COLUMN', N'CompileDate'
GO
EXEC sp_addextendedproperty
'MS_Description', N'附件',
'SCHEMA', N'dbo',
'TABLE', N'Technique_ConstructionStandards',
'COLUMN', N'AttachUrl'
GO
EXEC sp_addextendedproperty
'MS_Description', N'队伍文明施工标准表',
'SCHEMA', N'dbo',
'TABLE', N'Technique_ConstructionStandards'
INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed], [MenuEnName])
VALUES (N'23ACEE2E-0E56-4136-9DFB-C971B3C4EA60', N'队伍文明施工标准', NULL, N'HSSE/Technique/ConstructionStandards.aspx', 110, N'D70D9BF5-C72E-414D-941B-CF9B4065F6BA', N'Menu_DigData', '1', '1', '1', NULL);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'23ACEE2E-0E56-4136-9DFB-C971B3C4EA60', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'23ACEE2E-0E56-4136-9DFB-C971B3C4EA60', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'23ACEE2E-0E56-4136-9DFB-C971B3C4EA60', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'23ACEE2E-0E56-4136-9DFB-C971B3C4EA60', N'保存', 4);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'23ACEE2E-0E56-4136-9DFB-C971B3C4EA60', N'导出', 5);
CREATE TABLE [dbo].[Technique_AwardStandards] (
[AwardStandardsId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[AwardStandardsCode] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AwardStandardsName] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL,
[CompileMan] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CompileDate] datetime NULL,
[AttachUrl] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL,
[AuditMan] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AuditDate] datetime NULL,
[IsPass] bit NULL,
[IsBuild] bit NULL,
[UpState] char(1) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_Technique_AwardStandards] PRIMARY KEY CLUSTERED ([AwardStandardsId])
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].[Technique_AwardStandards] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Technique_AwardStandards',
'COLUMN', N'AwardStandardsCode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'Technique_AwardStandards',
'COLUMN', N'AwardStandardsName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'编制人',
'SCHEMA', N'dbo',
'TABLE', N'Technique_AwardStandards',
'COLUMN', N'CompileMan'
GO
EXEC sp_addextendedproperty
'MS_Description', N'编制日期',
'SCHEMA', N'dbo',
'TABLE', N'Technique_AwardStandards',
'COLUMN', N'CompileDate'
GO
EXEC sp_addextendedproperty
'MS_Description', N'附件',
'SCHEMA', N'dbo',
'TABLE', N'Technique_AwardStandards',
'COLUMN', N'AttachUrl'
GO
EXEC sp_addextendedproperty
'MS_Description', N'奖罚标准表',
'SCHEMA', N'dbo',
'TABLE', N'Technique_AwardStandards'
INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed], [MenuEnName])
VALUES (N'E4FD28A8-9715-452F-BB16-5FF87BE7D32B', N'奖罚标准', NULL, N'HSSE/Technique/AwardStandards.aspx', 120, N'D70D9BF5-C72E-414D-941B-CF9B4065F6BA', N'Menu_DigData', '1', '1', '1', NULL);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'E4FD28A8-9715-452F-BB16-5FF87BE7D32B', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'E4FD28A8-9715-452F-BB16-5FF87BE7D32B', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'E4FD28A8-9715-452F-BB16-5FF87BE7D32B', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'E4FD28A8-9715-452F-BB16-5FF87BE7D32B', N'保存', 4);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NewID(), N'E4FD28A8-9715-452F-BB16-5FF87BE7D32B', N'导出', 5);
alter table dbo.Technique_ProtectionStandards add Remark nvarchar(500);
alter table dbo.Technique_SafetyResponsibilities add Remark nvarchar(500);
alter table dbo.Technique_ConstructionStandards add Remark nvarchar(500);
alter table dbo.Technique_AwardStandards add Remark nvarchar(500);

View File

@ -81,6 +81,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Lib\Microsoft.SQLServer.ManagedDTS.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
@ -715,13 +716,17 @@
<Compile Include="HSSE\Solution\ExpertArgumentService.cs" />
<Compile Include="HSSE\Solution\LargerHazardService.cs" />
<Compile Include="HSSE\Solution\SolutionTemplateService.cs" />
<Compile Include="HSSE\Technique\AwardStandardsService.cs" />
<Compile Include="HSSE\Technique\ConstructionStandardsService.cs" />
<Compile Include="HSSE\Technique\EmergencyService.cs" />
<Compile Include="HSSE\Technique\HazardListService.cs" />
<Compile Include="HSSE\Technique\HazardListTypeService.cs" />
<Compile Include="HSSE\Technique\EnvironmentalService.cs" />
<Compile Include="HSSE\Technique\ProtectionStandardsService.cs" />
<Compile Include="HSSE\Technique\RectifyItemService.cs" />
<Compile Include="HSSE\Technique\RectifyService.cs" />
<Compile Include="HSSE\Technique\RiskEvaluationRecordService.cs" />
<Compile Include="HSSE\Technique\SafetyResponsibilitiesService.cs" />
<Compile Include="HSSE\Technique\SpecialSchemeService.cs" />
<Compile Include="HSSE\Technique\Technique_CheckItemDetailService.cs" />
<Compile Include="HSSE\Technique\Technique_CheckItemSetService.cs" />

View File

@ -1877,6 +1877,25 @@ namespace BLL
/// 施工方案
/// </summary>
public const string SpecialSchemeMenuId = "3E2F2FFD-ED2E-4914-8370-D97A68398814";
/// <summary>
/// 防护标准
/// </summary>
public const string ProtectionStandardsMenuId = "8E3A5EDC-62CA-4F64-A4E7-CD3D473A6201";
/// <summary>
/// 安全职责
/// </summary>
public const string SafetyResponsibilitiesMenuId = "6D75EA6C-0E49-4B04-850B-930B628EE1DF";
/// <summary>
/// 队伍文明施工标准
/// </summary>
public const string ConstructionStandardsMenuId = "23ACEE2E-0E56-4136-9DFB-C971B3C4EA60";
/// <summary>
/// 奖罚标准
/// </summary>
public const string AwardStandardsMenuId = "E4FD28A8-9715-452F-BB16-5FF87BE7D32B";
#endregion
#region

View File

@ -0,0 +1,96 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL;
public class AwardStandardsService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取
/// </summary>
/// <param name="AwardStandardsId"></param>
/// <returns></returns>
public static Model.Technique_AwardStandards GetAwardStandardsListById(string AwardStandardsId)
{
return Funs.DB.Technique_AwardStandards.FirstOrDefault(e =>
e.AwardStandardsId == AwardStandardsId);
}
/// <summary>
/// 添加
/// </summary>
/// <param name="AwardStandardsList"></param>
public static void AddAwardStandardsList(Model.Technique_AwardStandards AwardStandardsList)
{
Model.SGGLDB db = Funs.DB;
Model.Technique_AwardStandards newAwardStandardsList = new Model.Technique_AwardStandards
{
AwardStandardsId = AwardStandardsList.AwardStandardsId,
AwardStandardsCode = AwardStandardsList.AwardStandardsCode,
AwardStandardsName = AwardStandardsList.AwardStandardsName,
AttachUrl = AwardStandardsList.AttachUrl,
CompileMan = AwardStandardsList.CompileMan,
CompileDate = AwardStandardsList.CompileDate,
};
newAwardStandardsList.CompileMan = AwardStandardsList.CompileMan;
newAwardStandardsList.CompileDate = AwardStandardsList.CompileDate;
newAwardStandardsList.IsPass = AwardStandardsList.IsPass;
newAwardStandardsList.UpState = AwardStandardsList.UpState;
newAwardStandardsList.Remark = AwardStandardsList.Remark;
db.Technique_AwardStandards.InsertOnSubmit(newAwardStandardsList);
db.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="AwardStandardsList"></param>
public static void UpdateAwardStandardsList(Model.Technique_AwardStandards AwardStandardsList)
{
Model.SGGLDB db = Funs.DB;
Model.Technique_AwardStandards newAwardStandardsList =
db.Technique_AwardStandards.FirstOrDefault(e =>
e.AwardStandardsId == AwardStandardsList.AwardStandardsId);
if (newAwardStandardsList != null)
{
newAwardStandardsList.AwardStandardsCode = AwardStandardsList.AwardStandardsCode;
newAwardStandardsList.AwardStandardsName = AwardStandardsList.AwardStandardsName;
newAwardStandardsList.AttachUrl = AwardStandardsList.AttachUrl;
newAwardStandardsList.CompileMan = AwardStandardsList.CompileMan;
newAwardStandardsList.CompileDate = AwardStandardsList.CompileDate;
newAwardStandardsList.UpState = AwardStandardsList.UpState;
newAwardStandardsList.Remark = AwardStandardsList.Remark;
db.SubmitChanges();
}
}
/// <summary>
///根据主键删除
/// </summary>
/// <param name="AwardStandardsId"></param>
public static void DeleteAwardStandardsListById(string AwardStandardsId)
{
Model.SGGLDB db = Funs.DB;
Model.Technique_AwardStandards AwardStandardsList =
db.Technique_AwardStandards.FirstOrDefault(e => e.AwardStandardsId == AwardStandardsId);
if (AwardStandardsList != null)
{
if (!string.IsNullOrEmpty(AwardStandardsList.AttachUrl))
{
BLL.UploadFileService.DeleteFile(Funs.RootPath, AwardStandardsList.AttachUrl);
}
////删除附件表
BLL.CommonService.DeleteAttachFileById(AwardStandardsList.AwardStandardsId);
db.Technique_AwardStandards.DeleteOnSubmit(AwardStandardsList);
db.SubmitChanges();
}
}
}

View File

@ -0,0 +1,96 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL;
public class ConstructionStandardsService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取
/// </summary>
/// <param name="ConstructionStandardsId"></param>
/// <returns></returns>
public static Model.Technique_ConstructionStandards GetConstructionStandardsListById(string ConstructionStandardsId)
{
return Funs.DB.Technique_ConstructionStandards.FirstOrDefault(e =>
e.ConstructionStandardsId == ConstructionStandardsId);
}
/// <summary>
/// 添加
/// </summary>
/// <param name="ConstructionStandardsList"></param>
public static void AddConstructionStandardsList(Model.Technique_ConstructionStandards ConstructionStandardsList)
{
Model.SGGLDB db = Funs.DB;
Model.Technique_ConstructionStandards newConstructionStandardsList = new Model.Technique_ConstructionStandards
{
ConstructionStandardsId = ConstructionStandardsList.ConstructionStandardsId,
ConstructionStandardsCode = ConstructionStandardsList.ConstructionStandardsCode,
ConstructionStandardsName = ConstructionStandardsList.ConstructionStandardsName,
AttachUrl = ConstructionStandardsList.AttachUrl,
CompileMan = ConstructionStandardsList.CompileMan,
CompileDate = ConstructionStandardsList.CompileDate,
};
newConstructionStandardsList.CompileMan = ConstructionStandardsList.CompileMan;
newConstructionStandardsList.CompileDate = ConstructionStandardsList.CompileDate;
newConstructionStandardsList.IsPass = ConstructionStandardsList.IsPass;
newConstructionStandardsList.UpState = ConstructionStandardsList.UpState;
newConstructionStandardsList.Remark = ConstructionStandardsList.Remark;
db.Technique_ConstructionStandards.InsertOnSubmit(newConstructionStandardsList);
db.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="ConstructionStandardsList"></param>
public static void UpdateConstructionStandardsList(Model.Technique_ConstructionStandards ConstructionStandardsList)
{
Model.SGGLDB db = Funs.DB;
Model.Technique_ConstructionStandards newConstructionStandardsList =
db.Technique_ConstructionStandards.FirstOrDefault(e =>
e.ConstructionStandardsId == ConstructionStandardsList.ConstructionStandardsId);
if (newConstructionStandardsList != null)
{
newConstructionStandardsList.ConstructionStandardsCode = ConstructionStandardsList.ConstructionStandardsCode;
newConstructionStandardsList.ConstructionStandardsName = ConstructionStandardsList.ConstructionStandardsName;
newConstructionStandardsList.AttachUrl = ConstructionStandardsList.AttachUrl;
newConstructionStandardsList.CompileMan = ConstructionStandardsList.CompileMan;
newConstructionStandardsList.CompileDate = ConstructionStandardsList.CompileDate;
newConstructionStandardsList.UpState = ConstructionStandardsList.UpState;
newConstructionStandardsList.Remark = ConstructionStandardsList.Remark;
db.SubmitChanges();
}
}
/// <summary>
///根据主键删除
/// </summary>
/// <param name="ConstructionStandardsId"></param>
public static void DeleteConstructionStandardsListById(string ConstructionStandardsId)
{
Model.SGGLDB db = Funs.DB;
Model.Technique_ConstructionStandards ConstructionStandardsList =
db.Technique_ConstructionStandards.FirstOrDefault(e => e.ConstructionStandardsId == ConstructionStandardsId);
if (ConstructionStandardsList != null)
{
if (!string.IsNullOrEmpty(ConstructionStandardsList.AttachUrl))
{
BLL.UploadFileService.DeleteFile(Funs.RootPath, ConstructionStandardsList.AttachUrl);
}
////删除附件表
BLL.CommonService.DeleteAttachFileById(ConstructionStandardsList.ConstructionStandardsId);
db.Technique_ConstructionStandards.DeleteOnSubmit(ConstructionStandardsList);
db.SubmitChanges();
}
}
}

View File

@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL;
public class ProtectionStandardsService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取
/// </summary>
/// <param name="ProtectionStandardsId"></param>
/// <returns></returns>
public static Model.Technique_ProtectionStandards GetProtectionStandardsListById(string ProtectionStandardsId)
{
return Funs.DB.Technique_ProtectionStandards.FirstOrDefault(e =>
e.ProtectionStandardsId == ProtectionStandardsId);
}
/// <summary>
/// 添加
/// </summary>
/// <param name="ProtectionStandardsList"></param>
public static void AddProtectionStandardsList(Model.Technique_ProtectionStandards ProtectionStandardsList)
{
Model.SGGLDB db = Funs.DB;
Model.Technique_ProtectionStandards newProtectionStandardsList = new Model.Technique_ProtectionStandards
{
ProtectionStandardsId = ProtectionStandardsList.ProtectionStandardsId,
ProtectionStandardsCode = ProtectionStandardsList.ProtectionStandardsCode,
ProtectionStandardsName = ProtectionStandardsList.ProtectionStandardsName,
AttachUrl = ProtectionStandardsList.AttachUrl,
CompileMan = ProtectionStandardsList.CompileMan,
CompileDate = ProtectionStandardsList.CompileDate,
};
newProtectionStandardsList.CompileMan = ProtectionStandardsList.CompileMan;
newProtectionStandardsList.CompileDate = ProtectionStandardsList.CompileDate;
newProtectionStandardsList.IsPass = ProtectionStandardsList.IsPass;
newProtectionStandardsList.UpState = ProtectionStandardsList.UpState;
newProtectionStandardsList.Remark = ProtectionStandardsList.Remark;
db.Technique_ProtectionStandards.InsertOnSubmit(newProtectionStandardsList);
db.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="ProtectionStandardsList"></param>
public static void UpdateProtectionStandardsList(Model.Technique_ProtectionStandards ProtectionStandardsList)
{
Model.SGGLDB db = Funs.DB;
Model.Technique_ProtectionStandards newProtectionStandardsList =
db.Technique_ProtectionStandards.FirstOrDefault(e =>
e.ProtectionStandardsId == ProtectionStandardsList.ProtectionStandardsId);
if (newProtectionStandardsList != null)
{
newProtectionStandardsList.ProtectionStandardsCode = ProtectionStandardsList.ProtectionStandardsCode;
newProtectionStandardsList.ProtectionStandardsName = ProtectionStandardsList.ProtectionStandardsName;
newProtectionStandardsList.AttachUrl = ProtectionStandardsList.AttachUrl;
newProtectionStandardsList.CompileMan = ProtectionStandardsList.CompileMan;
newProtectionStandardsList.CompileDate = ProtectionStandardsList.CompileDate;
newProtectionStandardsList.UpState = ProtectionStandardsList.UpState;
newProtectionStandardsList.Remark = ProtectionStandardsList.Remark;
db.SubmitChanges();
}
}
/// <summary>
///根据主键删除
/// </summary>
/// <param name="ProtectionStandardsId"></param>
public static void DeleteProtectionStandardsListById(string ProtectionStandardsId)
{
Model.SGGLDB db = Funs.DB;
Model.Technique_ProtectionStandards ProtectionStandardsList =
db.Technique_ProtectionStandards.FirstOrDefault(e => e.ProtectionStandardsId == ProtectionStandardsId);
if (ProtectionStandardsList != null)
{
if (!string.IsNullOrEmpty(ProtectionStandardsList.AttachUrl))
{
BLL.UploadFileService.DeleteFile(Funs.RootPath, ProtectionStandardsList.AttachUrl);
}
////删除附件表
BLL.CommonService.DeleteAttachFileById(ProtectionStandardsList.ProtectionStandardsId);
db.Technique_ProtectionStandards.DeleteOnSubmit(ProtectionStandardsList);
db.SubmitChanges();
}
}
}

View File

@ -0,0 +1,97 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BLL;
public class SafetyResponsibilitiesService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键
/// </summary>
/// <param name="SafetyResponsibilitiesId"></param>
/// <returns></returns>
public static Model.Technique_SafetyResponsibilities GetSafetyResponsibilitiesListById(string SafetyResponsibilitiesId)
{
return Funs.DB.Technique_SafetyResponsibilities.FirstOrDefault(e =>
e.SafetyResponsibilitiesId == SafetyResponsibilitiesId);
}
/// <summary>
/// 添加专项方案
/// </summary>
/// <param name="SafetyResponsibilitiesList"></param>
public static void AddSafetyResponsibilitiesList(Model.Technique_SafetyResponsibilities SafetyResponsibilitiesList)
{
Model.SGGLDB db = Funs.DB;
Model.Technique_SafetyResponsibilities newSafetyResponsibilitiesList = new Model.Technique_SafetyResponsibilities
{
SafetyResponsibilitiesId = SafetyResponsibilitiesList.SafetyResponsibilitiesId,
SafetyResponsibilitiesCode = SafetyResponsibilitiesList.SafetyResponsibilitiesCode,
SafetyResponsibilitiesName = SafetyResponsibilitiesList.SafetyResponsibilitiesName,
AttachUrl = SafetyResponsibilitiesList.AttachUrl,
CompileMan = SafetyResponsibilitiesList.CompileMan,
CompileDate = SafetyResponsibilitiesList.CompileDate,
};
newSafetyResponsibilitiesList.CompileMan = SafetyResponsibilitiesList.CompileMan;
newSafetyResponsibilitiesList.CompileDate = SafetyResponsibilitiesList.CompileDate;
newSafetyResponsibilitiesList.IsPass = SafetyResponsibilitiesList.IsPass;
newSafetyResponsibilitiesList.UpState = SafetyResponsibilitiesList.UpState;
newSafetyResponsibilitiesList.Remark = SafetyResponsibilitiesList.Remark;
db.Technique_SafetyResponsibilities.InsertOnSubmit(newSafetyResponsibilitiesList);
db.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="SafetyResponsibilitiesList"></param>
public static void UpdateSafetyResponsibilitiesList(Model.Technique_SafetyResponsibilities SafetyResponsibilitiesList)
{
Model.SGGLDB db = Funs.DB;
Model.Technique_SafetyResponsibilities newSafetyResponsibilitiesList =
db.Technique_SafetyResponsibilities.FirstOrDefault(e =>
e.SafetyResponsibilitiesId == SafetyResponsibilitiesList.SafetyResponsibilitiesId);
if (newSafetyResponsibilitiesList != null)
{
newSafetyResponsibilitiesList.SafetyResponsibilitiesCode = SafetyResponsibilitiesList.SafetyResponsibilitiesCode;
newSafetyResponsibilitiesList.SafetyResponsibilitiesName = SafetyResponsibilitiesList.SafetyResponsibilitiesName;
newSafetyResponsibilitiesList.AttachUrl = SafetyResponsibilitiesList.AttachUrl;
newSafetyResponsibilitiesList.CompileMan = SafetyResponsibilitiesList.CompileMan;
newSafetyResponsibilitiesList.CompileDate = SafetyResponsibilitiesList.CompileDate;
newSafetyResponsibilitiesList.UpState = SafetyResponsibilitiesList.UpState;
newSafetyResponsibilitiesList.Remark = SafetyResponsibilitiesList.Remark;
db.SubmitChanges();
}
}
/// <summary>
///根据主键删
/// </summary>
/// <param name="SafetyResponsibilitiesId"></param>
public static void DeleteSafetyResponsibilitiesListById(string SafetyResponsibilitiesId)
{
Model.SGGLDB db = Funs.DB;
Model.Technique_SafetyResponsibilities SafetyResponsibilitiesList =
db.Technique_SafetyResponsibilities.FirstOrDefault(e => e.SafetyResponsibilitiesId == SafetyResponsibilitiesId);
if (SafetyResponsibilitiesList != null)
{
if (!string.IsNullOrEmpty(SafetyResponsibilitiesList.AttachUrl))
{
BLL.UploadFileService.DeleteFile(Funs.RootPath, SafetyResponsibilitiesList.AttachUrl);
}
////删除附件表
BLL.CommonService.DeleteAttachFileById(SafetyResponsibilitiesList.SafetyResponsibilitiesId);
db.Technique_SafetyResponsibilities.DeleteOnSubmit(SafetyResponsibilitiesList);
db.SubmitChanges();
}
}
}

View File

@ -175,7 +175,7 @@
</data>
<data name="ScheduleManage" xml:space="preserve">
<value>Schedule manage</value>
<comment>进度管理</comment>
<comment>工程管理</comment>
</data>
<data name="SelectLanguage" xml:space="preserve">
<value>Choice language</value>

View File

@ -160,7 +160,7 @@
<value>刷新本页</value>
</data>
<data name="ScheduleManage" xml:space="preserve">
<value>进度管理</value>
<value>工程管理</value>
</data>
<data name="SelectLanguage" xml:space="preserve">
<value>选择语言</value>

View File

@ -160,7 +160,7 @@
<value>刷新本页</value>
</data>
<data name="ScheduleManage" xml:space="preserve">
<value>进度管理</value>
<value>工程管理</value>
</data>
<data name="SelectLanguage" xml:space="preserve">
<value>选择语言</value>

View File

@ -2290,11 +2290,15 @@
<Content Include="HSSE\Solution\SolutionTemplate.aspx" />
<Content Include="HSSE\Solution\SolutionTemplateEdit.aspx" />
<Content Include="HSSE\Solution\SolutionTemplateView.aspx" />
<Content Include="HSSE\Technique\AwardStandards.aspx" />
<Content Include="HSSE\Technique\AwardStandardsEdit.aspx" />
<Content Include="HSSE\Technique\CheckItemDetailEdit.aspx" />
<Content Include="HSSE\Technique\CheckItemEdit.aspx" />
<Content Include="HSSE\Technique\CheckItemSet.aspx" />
<Content Include="HSSE\Technique\CompanyEnvironmental.aspx" />
<Content Include="HSSE\Technique\CompanyHazardList.aspx" />
<Content Include="HSSE\Technique\ConstructionStandards.aspx" />
<Content Include="HSSE\Technique\ConstructionStandardsEdit.aspx" />
<Content Include="HSSE\Technique\Emergency.aspx" />
<Content Include="HSSE\Technique\EmergencyEdit.aspx" />
<Content Include="HSSE\Technique\EmergencySelectCloumn.aspx" />
@ -2308,10 +2312,14 @@
<Content Include="HSSE\Technique\HazardListIn.aspx" />
<Content Include="HSSE\Technique\HazardListOut.aspx" />
<Content Include="HSSE\Technique\HazardListTypeEdit.aspx" />
<Content Include="HSSE\Technique\ProtectionStandards.aspx" />
<Content Include="HSSE\Technique\ProtectionStandardsEdit.aspx" />
<Content Include="HSSE\Technique\Rectify.aspx" />
<Content Include="HSSE\Technique\RectifyEdit.aspx" />
<Content Include="HSSE\Technique\RectifyItemEdit.aspx" />
<Content Include="HSSE\Technique\RectifySelectCloumn.aspx" />
<Content Include="HSSE\Technique\SafetyResponsibilities.aspx" />
<Content Include="HSSE\Technique\SafetyResponsibilitiesEdit.aspx" />
<Content Include="HSSE\Technique\SpecialScheme.aspx" />
<Content Include="HSSE\Technique\SpecialSchemeEdit.aspx" />
<Content Include="HSSE\Technique\SpecialSchemeSelectCloumn.aspx" />
@ -12734,7 +12742,9 @@
<Compile Include="HSSE\EduTrain\TaskNoticeEdit.aspx.designer.cs">
<DependentUpon>TaskNoticeEdit.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\EduTrain\Trainingrecords.aspx.cs" />
<Compile Include="HSSE\EduTrain\Trainingrecords.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HSSE\EduTrain\Trainingrecords.aspx.designer.cs" />
<Compile Include="HSSE\EduTrain\TrainTestRecordEdit.aspx.cs">
<DependentUpon>TrainTestRecordEdit.aspx</DependentUpon>
@ -15634,6 +15644,20 @@
<Compile Include="HSSE\Solution\SolutionTemplateView.aspx.designer.cs">
<DependentUpon>SolutionTemplateView.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\Technique\AwardStandards.aspx.cs">
<DependentUpon>AwardStandards.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HSSE\Technique\AwardStandards.aspx.designer.cs">
<DependentUpon>AwardStandards.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\Technique\AwardStandardsEdit.aspx.cs">
<DependentUpon>AwardStandardsEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HSSE\Technique\AwardStandardsEdit.aspx.designer.cs">
<DependentUpon>AwardStandardsEdit.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\Technique\CheckItemDetailEdit.aspx.cs">
<DependentUpon>CheckItemDetailEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -15669,6 +15693,20 @@
<Compile Include="HSSE\Technique\CompanyHazardList.aspx.designer.cs">
<DependentUpon>CompanyHazardList.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\Technique\ConstructionStandards.aspx.cs">
<DependentUpon>ConstructionStandards.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HSSE\Technique\ConstructionStandards.aspx.designer.cs">
<DependentUpon>ConstructionStandards.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\Technique\ConstructionStandardsEdit.aspx.cs">
<DependentUpon>ConstructionStandardsEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HSSE\Technique\ConstructionStandardsEdit.aspx.designer.cs">
<DependentUpon>ConstructionStandardsEdit.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\Technique\Emergency.aspx.cs">
<DependentUpon>Emergency.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -15760,6 +15798,20 @@
<Compile Include="HSSE\Technique\HazardListTypeEdit.aspx.designer.cs">
<DependentUpon>HazardListTypeEdit.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\Technique\ProtectionStandards.aspx.cs">
<DependentUpon>ProtectionStandards.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HSSE\Technique\ProtectionStandards.aspx.designer.cs">
<DependentUpon>ProtectionStandards.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\Technique\ProtectionStandardsEdit.aspx.cs">
<DependentUpon>ProtectionStandardsEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HSSE\Technique\ProtectionStandardsEdit.aspx.designer.cs">
<DependentUpon>ProtectionStandardsEdit.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\Technique\Rectify.aspx.cs">
<DependentUpon>Rectify.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -15788,6 +15840,20 @@
<Compile Include="HSSE\Technique\RectifySelectCloumn.aspx.designer.cs">
<DependentUpon>RectifySelectCloumn.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\Technique\SafetyResponsibilities.aspx.cs">
<DependentUpon>SafetyResponsibilities.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HSSE\Technique\SafetyResponsibilities.aspx.designer.cs">
<DependentUpon>SafetyResponsibilities.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\Technique\SafetyResponsibilitiesEdit.aspx.cs">
<DependentUpon>SafetyResponsibilitiesEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HSSE\Technique\SafetyResponsibilitiesEdit.aspx.designer.cs">
<DependentUpon>SafetyResponsibilitiesEdit.aspx</DependentUpon>
</Compile>
<Compile Include="HSSE\Technique\SpecialScheme.aspx.cs">
<DependentUpon>SpecialScheme.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

View File

@ -0,0 +1,108 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AwardStandards.aspx.cs" Inherits="FineUIPro.Web.HSSE.Technique.AwardStandards" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<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" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="防护标准" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="AwardStandardsId" EnableColumnLines="true"
DataIDField="AwardStandardsId" AllowSorting="true" SortField="AwardStandardsCode" ForceFit="true"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server">
<Items>
<f:TextBox ID="AwardStandardsName" runat="server" Label="名称" EmptyText="输入查询名称"
Width="250px" LabelWidth="70px">
</f:TextBox>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnQuery" ToolTip="查询" Icon="SystemSearch" EnablePostBack="true"
OnClick="TextBox_TextChanged" runat="server" >
</f:Button>
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server"
Hidden="true">
</f:Button>
<%-- <f:Button ID="btnSelectColumns" runat="server" ToolTip="导出" Icon="FolderUp" EnablePostBack="false" Hidden="true"> --%>
<%-- </f:Button> --%>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField Width="160px" ColumnID="AwardStandardsCode" DataField="AwardStandardsCode" SortField="AwardStandardsCode"
FieldType="String" HeaderText="编号" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="220px" ColumnID="AwardStandardsName" DataField="AwardStandardsName" SortField="AwardStandardsName"
FieldType="String" HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="110px" ColumnID="CompileMan" DataField="CompileMan" SortField="CompileMan"
FieldType="String" HeaderText="编制人" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="250px" ColumnID="CompileDate" DataField="CompileDate" SortField="CompileDate"
FieldType="String" HeaderText="编制时间" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:WindowField TextAlign="Left" Width="70px" WindowID="WindowAtt" Text="详细"
ToolTip="上传查看" DataIFrameUrlFields="AwardStandardsId" DataIFrameUrlFormatString="../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/AwardStandards&menuId=8E3A5EDC-62CA-4F64-A4E7-CD3D473A6201"/>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<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:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="编辑奖罚标准" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
Width="750px" Height="420px">
</f:Window>
<f:Window ID="Window4" Title="选择需要导出的列" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" OnClose="Window4_Close" IsModal="true"
Width="450px" Height="250px" EnableAjax="false">
</f:Window>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Self" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="编辑" Icon="Pencil">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true" Icon="Delete"
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/jscript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
</html>

View File

@ -0,0 +1,319 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
using System.Web.UI;
namespace FineUIPro.Web.HSSE.Technique
{
public partial class AwardStandards : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
////权限按钮方法
this.GetButtonPower();
btnNew.OnClientClick = Window1.GetShowReference("AwardStandardsEdit.aspx") + "return false;";
// btnSelectColumns.OnClientClick = Window4.GetShowReference("AwardStandardsSelectCloumn.aspx");
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
BindGrid();
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT AwardStandardsId,AwardStandardsCode,AwardStandardsName,CompileMan,CompileDate,AttachUrl,AuditMan,AuditDate,IsPass,IsBuild,UpState
FROM dbo.Technique_AwardStandards
WHERE 1 =1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.AwardStandardsName.Text.Trim()))
{
strSql += " AND AwardStandardsName LIKE @AwardStandardsName";
listStr.Add(new SqlParameter("@AwardStandardsName", "%" + this.AwardStandardsName.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
BindGrid();
}
/// <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();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
/// <summary>
/// 关闭窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 右键删除事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
this.DeleteData();
}
/// <summary>
/// 删除方法
/// </summary>
private void DeleteData()
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var getV = BLL.AwardStandardsService.GetAwardStandardsListById(rowID);
if (getV != null)
{
BLL.LogService.AddSys_Log(this.CurrUser, getV.AwardStandardsCode, getV.AwardStandardsId, BLL.Const.AwardStandardsMenuId, Const.BtnDelete);
BLL.AwardStandardsService.DeleteAwardStandardsListById(rowID);
}
}
BindGrid();
ShowNotify("删除数据成功!");
}
}
#endregion
#region
/// <summary>
/// 右键编辑事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
this.EditData();
}
/// <summary>
/// 编辑数据方法
/// </summary>
private void EditData()
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
string AwardStandardsId = Grid1.SelectedRowID;
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("AwardStandardsEdit.aspx?AwardStandardsId={0}", AwardStandardsId, "编辑 - ")));
}
#endregion
#region Grid行双击事件
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
this.EditData();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
this.BindGrid();
BLL.LogService.AddSys_Log(this.CurrUser, string.Empty, string.Empty, BLL.Const.AwardStandardsMenuId, Const.BtnQuery);
}
#endregion
#region
/// <summary>
/// 关闭导出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window4_Close(object sender, WindowCloseEventArgs e)
{
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=MyExcelFile.xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Write(GetGridTableHtml(Grid1, e.CloseArgument.Split('#')));
Response.End();
}
/// <summary>
/// 导出
/// </summary>
/// <param name="grid"></param>
/// <param name="columns"></param>
/// <returns></returns>
private string GetGridTableHtml(Grid grid, string[] columns)
{
StringBuilder sb = new StringBuilder();
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
List<string> columnHeaderTexts = new List<string>(columns);
List<int> columnIndexs = new List<int>();
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
if (columnHeaderTexts.Contains(column.HeaderText))
{
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
columnIndexs.Add(column.ColumnIndex);
}
}
sb.Append("</tr>");
foreach (GridRow row in grid.Rows)
{
sb.Append("<tr>");
int columnIndex = 0;
foreach (object value in row.Values)
{
if (columnIndexs.Contains(columnIndex))
{
string html = value.ToString();
if (html.StartsWith(Grid.TEMPLATE_PLACEHOLDER_PREFIX))
{
// 模板列
string templateID = html.Substring(Grid.TEMPLATE_PLACEHOLDER_PREFIX.Length);
Control templateCtrl = row.FindControl(templateID);
html = GetRenderedHtmlSource(templateCtrl);
}
sb.AppendFormat("<td>{0}</td>", html);
}
columnIndex++;
}
sb.Append("</tr>");
}
sb.Append("</table>");
return sb.ToString();
}
/// <summary>
/// 获取控件渲染后的HTML源代码
/// </summary>
/// <param name="ctrl"></param>
/// <returns></returns>
private string GetRenderedHtmlSource(Control ctrl)
{
if (ctrl != null)
{
using (StringWriter sw = new StringWriter())
{
using (HtmlTextWriter htw = new HtmlTextWriter(sw))
{
ctrl.RenderControl(htw);
return sw.ToString();
}
}
}
return String.Empty;
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.AwardStandardsMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuEdit.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDelete.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnOut))
{
// this.btnSelectColumns.Hidden = false;
}
}
}
#endregion
}
}

View File

@ -0,0 +1,170 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.Technique
{
public partial class AwardStandards
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// AwardStandardsName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox AwardStandardsName;
/// <summary>
/// btnQuery control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnQuery;
/// <summary>
/// btnNew control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// ToolbarSeparator1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window4 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window4;
/// <summary>
/// WindowAtt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
/// <summary>
/// Menu1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuDelete control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDelete;
}
}

View File

@ -0,0 +1,72 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AwardStandardsEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.Technique.AwardStandardsEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<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="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="txtAwardStandardsCode" runat="server" Label="编号" Required="true"
MaxLength="50" ShowRedStar="true" FocusOnPageLoad="true" AutoPostBack="true"
OnTextChanged="TextBox_TextChanged">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtAwardStandardsName" runat="server" Label="名称" Required="true"
MaxLength="500" ShowRedStar="true" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="ddlCompileMan" runat="server" Label="编制人">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DatePicker runat="server" Label="编制日期" ID="dpkCompileDate">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRemark" runat="server" Label="备注" MaxLength="500" LabelAlign="Right" ></f:TextArea>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Label runat="server" ID="lbTemp"></f:Label>
<f:Button ID="btnAttachUrl" Text="附件" ToolTip="附件上传及查看" Icon="TableCell" runat="server" OnClick="btnUploadResources_Click"
ValidateForms="SimpleForm1">
</f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
Hidden="true" OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
</form>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
</body>
</html>

View File

@ -0,0 +1,221 @@
using BLL;
using System;
using System.Linq;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HSSE.Technique
{
public partial class AwardStandardsEdit : PageBase
{
#region
/// <summary>
/// 防护标准ID
/// </summary>
public string AwardStandardsId
{
get
{
return (string)ViewState["AwardStandardsId"];
}
set
{
ViewState["AwardStandardsId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
////权限按钮方法
this.GetButtonPower();
btnClose.OnClientClick = ActiveWindow.GetHideReference();
//人员
UserService.InitUserDropDownList(this.ddlCompileMan, string.Empty, true);
//加载默认整理人、整理日期
this.ddlCompileMan.SelectedValue = this.CurrUser.UserId;
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
this.AwardStandardsId = Request.Params["AwardStandardsId"];
if (!string.IsNullOrEmpty(this.AwardStandardsId))
{
var AwardStandards = BLL.AwardStandardsService.GetAwardStandardsListById(this.AwardStandardsId);
if (AwardStandards != null)
{
this.txtAwardStandardsCode.Text = AwardStandards.AwardStandardsCode;
this.txtAwardStandardsName.Text = AwardStandards.AwardStandardsName;
this.txtRemark.Text = AwardStandards.Remark;
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", AwardStandards.CompileDate);
if (!string.IsNullOrEmpty(AwardStandards.CompileMan))
{
this.ddlCompileMan.SelectedItem.Text = AwardStandards.CompileMan;
}
}
}
}
}
#endregion
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
SaveData();
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
/// <summary>
/// 保存数据
/// </summary>
private void SaveData()
{
Model.Technique_AwardStandards AwardStandards = new Model.Technique_AwardStandards();
if (!string.IsNullOrEmpty(this.txtAwardStandardsCode.Text.Trim()))
{
AwardStandards.AwardStandardsCode = this.txtAwardStandardsCode.Text.Trim();
}
else
{
ShowNotify("请输入编号", MessageBoxIcon.Warning);
return;
}
if (!string.IsNullOrEmpty(this.txtAwardStandardsName.Text.Trim()))
{
AwardStandards.AwardStandardsName = this.txtAwardStandardsName.Text.Trim();
}
else
{
ShowNotify("请输入名称", MessageBoxIcon.Warning);
return;
}
if (this.ddlCompileMan.SelectedValue != null)
{
AwardStandards.CompileMan = this.ddlCompileMan.SelectedItem.Text;
}
else
{
AwardStandards.CompileMan = this.CurrUser.UserName;
}
if (!string.IsNullOrEmpty(this.dpkCompileDate.Text))
{
AwardStandards.CompileDate = Convert.ToDateTime(this.dpkCompileDate.Text);
}
else
{
AwardStandards.CompileDate = DateTime.Now;
}
if (txtRemark.Text.Trim() != string.Empty)
{
AwardStandards.Remark = txtRemark.Text.Trim();
}
if (string.IsNullOrEmpty(this.AwardStandardsId))
{
AwardStandards.IsPass = true;
this.AwardStandardsId = AwardStandards.AwardStandardsId = SQLHelper.GetNewID(typeof(Model.Technique_AwardStandards));
BLL.AwardStandardsService.AddAwardStandardsList(AwardStandards);
BLL.LogService.AddSys_Log(this.CurrUser, AwardStandards.AwardStandardsCode, AwardStandards.AwardStandardsId, BLL.Const.AwardStandardsMenuId, Const.BtnAdd);
}
else
{
AwardStandards.AwardStandardsId = this.AwardStandardsId;
BLL.AwardStandardsService.UpdateAwardStandardsList(AwardStandards);
BLL.LogService.AddSys_Log(this.CurrUser, AwardStandards.AwardStandardsCode, AwardStandards.AwardStandardsId, BLL.Const.AwardStandardsMenuId, Const.BtnModify);
}
}
#endregion
#region
/// <summary>
/// 上传附件资源
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnUploadResources_Click(object sender, EventArgs e)
{
if (this.btnSave.Hidden)
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/AwardStandards&type=-1", this.AwardStandardsId)));
}
else
{
if (string.IsNullOrEmpty(this.txtAwardStandardsCode.Text.Trim()))
{
ShowNotify("请输入方案编号", MessageBoxIcon.Warning);
return;
}
if (string.IsNullOrEmpty(this.txtAwardStandardsName.Text.Trim()))
{
ShowNotify("请输入方案名称", MessageBoxIcon.Warning);
return;
}
if (string.IsNullOrEmpty(this.AwardStandardsId))
{
SaveData();
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/AwardStandards&menuId={1}", this.AwardStandardsId, BLL.Const.AwardStandardsMenuId)));
}
}
#endregion
#region
/// <summary>
/// 验证方案编号、名称是否存在
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
var q = Funs.DB.Technique_AwardStandards.FirstOrDefault(x => x.IsPass == true && x.AwardStandardsCode == this.txtAwardStandardsCode.Text.Trim() && (x.AwardStandardsId != this.AwardStandardsId || (this.AwardStandardsId == null && x.AwardStandardsId != null)));
if (q != null)
{
ShowNotify("输入的方案编号已存在!", MessageBoxIcon.Warning);
}
var q2 = Funs.DB.Technique_AwardStandards.FirstOrDefault(x => x.IsPass == true && x.AwardStandardsName == this.txtAwardStandardsName.Text.Trim() && (x.AwardStandardsId != this.AwardStandardsId || (this.AwardStandardsId == null && x.AwardStandardsId != null)));
if (q2 != null)
{
ShowNotify("输入的方案名称已存在!", MessageBoxIcon.Warning);
}
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.AwardStandardsMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnSave.Hidden = false;
}
}
}
#endregion
}
}

View File

@ -0,0 +1,152 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.Technique
{
public partial class AwardStandardsEdit
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtAwardStandardsCode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtAwardStandardsCode;
/// <summary>
/// txtAwardStandardsName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtAwardStandardsName;
/// <summary>
/// ddlCompileMan control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList ddlCompileMan;
/// <summary>
/// dpkCompileDate control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DatePicker dpkCompileDate;
/// <summary>
/// txtRemark control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextArea txtRemark;
/// <summary>
/// Toolbar1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// lbTemp control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Label lbTemp;
/// <summary>
/// btnAttachUrl control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnAttachUrl;
/// <summary>
/// ToolbarFill1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// WindowAtt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}

View File

@ -0,0 +1,108 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionStandards.aspx.cs" Inherits="FineUIPro.Web.HSSE.Technique.ConstructionStandards" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<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" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="防护标准" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="ConstructionStandardsId" EnableColumnLines="true"
DataIDField="ConstructionStandardsId" AllowSorting="true" SortField="ConstructionStandardsCode" ForceFit="true"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server">
<Items>
<f:TextBox ID="ConstructionStandardsName" runat="server" Label="名称" EmptyText="输入查询名称"
Width="250px" LabelWidth="70px">
</f:TextBox>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnQuery" ToolTip="查询" Icon="SystemSearch" EnablePostBack="true"
OnClick="TextBox_TextChanged" runat="server" >
</f:Button>
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server"
Hidden="true">
</f:Button>
<%-- <f:Button ID="btnSelectColumns" runat="server" ToolTip="导出" Icon="FolderUp" EnablePostBack="false" Hidden="true"> --%>
<%-- </f:Button> --%>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField Width="160px" ColumnID="ConstructionStandardsCode" DataField="ConstructionStandardsCode" SortField="ConstructionStandardsCode"
FieldType="String" HeaderText="编号" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="220px" ColumnID="ConstructionStandardsName" DataField="ConstructionStandardsName" SortField="ConstructionStandardsName"
FieldType="String" HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="110px" ColumnID="CompileMan" DataField="CompileMan" SortField="CompileMan"
FieldType="String" HeaderText="编制人" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="250px" ColumnID="CompileDate" DataField="CompileDate" SortField="CompileDate"
FieldType="String" HeaderText="编制时间" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:WindowField TextAlign="Left" Width="70px" WindowID="WindowAtt" Text="详细"
ToolTip="上传查看" DataIFrameUrlFields="ConstructionStandardsId" DataIFrameUrlFormatString="../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/ConstructionStandards&menuId=8E3A5EDC-62CA-4F64-A4E7-CD3D473A6201"/>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<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:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="编辑队伍文明施工标准" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
Width="750px" Height="420px">
</f:Window>
<f:Window ID="Window4" Title="选择需要导出的列" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" OnClose="Window4_Close" IsModal="true"
Width="450px" Height="250px" EnableAjax="false">
</f:Window>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Self" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="编辑" Icon="Pencil">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true" Icon="Delete"
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/jscript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
</html>

View File

@ -0,0 +1,319 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
using System.Web.UI;
namespace FineUIPro.Web.HSSE.Technique
{
public partial class ConstructionStandards : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
////权限按钮方法
this.GetButtonPower();
btnNew.OnClientClick = Window1.GetShowReference("ConstructionStandardsEdit.aspx") + "return false;";
// btnSelectColumns.OnClientClick = Window4.GetShowReference("ConstructionStandardsSelectCloumn.aspx");
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
BindGrid();
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT ConstructionStandardsId,ConstructionStandardsCode,ConstructionStandardsName,CompileMan,CompileDate,AttachUrl,AuditMan,AuditDate,IsPass,IsBuild,UpState
FROM dbo.Technique_ConstructionStandards
WHERE 1 =1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.ConstructionStandardsName.Text.Trim()))
{
strSql += " AND ConstructionStandardsName LIKE @ConstructionStandardsName";
listStr.Add(new SqlParameter("@ConstructionStandardsName", "%" + this.ConstructionStandardsName.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
BindGrid();
}
/// <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();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
/// <summary>
/// 关闭窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 右键删除事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
this.DeleteData();
}
/// <summary>
/// 删除方法
/// </summary>
private void DeleteData()
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var getV = BLL.ConstructionStandardsService.GetConstructionStandardsListById(rowID);
if (getV != null)
{
BLL.LogService.AddSys_Log(this.CurrUser, getV.ConstructionStandardsCode, getV.ConstructionStandardsId, BLL.Const.ConstructionStandardsMenuId, Const.BtnDelete);
BLL.ConstructionStandardsService.DeleteConstructionStandardsListById(rowID);
}
}
BindGrid();
ShowNotify("删除数据成功!");
}
}
#endregion
#region
/// <summary>
/// 右键编辑事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
this.EditData();
}
/// <summary>
/// 编辑数据方法
/// </summary>
private void EditData()
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
string ConstructionStandardsId = Grid1.SelectedRowID;
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionStandardsEdit.aspx?ConstructionStandardsId={0}", ConstructionStandardsId, "编辑 - ")));
}
#endregion
#region Grid行双击事件
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
this.EditData();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
this.BindGrid();
BLL.LogService.AddSys_Log(this.CurrUser, string.Empty, string.Empty, BLL.Const.ConstructionStandardsMenuId, Const.BtnQuery);
}
#endregion
#region
/// <summary>
/// 关闭导出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window4_Close(object sender, WindowCloseEventArgs e)
{
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=MyExcelFile.xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Write(GetGridTableHtml(Grid1, e.CloseArgument.Split('#')));
Response.End();
}
/// <summary>
/// 导出
/// </summary>
/// <param name="grid"></param>
/// <param name="columns"></param>
/// <returns></returns>
private string GetGridTableHtml(Grid grid, string[] columns)
{
StringBuilder sb = new StringBuilder();
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
List<string> columnHeaderTexts = new List<string>(columns);
List<int> columnIndexs = new List<int>();
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
if (columnHeaderTexts.Contains(column.HeaderText))
{
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
columnIndexs.Add(column.ColumnIndex);
}
}
sb.Append("</tr>");
foreach (GridRow row in grid.Rows)
{
sb.Append("<tr>");
int columnIndex = 0;
foreach (object value in row.Values)
{
if (columnIndexs.Contains(columnIndex))
{
string html = value.ToString();
if (html.StartsWith(Grid.TEMPLATE_PLACEHOLDER_PREFIX))
{
// 模板列
string templateID = html.Substring(Grid.TEMPLATE_PLACEHOLDER_PREFIX.Length);
Control templateCtrl = row.FindControl(templateID);
html = GetRenderedHtmlSource(templateCtrl);
}
sb.AppendFormat("<td>{0}</td>", html);
}
columnIndex++;
}
sb.Append("</tr>");
}
sb.Append("</table>");
return sb.ToString();
}
/// <summary>
/// 获取控件渲染后的HTML源代码
/// </summary>
/// <param name="ctrl"></param>
/// <returns></returns>
private string GetRenderedHtmlSource(Control ctrl)
{
if (ctrl != null)
{
using (StringWriter sw = new StringWriter())
{
using (HtmlTextWriter htw = new HtmlTextWriter(sw))
{
ctrl.RenderControl(htw);
return sw.ToString();
}
}
}
return String.Empty;
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ConstructionStandardsMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuEdit.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDelete.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnOut))
{
// this.btnSelectColumns.Hidden = false;
}
}
}
#endregion
}
}

View File

@ -0,0 +1,170 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.Technique
{
public partial class ConstructionStandards
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// ConstructionStandardsName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox ConstructionStandardsName;
/// <summary>
/// btnQuery control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnQuery;
/// <summary>
/// btnNew control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// ToolbarSeparator1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window4 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window4;
/// <summary>
/// WindowAtt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
/// <summary>
/// Menu1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuDelete control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDelete;
}
}

View File

@ -0,0 +1,72 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionStandardsEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.Technique.ConstructionStandardsEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<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="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="txtConstructionStandardsCode" runat="server" Label="编号" Required="true"
MaxLength="50" ShowRedStar="true" FocusOnPageLoad="true" AutoPostBack="true"
OnTextChanged="TextBox_TextChanged">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtConstructionStandardsName" runat="server" Label="名称" Required="true"
MaxLength="500" ShowRedStar="true" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="ddlCompileMan" runat="server" Label="编制人">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DatePicker runat="server" Label="编制日期" ID="dpkCompileDate">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRemark" runat="server" Label="备注" MaxLength="500" LabelAlign="Right" ></f:TextArea>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Label runat="server" ID="lbTemp"></f:Label>
<f:Button ID="btnAttachUrl" Text="附件" ToolTip="附件上传及查看" Icon="TableCell" runat="server" OnClick="btnUploadResources_Click"
ValidateForms="SimpleForm1">
</f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
Hidden="true" OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
</form>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
</body>
</html>

View File

@ -0,0 +1,221 @@
using BLL;
using System;
using System.Linq;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HSSE.Technique
{
public partial class ConstructionStandardsEdit : PageBase
{
#region
/// <summary>
/// 防护标准ID
/// </summary>
public string ConstructionStandardsId
{
get
{
return (string)ViewState["ConstructionStandardsId"];
}
set
{
ViewState["ConstructionStandardsId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
////权限按钮方法
this.GetButtonPower();
btnClose.OnClientClick = ActiveWindow.GetHideReference();
//人员
UserService.InitUserDropDownList(this.ddlCompileMan, string.Empty, true);
//加载默认整理人、整理日期
this.ddlCompileMan.SelectedValue = this.CurrUser.UserId;
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
this.ConstructionStandardsId = Request.Params["ConstructionStandardsId"];
if (!string.IsNullOrEmpty(this.ConstructionStandardsId))
{
var ConstructionStandards = BLL.ConstructionStandardsService.GetConstructionStandardsListById(this.ConstructionStandardsId);
if (ConstructionStandards != null)
{
this.txtConstructionStandardsCode.Text = ConstructionStandards.ConstructionStandardsCode;
this.txtConstructionStandardsName.Text = ConstructionStandards.ConstructionStandardsName;
this.txtRemark.Text = ConstructionStandards.Remark;
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", ConstructionStandards.CompileDate);
if (!string.IsNullOrEmpty(ConstructionStandards.CompileMan))
{
this.ddlCompileMan.SelectedItem.Text = ConstructionStandards.CompileMan;
}
}
}
}
}
#endregion
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
SaveData();
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
/// <summary>
/// 保存数据
/// </summary>
private void SaveData()
{
Model.Technique_ConstructionStandards ConstructionStandards = new Model.Technique_ConstructionStandards();
if (!string.IsNullOrEmpty(this.txtConstructionStandardsCode.Text.Trim()))
{
ConstructionStandards.ConstructionStandardsCode = this.txtConstructionStandardsCode.Text.Trim();
}
else
{
ShowNotify("请输入编号", MessageBoxIcon.Warning);
return;
}
if (!string.IsNullOrEmpty(this.txtConstructionStandardsName.Text.Trim()))
{
ConstructionStandards.ConstructionStandardsName = this.txtConstructionStandardsName.Text.Trim();
}
else
{
ShowNotify("请输入名称", MessageBoxIcon.Warning);
return;
}
if (this.ddlCompileMan.SelectedValue != null)
{
ConstructionStandards.CompileMan = this.ddlCompileMan.SelectedItem.Text;
}
else
{
ConstructionStandards.CompileMan = this.CurrUser.UserName;
}
if (!string.IsNullOrEmpty(this.dpkCompileDate.Text))
{
ConstructionStandards.CompileDate = Convert.ToDateTime(this.dpkCompileDate.Text);
}
else
{
ConstructionStandards.CompileDate = DateTime.Now;
}
if (txtRemark.Text.Trim() != string.Empty)
{
ConstructionStandards.Remark = txtRemark.Text.Trim();
}
if (string.IsNullOrEmpty(this.ConstructionStandardsId))
{
ConstructionStandards.IsPass = true;
this.ConstructionStandardsId = ConstructionStandards.ConstructionStandardsId = SQLHelper.GetNewID(typeof(Model.Technique_ConstructionStandards));
BLL.ConstructionStandardsService.AddConstructionStandardsList(ConstructionStandards);
BLL.LogService.AddSys_Log(this.CurrUser, ConstructionStandards.ConstructionStandardsCode, ConstructionStandards.ConstructionStandardsId, BLL.Const.ConstructionStandardsMenuId, Const.BtnAdd);
}
else
{
ConstructionStandards.ConstructionStandardsId = this.ConstructionStandardsId;
BLL.ConstructionStandardsService.UpdateConstructionStandardsList(ConstructionStandards);
BLL.LogService.AddSys_Log(this.CurrUser, ConstructionStandards.ConstructionStandardsCode, ConstructionStandards.ConstructionStandardsId, BLL.Const.ConstructionStandardsMenuId, Const.BtnModify);
}
}
#endregion
#region
/// <summary>
/// 上传附件资源
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnUploadResources_Click(object sender, EventArgs e)
{
if (this.btnSave.Hidden)
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/ConstructionStandards&type=-1", this.ConstructionStandardsId)));
}
else
{
if (string.IsNullOrEmpty(this.txtConstructionStandardsCode.Text.Trim()))
{
ShowNotify("请输入方案编号", MessageBoxIcon.Warning);
return;
}
if (string.IsNullOrEmpty(this.txtConstructionStandardsName.Text.Trim()))
{
ShowNotify("请输入方案名称", MessageBoxIcon.Warning);
return;
}
if (string.IsNullOrEmpty(this.ConstructionStandardsId))
{
SaveData();
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/ConstructionStandards&menuId={1}", this.ConstructionStandardsId, BLL.Const.ConstructionStandardsMenuId)));
}
}
#endregion
#region
/// <summary>
/// 验证方案编号、名称是否存在
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
var q = Funs.DB.Technique_ConstructionStandards.FirstOrDefault(x => x.IsPass == true && x.ConstructionStandardsCode == this.txtConstructionStandardsCode.Text.Trim() && (x.ConstructionStandardsId != this.ConstructionStandardsId || (this.ConstructionStandardsId == null && x.ConstructionStandardsId != null)));
if (q != null)
{
ShowNotify("输入的方案编号已存在!", MessageBoxIcon.Warning);
}
var q2 = Funs.DB.Technique_ConstructionStandards.FirstOrDefault(x => x.IsPass == true && x.ConstructionStandardsName == this.txtConstructionStandardsName.Text.Trim() && (x.ConstructionStandardsId != this.ConstructionStandardsId || (this.ConstructionStandardsId == null && x.ConstructionStandardsId != null)));
if (q2 != null)
{
ShowNotify("输入的方案名称已存在!", MessageBoxIcon.Warning);
}
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ConstructionStandardsMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnSave.Hidden = false;
}
}
}
#endregion
}
}

View File

@ -0,0 +1,152 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.Technique
{
public partial class ConstructionStandardsEdit
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtConstructionStandardsCode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtConstructionStandardsCode;
/// <summary>
/// txtConstructionStandardsName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtConstructionStandardsName;
/// <summary>
/// ddlCompileMan control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList ddlCompileMan;
/// <summary>
/// dpkCompileDate control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DatePicker dpkCompileDate;
/// <summary>
/// txtRemark control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextArea txtRemark;
/// <summary>
/// Toolbar1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// lbTemp control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Label lbTemp;
/// <summary>
/// btnAttachUrl control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnAttachUrl;
/// <summary>
/// ToolbarFill1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// WindowAtt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}

View File

@ -0,0 +1,108 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProtectionStandards.aspx.cs" Inherits="FineUIPro.Web.HSSE.Technique.ProtectionStandards" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<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" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="防护标准" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="ProtectionStandardsId" EnableColumnLines="true"
DataIDField="ProtectionStandardsId" AllowSorting="true" SortField="ProtectionStandardsCode" ForceFit="true"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server">
<Items>
<f:TextBox ID="ProtectionStandardsName" runat="server" Label="名称" EmptyText="输入查询名称"
Width="250px" LabelWidth="70px">
</f:TextBox>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnQuery" ToolTip="查询" Icon="SystemSearch" EnablePostBack="true"
OnClick="TextBox_TextChanged" runat="server" >
</f:Button>
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server"
Hidden="true">
</f:Button>
<%-- <f:Button ID="btnSelectColumns" runat="server" ToolTip="导出" Icon="FolderUp" EnablePostBack="false" Hidden="true"> --%>
<%-- </f:Button> --%>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField Width="160px" ColumnID="ProtectionStandardsCode" DataField="ProtectionStandardsCode" SortField="ProtectionStandardsCode"
FieldType="String" HeaderText="编号" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="220px" ColumnID="ProtectionStandardsName" DataField="ProtectionStandardsName" SortField="ProtectionStandardsName"
FieldType="String" HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="110px" ColumnID="CompileMan" DataField="CompileMan" SortField="CompileMan"
FieldType="String" HeaderText="编制人" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="250px" ColumnID="CompileDate" DataField="CompileDate" SortField="CompileDate"
FieldType="String" HeaderText="编制时间" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:WindowField TextAlign="Left" Width="70px" WindowID="WindowAtt" Text="详细"
ToolTip="上传查看" DataIFrameUrlFields="ProtectionStandardsId" DataIFrameUrlFormatString="../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/ProtectionStandards&menuId=8E3A5EDC-62CA-4F64-A4E7-CD3D473A6201"/>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<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:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="编辑防护标准" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
Width="750px" Height="420px">
</f:Window>
<f:Window ID="Window4" Title="选择需要导出的列" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" OnClose="Window4_Close" IsModal="true"
Width="450px" Height="250px" EnableAjax="false">
</f:Window>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Self" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="编辑" Icon="Pencil">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true" Icon="Delete"
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/jscript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
</html>

View File

@ -0,0 +1,319 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
using System.Web.UI;
namespace FineUIPro.Web.HSSE.Technique
{
public partial class ProtectionStandards : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
////权限按钮方法
this.GetButtonPower();
btnNew.OnClientClick = Window1.GetShowReference("ProtectionStandardsEdit.aspx") + "return false;";
// btnSelectColumns.OnClientClick = Window4.GetShowReference("ProtectionStandardsSelectCloumn.aspx");
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
BindGrid();
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT ProtectionStandardsId,ProtectionStandardsCode,ProtectionStandardsName,CompileMan,CompileDate,AttachUrl,AuditMan,AuditDate,IsPass,IsBuild,UpState
FROM dbo.Technique_ProtectionStandards
WHERE 1 =1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.ProtectionStandardsName.Text.Trim()))
{
strSql += " AND ProtectionStandardsName LIKE @ProtectionStandardsName";
listStr.Add(new SqlParameter("@ProtectionStandardsName", "%" + this.ProtectionStandardsName.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
BindGrid();
}
/// <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();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
/// <summary>
/// 关闭窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 右键删除事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
this.DeleteData();
}
/// <summary>
/// 删除方法
/// </summary>
private void DeleteData()
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var getV = BLL.ProtectionStandardsService.GetProtectionStandardsListById(rowID);
if (getV != null)
{
BLL.LogService.AddSys_Log(this.CurrUser, getV.ProtectionStandardsCode, getV.ProtectionStandardsId, BLL.Const.ProtectionStandardsMenuId, Const.BtnDelete);
BLL.ProtectionStandardsService.DeleteProtectionStandardsListById(rowID);
}
}
BindGrid();
ShowNotify("删除数据成功!");
}
}
#endregion
#region
/// <summary>
/// 右键编辑事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
this.EditData();
}
/// <summary>
/// 编辑数据方法
/// </summary>
private void EditData()
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
string ProtectionStandardsId = Grid1.SelectedRowID;
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProtectionStandardsEdit.aspx?ProtectionStandardsId={0}", ProtectionStandardsId, "编辑 - ")));
}
#endregion
#region Grid行双击事件
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
this.EditData();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
this.BindGrid();
BLL.LogService.AddSys_Log(this.CurrUser, string.Empty, string.Empty, BLL.Const.ProtectionStandardsMenuId, Const.BtnQuery);
}
#endregion
#region
/// <summary>
/// 关闭导出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window4_Close(object sender, WindowCloseEventArgs e)
{
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=MyExcelFile.xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Write(GetGridTableHtml(Grid1, e.CloseArgument.Split('#')));
Response.End();
}
/// <summary>
/// 导出
/// </summary>
/// <param name="grid"></param>
/// <param name="columns"></param>
/// <returns></returns>
private string GetGridTableHtml(Grid grid, string[] columns)
{
StringBuilder sb = new StringBuilder();
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
List<string> columnHeaderTexts = new List<string>(columns);
List<int> columnIndexs = new List<int>();
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
if (columnHeaderTexts.Contains(column.HeaderText))
{
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
columnIndexs.Add(column.ColumnIndex);
}
}
sb.Append("</tr>");
foreach (GridRow row in grid.Rows)
{
sb.Append("<tr>");
int columnIndex = 0;
foreach (object value in row.Values)
{
if (columnIndexs.Contains(columnIndex))
{
string html = value.ToString();
if (html.StartsWith(Grid.TEMPLATE_PLACEHOLDER_PREFIX))
{
// 模板列
string templateID = html.Substring(Grid.TEMPLATE_PLACEHOLDER_PREFIX.Length);
Control templateCtrl = row.FindControl(templateID);
html = GetRenderedHtmlSource(templateCtrl);
}
sb.AppendFormat("<td>{0}</td>", html);
}
columnIndex++;
}
sb.Append("</tr>");
}
sb.Append("</table>");
return sb.ToString();
}
/// <summary>
/// 获取控件渲染后的HTML源代码
/// </summary>
/// <param name="ctrl"></param>
/// <returns></returns>
private string GetRenderedHtmlSource(Control ctrl)
{
if (ctrl != null)
{
using (StringWriter sw = new StringWriter())
{
using (HtmlTextWriter htw = new HtmlTextWriter(sw))
{
ctrl.RenderControl(htw);
return sw.ToString();
}
}
}
return String.Empty;
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProtectionStandardsMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuEdit.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDelete.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnOut))
{
// this.btnSelectColumns.Hidden = false;
}
}
}
#endregion
}
}

View File

@ -0,0 +1,170 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.Technique
{
public partial class ProtectionStandards
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// ProtectionStandardsName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox ProtectionStandardsName;
/// <summary>
/// btnQuery control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnQuery;
/// <summary>
/// btnNew control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// ToolbarSeparator1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window4 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window4;
/// <summary>
/// WindowAtt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
/// <summary>
/// Menu1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuDelete control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDelete;
}
}

View File

@ -0,0 +1,73 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProtectionStandardsEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.Technique.ProtectionStandardsEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<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="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="txtProtectionStandardsCode" runat="server" Label="编号" Required="true"
MaxLength="50" ShowRedStar="true" FocusOnPageLoad="true" AutoPostBack="true"
OnTextChanged="TextBox_TextChanged">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtProtectionStandardsName" runat="server" Label="名称" Required="true"
MaxLength="500" ShowRedStar="true" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="ddlCompileMan" runat="server" Label="编制人">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DatePicker runat="server" Label="编制日期" ID="dpkCompileDate">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRemark" runat="server" Label="备注" MaxLength="500" LabelAlign="Right" ></f:TextArea>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Label runat="server" ID="lbTemp"></f:Label>
<f:Button ID="btnAttachUrl" Text="附件" ToolTip="附件上传及查看" Icon="TableCell" runat="server" OnClick="btnUploadResources_Click"
ValidateForms="SimpleForm1">
</f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
Hidden="true" OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
</form>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
</body>
</html>

View File

@ -0,0 +1,223 @@
using BLL;
using System;
using System.Linq;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HSSE.Technique
{
public partial class ProtectionStandardsEdit : PageBase
{
#region
/// <summary>
/// 防护标准ID
/// </summary>
public string ProtectionStandardsId
{
get
{
return (string)ViewState["ProtectionStandardsId"];
}
set
{
ViewState["ProtectionStandardsId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
////权限按钮方法
this.GetButtonPower();
btnClose.OnClientClick = ActiveWindow.GetHideReference();
//人员
UserService.InitUserDropDownList(this.ddlCompileMan, string.Empty, true);
//加载默认整理人、整理日期
this.ddlCompileMan.SelectedValue = this.CurrUser.UserId;
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
this.ProtectionStandardsId = Request.Params["ProtectionStandardsId"];
if (!string.IsNullOrEmpty(this.ProtectionStandardsId))
{
var ProtectionStandards = BLL.ProtectionStandardsService.GetProtectionStandardsListById(this.ProtectionStandardsId);
if (ProtectionStandards != null)
{
this.txtProtectionStandardsCode.Text = ProtectionStandards.ProtectionStandardsCode;
this.txtProtectionStandardsName.Text = ProtectionStandards.ProtectionStandardsName;
this.txtRemark.Text = ProtectionStandards.Remark;
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", ProtectionStandards.CompileDate);
if (!string.IsNullOrEmpty(ProtectionStandards.CompileMan))
{
this.ddlCompileMan.SelectedItem.Text = ProtectionStandards.CompileMan;
}
}
}
}
}
#endregion
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
SaveData();
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
/// <summary>
/// 保存数据
/// </summary>
private void SaveData()
{
Model.Technique_ProtectionStandards ProtectionStandards = new Model.Technique_ProtectionStandards();
if (!string.IsNullOrEmpty(this.txtProtectionStandardsCode.Text.Trim()))
{
ProtectionStandards.ProtectionStandardsCode = this.txtProtectionStandardsCode.Text.Trim();
}
else
{
ShowNotify("请输入编号", MessageBoxIcon.Warning);
return;
}
if (!string.IsNullOrEmpty(this.txtProtectionStandardsName.Text.Trim()))
{
ProtectionStandards.ProtectionStandardsName = this.txtProtectionStandardsName.Text.Trim();
}
else
{
ShowNotify("请输入名称", MessageBoxIcon.Warning);
return;
}
if (this.ddlCompileMan.SelectedValue != null)
{
ProtectionStandards.CompileMan = this.ddlCompileMan.SelectedItem.Text;
}
else
{
ProtectionStandards.CompileMan = this.CurrUser.UserName;
}
if (!string.IsNullOrEmpty(this.dpkCompileDate.Text))
{
ProtectionStandards.CompileDate = Convert.ToDateTime(this.dpkCompileDate.Text);
}
else
{
ProtectionStandards.CompileDate = DateTime.Now;
}
if (txtRemark.Text.Trim() != string.Empty)
{
ProtectionStandards.Remark = txtRemark.Text.Trim();
}
if (string.IsNullOrEmpty(this.ProtectionStandardsId))
{
ProtectionStandards.IsPass = true;
this.ProtectionStandardsId = ProtectionStandards.ProtectionStandardsId = SQLHelper.GetNewID(typeof(Model.Technique_ProtectionStandards));
BLL.ProtectionStandardsService.AddProtectionStandardsList(ProtectionStandards);
BLL.LogService.AddSys_Log(this.CurrUser, ProtectionStandards.ProtectionStandardsCode, ProtectionStandards.ProtectionStandardsId, BLL.Const.ProtectionStandardsMenuId, Const.BtnAdd);
}
else
{
ProtectionStandards.ProtectionStandardsId = this.ProtectionStandardsId;
BLL.ProtectionStandardsService.UpdateProtectionStandardsList(ProtectionStandards);
BLL.LogService.AddSys_Log(this.CurrUser, ProtectionStandards.ProtectionStandardsCode, ProtectionStandards.ProtectionStandardsId, BLL.Const.ProtectionStandardsMenuId, Const.BtnModify);
}
}
#endregion
#region
/// <summary>
/// 上传附件资源
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnUploadResources_Click(object sender, EventArgs e)
{
if (this.btnSave.Hidden)
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/ProtectionStandards&type=-1", this.ProtectionStandardsId)));
}
else
{
if (string.IsNullOrEmpty(this.txtProtectionStandardsCode.Text.Trim()))
{
ShowNotify("请输入方案编号", MessageBoxIcon.Warning);
return;
}
if (string.IsNullOrEmpty(this.txtProtectionStandardsName.Text.Trim()))
{
ShowNotify("请输入方案名称", MessageBoxIcon.Warning);
return;
}
if (string.IsNullOrEmpty(this.ProtectionStandardsId))
{
SaveData();
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/ProtectionStandards&menuId={1}", this.ProtectionStandardsId, BLL.Const.ProtectionStandardsMenuId)));
}
}
#endregion
#region
/// <summary>
/// 验证方案编号、名称是否存在
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
var q = Funs.DB.Technique_ProtectionStandards.FirstOrDefault(x => x.IsPass == true && x.ProtectionStandardsCode == this.txtProtectionStandardsCode.Text.Trim() && (x.ProtectionStandardsId != this.ProtectionStandardsId || (this.ProtectionStandardsId == null && x.ProtectionStandardsId != null)));
if (q != null)
{
ShowNotify("输入的方案编号已存在!", MessageBoxIcon.Warning);
}
var q2 = Funs.DB.Technique_ProtectionStandards.FirstOrDefault(x => x.IsPass == true && x.ProtectionStandardsName == this.txtProtectionStandardsName.Text.Trim() && (x.ProtectionStandardsId != this.ProtectionStandardsId || (this.ProtectionStandardsId == null && x.ProtectionStandardsId != null)));
if (q2 != null)
{
ShowNotify("输入的方案名称已存在!", MessageBoxIcon.Warning);
}
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProtectionStandardsMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnSave.Hidden = false;
}
}
}
#endregion
}
}

View File

@ -0,0 +1,152 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.Technique
{
public partial class ProtectionStandardsEdit
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtProtectionStandardsCode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtProtectionStandardsCode;
/// <summary>
/// txtProtectionStandardsName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtProtectionStandardsName;
/// <summary>
/// ddlCompileMan control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList ddlCompileMan;
/// <summary>
/// dpkCompileDate control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DatePicker dpkCompileDate;
/// <summary>
/// txtRemark control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextArea txtRemark;
/// <summary>
/// Toolbar1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// lbTemp control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Label lbTemp;
/// <summary>
/// btnAttachUrl control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnAttachUrl;
/// <summary>
/// ToolbarFill1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// WindowAtt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}

View File

@ -0,0 +1,108 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyResponsibilities.aspx.cs" Inherits="FineUIPro.Web.HSSE.Technique.SafetyResponsibilities" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<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" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="安全职责" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="SafetyResponsibilitiesId" EnableColumnLines="true"
DataIDField="SafetyResponsibilitiesId" AllowSorting="true" SortField="SafetyResponsibilitiesCode" ForceFit="true"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server">
<Items>
<f:TextBox ID="SafetyResponsibilitiesName" runat="server" Label="名称" EmptyText="输入查询名称"
Width="250px" LabelWidth="70px">
</f:TextBox>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnQuery" ToolTip="查询" Icon="SystemSearch" EnablePostBack="true"
OnClick="TextBox_TextChanged" runat="server" >
</f:Button>
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server"
Hidden="true">
</f:Button>
<%-- <f:Button ID="btnSelectColumns" runat="server" ToolTip="导出" Icon="FolderUp" EnablePostBack="false" Hidden="true"> --%>
<%-- </f:Button> --%>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField Width="160px" ColumnID="SafetyResponsibilitiesCode" DataField="SafetyResponsibilitiesCode" SortField="SafetyResponsibilitiesCode"
FieldType="String" HeaderText="编号" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="220px" ColumnID="SafetyResponsibilitiesName" DataField="SafetyResponsibilitiesName" SortField="SafetyResponsibilitiesName"
FieldType="String" HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="110px" ColumnID="CompileMan" DataField="CompileMan" SortField="CompileMan"
FieldType="String" HeaderText="编制人" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="250px" ColumnID="CompileDate" DataField="CompileDate" SortField="CompileDate"
FieldType="String" HeaderText="编制时间" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:WindowField TextAlign="Left" Width="70px" WindowID="WindowAtt" Text="详细"
ToolTip="上传查看" DataIFrameUrlFields="SafetyResponsibilitiesId" DataIFrameUrlFormatString="../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/SafetyResponsibilities&menuId=8E3A5EDC-62CA-4F64-A4E7-CD3D473A6201"/>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<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:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="编辑安全职责" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
Width="750px" Height="420px">
</f:Window>
<f:Window ID="Window4" Title="选择需要导出的列" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" OnClose="Window4_Close" IsModal="true"
Width="450px" Height="250px" EnableAjax="false">
</f:Window>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Self" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="编辑" Icon="Pencil">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true" Icon="Delete"
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/jscript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
</html>

View File

@ -0,0 +1,319 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
using System.Web.UI;
namespace FineUIPro.Web.HSSE.Technique
{
public partial class SafetyResponsibilities : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
////权限按钮方法
this.GetButtonPower();
btnNew.OnClientClick = Window1.GetShowReference("SafetyResponsibilitiesEdit.aspx") + "return false;";
// btnSelectColumns.OnClientClick = Window4.GetShowReference("SafetyResponsibilitiesSelectCloumn.aspx");
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
BindGrid();
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT SafetyResponsibilitiesId,SafetyResponsibilitiesCode,SafetyResponsibilitiesName,CompileMan,CompileDate,AttachUrl,AuditMan,AuditDate,IsPass,IsBuild,UpState
FROM dbo.Technique_SafetyResponsibilities
WHERE 1 =1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.SafetyResponsibilitiesName.Text.Trim()))
{
strSql += " AND SafetyResponsibilitiesName LIKE @SafetyResponsibilitiesName";
listStr.Add(new SqlParameter("@SafetyResponsibilitiesName", "%" + this.SafetyResponsibilitiesName.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
BindGrid();
}
/// <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();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
/// <summary>
/// 关闭窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 右键删除事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
this.DeleteData();
}
/// <summary>
/// 删除方法
/// </summary>
private void DeleteData()
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var getV = BLL.SafetyResponsibilitiesService.GetSafetyResponsibilitiesListById(rowID);
if (getV != null)
{
BLL.LogService.AddSys_Log(this.CurrUser, getV.SafetyResponsibilitiesCode, getV.SafetyResponsibilitiesId, BLL.Const.SafetyResponsibilitiesMenuId, Const.BtnDelete);
BLL.SafetyResponsibilitiesService.DeleteSafetyResponsibilitiesListById(rowID);
}
}
BindGrid();
ShowNotify("删除数据成功!");
}
}
#endregion
#region
/// <summary>
/// 右键编辑事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
this.EditData();
}
/// <summary>
/// 编辑数据方法
/// </summary>
private void EditData()
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
string SafetyResponsibilitiesId = Grid1.SelectedRowID;
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyResponsibilitiesEdit.aspx?SafetyResponsibilitiesId={0}", SafetyResponsibilitiesId, "编辑 - ")));
}
#endregion
#region Grid行双击事件
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
this.EditData();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
this.BindGrid();
BLL.LogService.AddSys_Log(this.CurrUser, string.Empty, string.Empty, BLL.Const.SafetyResponsibilitiesMenuId, Const.BtnQuery);
}
#endregion
#region
/// <summary>
/// 关闭导出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window4_Close(object sender, WindowCloseEventArgs e)
{
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=MyExcelFile.xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Write(GetGridTableHtml(Grid1, e.CloseArgument.Split('#')));
Response.End();
}
/// <summary>
/// 导出
/// </summary>
/// <param name="grid"></param>
/// <param name="columns"></param>
/// <returns></returns>
private string GetGridTableHtml(Grid grid, string[] columns)
{
StringBuilder sb = new StringBuilder();
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
List<string> columnHeaderTexts = new List<string>(columns);
List<int> columnIndexs = new List<int>();
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
if (columnHeaderTexts.Contains(column.HeaderText))
{
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
columnIndexs.Add(column.ColumnIndex);
}
}
sb.Append("</tr>");
foreach (GridRow row in grid.Rows)
{
sb.Append("<tr>");
int columnIndex = 0;
foreach (object value in row.Values)
{
if (columnIndexs.Contains(columnIndex))
{
string html = value.ToString();
if (html.StartsWith(Grid.TEMPLATE_PLACEHOLDER_PREFIX))
{
// 模板列
string templateID = html.Substring(Grid.TEMPLATE_PLACEHOLDER_PREFIX.Length);
Control templateCtrl = row.FindControl(templateID);
html = GetRenderedHtmlSource(templateCtrl);
}
sb.AppendFormat("<td>{0}</td>", html);
}
columnIndex++;
}
sb.Append("</tr>");
}
sb.Append("</table>");
return sb.ToString();
}
/// <summary>
/// 获取控件渲染后的HTML源代码
/// </summary>
/// <param name="ctrl"></param>
/// <returns></returns>
private string GetRenderedHtmlSource(Control ctrl)
{
if (ctrl != null)
{
using (StringWriter sw = new StringWriter())
{
using (HtmlTextWriter htw = new HtmlTextWriter(sw))
{
ctrl.RenderControl(htw);
return sw.ToString();
}
}
}
return String.Empty;
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SafetyResponsibilitiesMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuEdit.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDelete.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnOut))
{
// this.btnSelectColumns.Hidden = false;
}
}
}
#endregion
}
}

View File

@ -0,0 +1,170 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.Technique
{
public partial class SafetyResponsibilities
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// SafetyResponsibilitiesName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox SafetyResponsibilitiesName;
/// <summary>
/// btnQuery control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnQuery;
/// <summary>
/// btnNew control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// ToolbarSeparator1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window4 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window4;
/// <summary>
/// WindowAtt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
/// <summary>
/// Menu1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuDelete control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDelete;
}
}

View File

@ -0,0 +1,72 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyResponsibilitiesEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.Technique.SafetyResponsibilitiesEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<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="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="txtSafetyResponsibilitiesCode" runat="server" Label="编号" Required="true"
MaxLength="50" ShowRedStar="true" FocusOnPageLoad="true" AutoPostBack="true"
OnTextChanged="TextBox_TextChanged">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtSafetyResponsibilitiesName" runat="server" Label="名称" Required="true"
MaxLength="500" ShowRedStar="true" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="ddlCompileMan" runat="server" Label="编制人">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DatePicker runat="server" Label="编制日期" ID="dpkCompileDate">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRemark" runat="server" Label="备注" MaxLength="500" LabelAlign="Right"></f:TextArea>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Label runat="server" ID="lbTemp"></f:Label>
<f:Button ID="btnAttachUrl" Text="附件" ToolTip="附件上传及查看" Icon="TableCell" runat="server" OnClick="btnUploadResources_Click"
ValidateForms="SimpleForm1">
</f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
Hidden="true" OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
</form>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
</body>
</html>

View File

@ -0,0 +1,221 @@
using BLL;
using System;
using System.Linq;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HSSE.Technique
{
public partial class SafetyResponsibilitiesEdit : PageBase
{
#region
/// <summary>
/// 防护标准ID
/// </summary>
public string SafetyResponsibilitiesId
{
get
{
return (string)ViewState["SafetyResponsibilitiesId"];
}
set
{
ViewState["SafetyResponsibilitiesId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
////权限按钮方法
this.GetButtonPower();
btnClose.OnClientClick = ActiveWindow.GetHideReference();
//人员
UserService.InitUserDropDownList(this.ddlCompileMan, string.Empty, true);
//加载默认整理人、整理日期
this.ddlCompileMan.SelectedValue = this.CurrUser.UserId;
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
this.SafetyResponsibilitiesId = Request.Params["SafetyResponsibilitiesId"];
if (!string.IsNullOrEmpty(this.SafetyResponsibilitiesId))
{
var SafetyResponsibilities = BLL.SafetyResponsibilitiesService.GetSafetyResponsibilitiesListById(this.SafetyResponsibilitiesId);
if (SafetyResponsibilities != null)
{
this.txtSafetyResponsibilitiesCode.Text = SafetyResponsibilities.SafetyResponsibilitiesCode;
this.txtSafetyResponsibilitiesName.Text = SafetyResponsibilities.SafetyResponsibilitiesName;
this.txtRemark.Text = SafetyResponsibilities.Remark;
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", SafetyResponsibilities.CompileDate);
if (!string.IsNullOrEmpty(SafetyResponsibilities.CompileMan))
{
this.ddlCompileMan.SelectedItem.Text = SafetyResponsibilities.CompileMan;
}
}
}
}
}
#endregion
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
SaveData();
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
/// <summary>
/// 保存数据
/// </summary>
private void SaveData()
{
Model.Technique_SafetyResponsibilities SafetyResponsibilities = new Model.Technique_SafetyResponsibilities();
if (!string.IsNullOrEmpty(this.txtSafetyResponsibilitiesCode.Text.Trim()))
{
SafetyResponsibilities.SafetyResponsibilitiesCode = this.txtSafetyResponsibilitiesCode.Text.Trim();
}
else
{
ShowNotify("请输入编号", MessageBoxIcon.Warning);
return;
}
if (!string.IsNullOrEmpty(this.txtSafetyResponsibilitiesName.Text.Trim()))
{
SafetyResponsibilities.SafetyResponsibilitiesName = this.txtSafetyResponsibilitiesName.Text.Trim();
}
else
{
ShowNotify("请输入名称", MessageBoxIcon.Warning);
return;
}
if (this.ddlCompileMan.SelectedValue != null)
{
SafetyResponsibilities.CompileMan = this.ddlCompileMan.SelectedItem.Text;
}
else
{
SafetyResponsibilities.CompileMan = this.CurrUser.UserName;
}
if (!string.IsNullOrEmpty(this.dpkCompileDate.Text))
{
SafetyResponsibilities.CompileDate = Convert.ToDateTime(this.dpkCompileDate.Text);
}
else
{
SafetyResponsibilities.CompileDate = DateTime.Now;
}
if (txtRemark.Text.Trim() != string.Empty)
{
SafetyResponsibilities.Remark = txtRemark.Text.Trim();
}
if (string.IsNullOrEmpty(this.SafetyResponsibilitiesId))
{
SafetyResponsibilities.IsPass = true;
this.SafetyResponsibilitiesId = SafetyResponsibilities.SafetyResponsibilitiesId = SQLHelper.GetNewID(typeof(Model.Technique_SafetyResponsibilities));
BLL.SafetyResponsibilitiesService.AddSafetyResponsibilitiesList(SafetyResponsibilities);
BLL.LogService.AddSys_Log(this.CurrUser, SafetyResponsibilities.SafetyResponsibilitiesCode, SafetyResponsibilities.SafetyResponsibilitiesId, BLL.Const.SafetyResponsibilitiesMenuId, Const.BtnAdd);
}
else
{
SafetyResponsibilities.SafetyResponsibilitiesId = this.SafetyResponsibilitiesId;
BLL.SafetyResponsibilitiesService.UpdateSafetyResponsibilitiesList(SafetyResponsibilities);
BLL.LogService.AddSys_Log(this.CurrUser, SafetyResponsibilities.SafetyResponsibilitiesCode, SafetyResponsibilities.SafetyResponsibilitiesId, BLL.Const.SafetyResponsibilitiesMenuId, Const.BtnModify);
}
}
#endregion
#region
/// <summary>
/// 上传附件资源
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnUploadResources_Click(object sender, EventArgs e)
{
if (this.btnSave.Hidden)
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/SafetyResponsibilities&type=-1", this.SafetyResponsibilitiesId)));
}
else
{
if (string.IsNullOrEmpty(this.txtSafetyResponsibilitiesCode.Text.Trim()))
{
ShowNotify("请输入方案编号", MessageBoxIcon.Warning);
return;
}
if (string.IsNullOrEmpty(this.txtSafetyResponsibilitiesName.Text.Trim()))
{
ShowNotify("请输入方案名称", MessageBoxIcon.Warning);
return;
}
if (string.IsNullOrEmpty(this.SafetyResponsibilitiesId))
{
SaveData();
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/SafetyResponsibilities&menuId={1}", this.SafetyResponsibilitiesId, BLL.Const.SafetyResponsibilitiesMenuId)));
}
}
#endregion
#region
/// <summary>
/// 验证方案编号、名称是否存在
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
var q = Funs.DB.Technique_SafetyResponsibilities.FirstOrDefault(x => x.IsPass == true && x.SafetyResponsibilitiesCode == this.txtSafetyResponsibilitiesCode.Text.Trim() && (x.SafetyResponsibilitiesId != this.SafetyResponsibilitiesId || (this.SafetyResponsibilitiesId == null && x.SafetyResponsibilitiesId != null)));
if (q != null)
{
ShowNotify("输入的方案编号已存在!", MessageBoxIcon.Warning);
}
var q2 = Funs.DB.Technique_SafetyResponsibilities.FirstOrDefault(x => x.IsPass == true && x.SafetyResponsibilitiesName == this.txtSafetyResponsibilitiesName.Text.Trim() && (x.SafetyResponsibilitiesId != this.SafetyResponsibilitiesId || (this.SafetyResponsibilitiesId == null && x.SafetyResponsibilitiesId != null)));
if (q2 != null)
{
ShowNotify("输入的方案名称已存在!", MessageBoxIcon.Warning);
}
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SafetyResponsibilitiesMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnSave.Hidden = false;
}
}
}
#endregion
}
}

View File

@ -0,0 +1,152 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HSSE.Technique
{
public partial class SafetyResponsibilitiesEdit
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtSafetyResponsibilitiesCode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtSafetyResponsibilitiesCode;
/// <summary>
/// txtSafetyResponsibilitiesName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtSafetyResponsibilitiesName;
/// <summary>
/// ddlCompileMan control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList ddlCompileMan;
/// <summary>
/// dpkCompileDate control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DatePicker dpkCompileDate;
/// <summary>
/// txtRemark control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextArea txtRemark;
/// <summary>
/// Toolbar1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// lbTemp control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Label lbTemp;
/// <summary>
/// btnAttachUrl control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnAttachUrl;
/// <summary>
/// ToolbarFill1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// WindowAtt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}

View File

@ -250,13 +250,20 @@
<div class="bw-b-bottom-up">
<div class="bw-item-content pd0">
<div class="base-wrap flex flexV">
<div class="base-tit">当前现场总人数</div>
<div class="base-txt-wrap flex flex1">
<div class="num-1 specialNum" runat="server" id="divperson">0</div>
<div class="num-1 specialNum" runat="server" id="person00">0</div>
<div class="num-1 specialNum" runat="server" id="person01">0</div>
<div class="num-1 specialNum" runat="server" id="person02">0</div>
</div>
<div class="base-tit">当日现场人数</div>
<div class="base-txt-wrap flex flex1">
<div class="num-1 specialNum" runat="server" id="divperson">0</div>
<div class="num-1 specialNum" runat="server" id="person00">0</div>
<div class="num-1 specialNum" runat="server" id="person01">0</div>
<div class="num-1 specialNum" runat="server" id="person02">0</div>
</div>
<div class="base-tit">当月现场人数</div>
<div class="base-txt-wrap flex flex1">
<div class="num-1 specialNum" runat="server" id="divperson1">0</div>
<div class="num-1 specialNum" runat="server" id="person001">0</div>
<div class="num-1 specialNum" runat="server" id="person011">0</div>
<div class="num-1 specialNum" runat="server" id="person021">0</div>
</div>
</div>
</div>
</div>
@ -315,9 +322,9 @@
<div class="bw-b-bottom-up">
<div class="tab-wrap">
<div class="tab" data-value="4">
<div class="t-item active">施工分包商</div>
<%-- <div class="t-item">施工分包商</div> --%>
<div class="spline"></div>
<div class="t-item">问题类别</div>
<div class="t-item active ">问题类别</div>
</div>
</div>
<div class="bw-item-content">
@ -686,20 +693,20 @@ var basePath = '<%= ResolveUrl("~/") %>';
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option)
}
var four1 =<%=Four1 %>;
var xArr = four1.categories
var four2 =<%=Four2 %>;
var xArr = four2.categories
var series = [{
name: '待整改',
type: 'bar',
barWidth: 20,
barGap:0.05,
data: four1.series[0].data,
data: four2.series[0].data,
itemStyle: { normal: { color: '#88cc00' } }
}, {
name: '全部',
type: 'bar',
barWidth: 20,
data: four1.series[0].data2,
data: four2.series[0].data2,
itemStyle: { normal: { color: '#AE4B23' } }
}];
category_Four('four', xArr, series)

View File

@ -5,6 +5,8 @@ using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Data.SqlClient;
namespace FineUIPro.Web
{
@ -43,48 +45,151 @@ namespace FineUIPro.Web
/// </summary>
private void getSitePerson()
{
int AllCount = 0;
//var getallin = APIPageDataService.getPersonInOutNum(this.ProjectId, DateTime.Now.AddDays(-1));
DateTime dateValue = DateTime.Now.AddDays(-1);
List<Model.PageDataPersonInOutItem> getallin = new List<Model.PageDataPersonInOutItem>();
var getInMaxs = from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
where x.ProjectId == this.CurrUser.LoginProjectId && x.IsUsed == true
select new Model.PageDataPersonInOutItem
{
PersonId = x.PersonId,
PostType = y.PostType,
WorkPostId = x.WorkPostId,
};
if (getInMaxs.Count() > 0)
// int AllCount = 0;
// //var getallin = APIPageDataService.getPersonInOutNum(this.ProjectId, DateTime.Now.AddDays(-1));
// DateTime dateValue = DateTime.Now.AddDays(-1);
// List<Model.PageDataPersonInOutItem> getallin = new List<Model.PageDataPersonInOutItem>();
// var getInMaxs = from x in Funs.DB.SitePerson_Person
// join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId
// where x.ProjectId == this.CurrUser.LoginProjectId && x.IsUsed == true
// select new Model.PageDataPersonInOutItem
// {
// PersonId = x.PersonId,
// PostType = y.PostType,
// WorkPostId = x.WorkPostId,
// };
// if (getInMaxs.Count() > 0)
// {
// getallin = getInMaxs.Distinct().ToList();
// }
// //AllCount = getallin.Count();
// var getEmployInOutRecords = (from x in Funs.DB.T_d_EmployInOutRecord
// join y in Funs.DB.SitePerson_Person on new { ss1 = x.ProjectId, ss = x.IDCardNo } equals new { ss1 = y.ProjectId, ss = y.IdentityCard }
// where y.ProjectId == this.CurrUser.LoginProjectId && y.IsUsed == true && x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date
// select x.IDCardNo).Distinct();
//
// //if (AllCount > 0)
// //{
// // ////总人数
// // this.divperson.InnerHtml = ((AllCount % 10000) / 1000).ToString();
// // this.person00.InnerHtml = ((AllCount % 1000) / 100).ToString();
// // this.person01.InnerHtml = ((AllCount % 100) / 10).ToString();
// // this.person02.InnerHtml = (AllCount % 10).ToString();
// //}
//
//
// AllCount = getEmployInOutRecords.Count();
// if (AllCount > 0)
// {
// ////总人数
// this.divperson.InnerHtml = ((AllCount % 10000) / 1000).ToString();
// this.person00.InnerHtml = ((AllCount % 1000) / 100).ToString();
// this.person01.InnerHtml = ((AllCount % 100) / 10).ToString();
// this.person02.InnerHtml = (AllCount % 10).ToString();
// }
string strSql = @"SELECT DISTINCT ProjectUser.ProjectUserId,ProjectUser.ProjectId,ProjectUser.UserId,ProjectUser.WorkAreaId,Users.UserCode,Users.UserName,ProjectUser.UnitId,Unit.UnitCode,Unit.UnitName,ProjectUnit.UnitType,sysConst.ConstText AS UnitTypeName,ProjectUser.RoleId,ProjectUser.IsPost,(CASE WHEN ProjectUser.IsPost = 1 THEN '在岗' ELSE '离岗' END) AS IsPostName,WorkPost.WorkPostName,UnitCode"
+ @" ,RoleName= STUFF(( SELECT ',' + RoleName FROM dbo.Sys_Role where PATINDEX('%,' + RTRIM(RoleId) + ',%',',' +ProjectUser.RoleId + ',')>0 FOR XML PATH('')), 1, 1,'')"
+ @" FROM Project_ProjectUser AS ProjectUser "
+ @" LEFT JOIN Base_Project AS Project ON ProjectUser.ProjectId = Project.ProjectId "
+ @" LEFT JOIN Sys_User AS Users ON ProjectUser.UserId = Users.UserId "
+ @" LEFT JOIN Sys_Role AS Role ON ProjectUser.RoleId = Role.RoleId "
+ @" LEFT JOIN Project_ProjectUnit AS ProjectUnit ON ProjectUser.UnitId = ProjectUnit.UnitId AND ProjectUser.ProjectId= ProjectUnit.ProjectId "
+ @" LEFT JOIN Base_Unit AS Unit ON ProjectUser.UnitId = Unit.UnitId "
+ @" LEFT JOIN SitePerson_Person AS Person ON ProjectUser.ProjectId =Person.ProjectId AND Users.IdentityCard = Person.IdentityCard "
+ @" LEFT JOIN Base_WorkPost AS WorkPost ON Person.WorkPostId =WorkPost.WorkPostId "
+ @" LEFT JOIN Sys_Const AS sysConst ON sysConst.GroupId = '" + BLL.ConstValue.Group_ProjectUnitType + "' AND ProjectUnit.UnitType=sysConst.ConstValue "
+ @" WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND ProjectUser.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
var projectPeople = tb.Rows.Count;
//当前日
// 获取当前日期的00点
DateTime now = DateTime.Now;
DateTime StartDate = DateTime.Now.Date;
DateTime EndDate = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59);
//当前月
// 获取当前年份和月份
int year = DateTime.Now.Year;
int month = DateTime.Now.Month;
// 获取当前月份的开始00点
DateTime startOfMonth = new DateTime(year, month, 1);
DateTime startOfNextMonth = startOfMonth.AddMonths(1);
// 如果你需要当前月份的最后一天的23:59:59
DateTime endOfMonth = startOfNextMonth.AddSeconds(-1);
string strSql1 = "SELECT ClassMeeting.ClassMeetingId,ClassMeeting.ProjectId,CodeRecords.Code AS ClassMeetingCode,Unit.UnitId,Unit.UnitName,ClassMeeting.ClassMeetingName,ClassMeeting.ClassMeetingDate,ClassMeeting.CompileMan,ClassMeeting.ClassMeetingContents,ClassMeeting.CompileDate,ClassMeeting.States "
+ @" ,(CASE WHEN ClassMeeting.States = " + BLL.Const.State_0 + " OR ClassMeeting.States IS NULL THEN '待['+ISNULL(OperateUser.UserName,Users.UserName)+']提交' WHEN ClassMeeting.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperateUser.UserName+']办理' END) AS FlowOperateName"
+ @" FROM Meeting_ClassMeeting AS ClassMeeting "
+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON ClassMeeting.ClassMeetingId = CodeRecords.DataId "
+ @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON ClassMeeting.ClassMeetingId = FlowOperate.DataId AND FlowOperate.IsClosed <> 1"
+ @" LEFT JOIN Sys_User AS OperateUser ON FlowOperate.OperaterId=OperateUser.UserId"
+ @" LEFT JOIN Sys_User AS Users ON ClassMeeting.CompileMan = Users.UserId"
+ @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId=Users.UnitId WHERE 1=1 ";
List<SqlParameter> listStr1 = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
getallin = getInMaxs.Distinct().ToList();
strSql1 += " AND ClassMeeting.ProjectId = @ProjectId";
listStr1.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
}
//AllCount = getallin.Count();
var getEmployInOutRecords = (from x in Funs.DB.T_d_EmployInOutRecord
join y in Funs.DB.SitePerson_Person on new { ss1 = x.ProjectId, ss = x.IDCardNo } equals new { ss1 = y.ProjectId, ss = y.IdentityCard }
where y.ProjectId == this.CurrUser.LoginProjectId && y.IsUsed == true && x.ProjectId == this.CurrUser.LoginProjectId && x.RecordDate.Value == DateTime.Now.Date
select x.IDCardNo).Distinct();
//if (AllCount > 0)
//{
// ////总人数
// this.divperson.InnerHtml = ((AllCount % 10000) / 1000).ToString();
// this.person00.InnerHtml = ((AllCount % 1000) / 100).ToString();
// this.person01.InnerHtml = ((AllCount % 100) / 10).ToString();
// this.person02.InnerHtml = (AllCount % 10).ToString();
//}
AllCount = getEmployInOutRecords.Count();
if (AllCount > 0)
strSql1 += " AND ClassMeeting.ClassMeetingDate BETWEEN @StartDate AND @EndDate";
listStr1.Add(new SqlParameter("@StartDate", StartDate));
listStr1.Add(new SqlParameter("@EndDate", EndDate));
SqlParameter[] parameter1 = listStr1.ToArray();
DataTable tb1 = SQLHelper.GetDataTableRunText(strSql1, parameter1);
var dr = tb1.Rows.Count;
string strSql2 = "SELECT ClassMeeting.ClassMeetingId,ClassMeeting.ProjectId,CodeRecords.Code AS ClassMeetingCode,Unit.UnitId,Unit.UnitName,ClassMeeting.ClassMeetingName,ClassMeeting.ClassMeetingDate,ClassMeeting.CompileMan,ClassMeeting.ClassMeetingContents,ClassMeeting.CompileDate,ClassMeeting.States "
+ @" ,(CASE WHEN ClassMeeting.States = " + BLL.Const.State_0 + " OR ClassMeeting.States IS NULL THEN '待['+ISNULL(OperateUser.UserName,Users.UserName)+']提交' WHEN ClassMeeting.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperateUser.UserName+']办理' END) AS FlowOperateName"
+ @" FROM Meeting_ClassMeeting AS ClassMeeting "
+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON ClassMeeting.ClassMeetingId = CodeRecords.DataId "
+ @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON ClassMeeting.ClassMeetingId = FlowOperate.DataId AND FlowOperate.IsClosed <> 1"
+ @" LEFT JOIN Sys_User AS OperateUser ON FlowOperate.OperaterId=OperateUser.UserId"
+ @" LEFT JOIN Sys_User AS Users ON ClassMeeting.CompileMan = Users.UserId"
+ @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId=Users.UnitId WHERE 1=1 ";
List<SqlParameter> listStr2 = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
strSql2 += " AND ClassMeeting.ProjectId = @ProjectId";
listStr2.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
}
strSql2 += " AND ClassMeeting.ClassMeetingDate BETWEEN @StartDate AND @EndDate";
listStr2.Add(new SqlParameter("@StartDate", startOfMonth));
listStr2.Add(new SqlParameter("@EndDate", endOfMonth));
SqlParameter[] parameter2 = listStr2.ToArray();
DataTable tb2 = SQLHelper.GetDataTableRunText(strSql2, parameter2);
var dy = tb2.Rows.Count;
var count1 = projectPeople + dr;
var count2 = projectPeople + dy;
if (count1 > 0)
{
////总人数
this.divperson.InnerHtml = ((AllCount % 10000) / 1000).ToString();
this.person00.InnerHtml = ((AllCount % 1000) / 100).ToString();
this.person01.InnerHtml = ((AllCount % 100) / 10).ToString();
this.person02.InnerHtml = (AllCount % 10).ToString();
this.divperson.InnerHtml = ((count1 % 10000) / 1000).ToString();
this.person00.InnerHtml = ((count1 % 1000) / 100).ToString();
this.person01.InnerHtml = ((count1 % 100) / 10).ToString();
this.person02.InnerHtml = (count1 % 10).ToString();
}
if (count2 > 0)
{
////总人数
this.divperson1.InnerHtml = ((count2 % 10000) / 1000).ToString();
this.person001.InnerHtml = ((count2 % 1000) / 100).ToString();
this.person011.InnerHtml = ((count2 % 100) / 10).ToString();
this.person021.InnerHtml = (count2 % 10).ToString();
}
}
#endregion

View File

@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web {
public partial class mainMenu_HSSE {
namespace FineUIPro.Web
{
public partial class mainMenu_HSSE
{
/// <summary>
/// Head1 控件。
/// </summary>
@ -20,7 +22,7 @@ namespace FineUIPro.Web {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlHead Head1;
/// <summary>
/// divperson 控件。
/// </summary>
@ -29,7 +31,7 @@ namespace FineUIPro.Web {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divperson;
/// <summary>
/// person00 控件。
/// </summary>
@ -38,7 +40,7 @@ namespace FineUIPro.Web {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl person00;
/// <summary>
/// person01 控件。
/// </summary>
@ -47,7 +49,7 @@ namespace FineUIPro.Web {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl person01;
/// <summary>
/// person02 控件。
/// </summary>
@ -56,7 +58,43 @@ namespace FineUIPro.Web {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl person02;
/// <summary>
/// divperson1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divperson1;
/// <summary>
/// person001 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl person001;
/// <summary>
/// person011 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl person011;
/// <summary>
/// person021 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl person021;
/// <summary>
/// xmb 控件。
/// </summary>

File diff suppressed because it is too large Load Diff