危害因素调整

This commit is contained in:
夏菊 2026-04-28 17:06:01 +08:00
parent 1dd8189661
commit d170dd6603
37 changed files with 2883 additions and 30 deletions

View File

@ -0,0 +1,139 @@
--
IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = '1AFAEEB9-B93C-4472-B81E-081436341263')
BEGIN
INSERT INTO dbo.Sys_Menu (MenuId, MenuName,Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
VALUES (N'1AFAEEB9-B93C-4472-B81E-081436341263', N'不符合项', N'', 50, N'D363BD9D-4DEC-45D8-89C8-B0E49DEF61B4', N'Menu_SysSet', 1,0, 1);
END
GO
IF NOT EXISTS (SELECT * FROM Sys_Menu WHERE MenuId = '1AFAEEB9-B93C-4472-B81E-081436341001')
BEGIN
INSERT INTO dbo.Sys_Menu (MenuId, MenuName,Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
VALUES (N'1AFAEEB9-B93C-4472-B81E-081436341001', N'安全问题分类', N'BaseInfo/SafetyProblemClassify.aspx', 10, N'1AFAEEB9-B93C-4472-B81E-081436341263', N'Menu_SysSet', 1,1, 1);
INSERT INTO dbo.Sys_Menu (MenuId, MenuName,Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
VALUES (N'1AFAEEB9-B93C-4472-B81E-081436341002', N'安全问题性质', N'BaseInfo/SafetyProblemNature.aspx', 20, N'1AFAEEB9-B93C-4472-B81E-081436341263', N'Menu_SysSet', 1,1, 1);
INSERT INTO dbo.Sys_Menu (MenuId, MenuName,Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
VALUES (N'1AFAEEB9-B93C-4472-B81E-081436342001', N'质量问题分类', N'BaseInfo/QualityProblemClassify.aspx', 110, N'1AFAEEB9-B93C-4472-B81E-081436341263', N'Menu_SysSet', 1,1, 1);
INSERT INTO dbo.Sys_Menu (MenuId, MenuName,Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
VALUES (N'1AFAEEB9-B93C-4472-B81E-081436342002', N'质量问题性质', N'BaseInfo/QualityProblemNature.aspx', 120, N'1AFAEEB9-B93C-4472-B81E-081436341263', N'Menu_SysSet', 1,1, 1);
END
GO
IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '1AFAEEB9-B93C-4472-B81E-081436341001')
BEGIN
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'DCAC5651-BBCD-4F4E-9CBA-C9E8B6090001', N'1AFAEEB9-B93C-4472-B81E-081436341001', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'DCAC5651-BBCD-4F4E-9CBA-C9E8B6090002', N'1AFAEEB9-B93C-4472-B81E-081436341001', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'DCAC5651-BBCD-4F4E-9CBA-C9E8B6090003', N'1AFAEEB9-B93C-4472-B81E-081436341001', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'DCAC5651-BBCD-4F4E-9CBA-C9E8B6090004', N'1AFAEEB9-B93C-4472-B81E-081436341001', N'保存', 4);
END
GO
IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '1AFAEEB9-B93C-4472-B81E-081436341002')
BEGIN
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'ECAC5651-BBCD-4F4E-9CBA-C9E8B6090001', N'1AFAEEB9-B93C-4472-B81E-081436341002', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'ECAC5651-BBCD-4F4E-9CBA-C9E8B6090002', N'1AFAEEB9-B93C-4472-B81E-081436341002', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'ECAC5651-BBCD-4F4E-9CBA-C9E8B6090003', N'1AFAEEB9-B93C-4472-B81E-081436341002', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'ECAC5651-BBCD-4F4E-9CBA-C9E8B6090004', N'1AFAEEB9-B93C-4472-B81E-081436341002', N'保存', 4);
END
GO
IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '1AFAEEB9-B93C-4472-B81E-081436342001')
BEGIN
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'FCAC5651-BBCD-4F4E-9CBA-C9E8B6090001', N'1AFAEEB9-B93C-4472-B81E-081436342001', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'FCAC5651-BBCD-4F4E-9CBA-C9E8B6090002', N'1AFAEEB9-B93C-4472-B81E-081436342001', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'FCAC5651-BBCD-4F4E-9CBA-C9E8B6090003', N'1AFAEEB9-B93C-4472-B81E-081436342001', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'FCAC5651-BBCD-4F4E-9CBA-C9E8B6090004', N'1AFAEEB9-B93C-4472-B81E-081436342001', N'保存', 4);
END
GO
IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '1AFAEEB9-B93C-4472-B81E-081436342002')
BEGIN
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'CCAC5651-BBCD-4F4E-9CBA-C9E8B6090001', N'1AFAEEB9-B93C-4472-B81E-081436342002', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'CCAC5651-BBCD-4F4E-9CBA-C9E8B6090002', N'1AFAEEB9-B93C-4472-B81E-081436342002', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'CCAC5651-BBCD-4F4E-9CBA-C9E8B6090003', N'1AFAEEB9-B93C-4472-B81E-081436342002', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (N'CCAC5651-BBCD-4F4E-9CBA-C9E8B6090004', N'1AFAEEB9-B93C-4472-B81E-081436342002', N'保存', 4);
END
GO
--
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Base_SafetyProblemClassify') AND type = N'U')
BEGIN
CREATE TABLE [dbo].[Base_SafetyProblemClassify](
[ClassifyId] [nvarchar](50) NOT NULL,
[ClassifyCode] [nvarchar](50) NOT NULL,
[ClassifyName] [nvarchar](100) NOT NULL,
CONSTRAINT [PK_Base_SafetyProblemClassify] PRIMARY KEY CLUSTERED
(
[ClassifyId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassify', @level2type=N'COLUMN',@level2name=N'ClassifyId'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassify', @level2type=N'COLUMN',@level2name=N'ClassifyCode'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassify', @level2type=N'COLUMN',@level2name=N'ClassifyName'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'安全问题分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassify'
END
GO
--
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Base_SafetyProblemClassifyItem') AND type = N'U')
BEGIN
CREATE TABLE [dbo].[Base_SafetyProblemClassifyItem](
[ClassifyItemId] [nvarchar](50) NOT NULL,
[ClassifyId] [nvarchar](50) NULL,
[ClassifyItemCode] [nvarchar](50) NULL,
[ClassifyItemName] [nvarchar](100) NULL,
[CompileMan] [nvarchar](50) NULL,
[CompileManName] [nvarchar](50) NULL,
[CompileDate] [datetime] NULL,
CONSTRAINT [PK_Base_SafetyProblemClassifyItem] PRIMARY KEY CLUSTERED
(
[ClassifyItemId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
ALTER TABLE [dbo].[Base_SafetyProblemClassifyItem] WITH CHECK ADD CONSTRAINT [FK_Base_SafetyProblemClassifyItem_Classify] FOREIGN KEY([ClassifyId])
REFERENCES [dbo].[Base_SafetyProblemClassify] ([ClassifyId])
ALTER TABLE [dbo].[Base_SafetyProblemClassifyItem] CHECK CONSTRAINT [FK_Base_SafetyProblemClassifyItem_Classify]
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子类id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassifyItem', @level2type=N'COLUMN',@level2name=N'ClassifyItemId'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassifyItem', @level2type=N'COLUMN',@level2name=N'ClassifyId'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassifyItem', @level2type=N'COLUMN',@level2name=N'ClassifyItemCode'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassifyItem', @level2type=N'COLUMN',@level2name=N'ClassifyItemName'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'安全问题子类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemClassifyItem'
END
GO

View File

@ -0,0 +1,41 @@
ALTER TABLE HazardFactor_Safety
ALTER COLUMN Hazard NVARCHAR(2000);
ALTER TABLE HazardFactor_Safety
ALTER COLUMN NetRiskControlMeasures NVARCHAR(2000);
ALTER TABLE HazardFactor_Safety
ALTER COLUMN AdditionalControlMeasures NVARCHAR(2000);
ALTER TABLE HazardFactor_Safety
ALTER COLUMN ProjectId NVARCHAR(50) null;
ALTER TABLE HazardFactor_Safety
ADD UnitId NVARCHAR(50) null;
ALTER TABLE HazardFactor_Safety
ADD UnitProjectName NVARCHAR(200) null;
ALTER TABLE HazardFactor_OccHealth
ALTER COLUMN Hazard NVARCHAR(2000);
ALTER TABLE HazardFactor_OccHealth
ALTER COLUMN NetRiskControlMeasures NVARCHAR(2000);
ALTER TABLE HazardFactor_OccHealth
ALTER COLUMN AdditionalControlMeasures NVARCHAR(2000);
ALTER TABLE HazardFactor_OccHealth
ALTER COLUMN ProjectId NVARCHAR(50) null;
ALTER TABLE HazardFactor_OccHealth
ADD UnitId NVARCHAR(50) null;
ALTER TABLE HazardFactor_OccHealth
ADD UnitProjectName NVARCHAR(200) null;

View File

@ -255,6 +255,8 @@
<Compile Include="BaseInfo\BaseFactoryService.cs" />
<Compile Include="BaseInfo\CertificateService.cs" />
<Compile Include="BaseInfo\CNProfessionalService.cs" />
<Compile Include="BaseInfo\SafetyProblemClassifyItemService.cs" />
<Compile Include="BaseInfo\SafetyProblemClassifyService.cs" />
<Compile Include="BaseInfo\CostTypeService.cs" />
<Compile Include="BaseInfo\DesignProfessionalService.cs" />
<Compile Include="BaseInfo\EmergencyTypeService.cs" />

View File

@ -0,0 +1,112 @@
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
/// <summary>
/// 安全问题分类
/// </summary>
public class SafetyProblemClassifyItemService
{
/// <summary>
/// 根据主键获取安全问题分类明细信息
/// </summary>
/// <param name="ItemId"></param>
/// <returns></returns>
public static Model.Base_SafetyProblemClassifyItem GetClassifyItemById(string ItemId)
{
Model.CNPCDB db = Funs.DB;
return db.Base_SafetyProblemClassifyItem.FirstOrDefault(e => e.ClassifyItemId == ItemId);
}
/// <summary>
/// 添加安全问题分类明细
/// </summary>
/// <param name="model"></param>
public static void AddClassifyItem(Model.Base_SafetyProblemClassifyItem model)
{
Model.CNPCDB db = Funs.DB;
Model.Base_SafetyProblemClassifyItem newModel = new Model.Base_SafetyProblemClassifyItem();
newModel.ClassifyItemId = model.ClassifyItemId;
newModel.ClassifyId = model.ClassifyId;
newModel.ClassifyItemCode = model.ClassifyItemCode;
newModel.ClassifyItemName = model.ClassifyItemName;
newModel.CompileMan = model.CompileMan;
newModel.CompileManName = model.CompileManName;
newModel.CompileDate = model.CompileDate;
db.Base_SafetyProblemClassifyItem.InsertOnSubmit(newModel);
db.SubmitChanges();
}
/// <summary>
/// 修改安全问题分类明细
/// </summary>
/// <param name="model"></param>
public static void UpdateClassifyItem(Model.Base_SafetyProblemClassifyItem model)
{
Model.CNPCDB db = Funs.DB;
Model.Base_SafetyProblemClassifyItem newModel = db.Base_SafetyProblemClassifyItem.FirstOrDefault(e => e.ClassifyItemId == model.ClassifyItemId);
if (newModel != null)
{
newModel.ClassifyId = model.ClassifyId;
newModel.ClassifyItemCode = model.ClassifyItemCode;
newModel.ClassifyItemName = model.ClassifyItemName;
newModel.CompileMan = model.CompileMan;
newModel.CompileManName = model.CompileManName;
newModel.CompileDate = model.CompileDate;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除明细信息
/// </summary>
/// <param name="companyTrainItemId"></param>
public static void DeleteClassifyItemById(string companyTrainItemId)
{
Model.CNPCDB db = Funs.DB;
Model.Base_SafetyProblemClassifyItem model = db.Base_SafetyProblemClassifyItem.FirstOrDefault(e => e.ClassifyItemId == companyTrainItemId);
if (model != null)
{
db.Base_SafetyProblemClassifyItem.DeleteOnSubmit(model);
db.SubmitChanges();
}
}
/// <summary>
/// 教材库下拉框
/// </summary>
/// <param name="dropName">下拉框名字</param>
/// <param name="workPostId">职务Id</param>
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitClassifyItemDownList(FineUIPro.DropDownList dropName, string workPostId, bool isShowPlease)
{
dropName.DataValueField = "ClassifyItemId";
dropName.DataTextField = "ClassifyItemName";
dropName.DataSource = GetClassifyItemList(workPostId);
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
/// <summary>
/// 获取下拉项
/// </summary>
/// <param name="classifyId"></param>
/// <returns></returns>
public static List<Model.Base_SafetyProblemClassifyItem> GetClassifyItemList(string classifyId)
{
var lst = (from x in Funs.DB.Base_SafetyProblemClassifyItem orderby x.ClassifyItemCode select x).ToList();
if (!string.IsNullOrWhiteSpace(classifyId))
{
lst = lst.Where(x => x.ClassifyId == classifyId).ToList();
}
return lst;
}
}
}

View File

@ -0,0 +1,136 @@
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
/// <summary>
/// 安全问题分类主表
/// </summary>
public class SafetyProblemClassifyService
{
/// <summary>
/// 根据主键获取安全问题分类
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public static Model.Base_SafetyProblemClassify GetClassifyById(string Id)
{
var db = Funs.DB;
return db.Base_SafetyProblemClassify.FirstOrDefault(e => e.ClassifyId == Id);
}
/// <summary>
/// 添加安全问题分类
/// </summary>
/// <param name="Classify"></param>
public static void AddClassify(Model.Base_SafetyProblemClassify Classify)
{
var db = Funs.DB;
Model.Base_SafetyProblemClassify newModel = new Model.Base_SafetyProblemClassify();
newModel.ClassifyId = Classify.ClassifyId;
newModel.ClassifyCode = Classify.ClassifyCode;
newModel.ClassifyName = Classify.ClassifyName;
db.Base_SafetyProblemClassify.InsertOnSubmit(newModel);
db.SubmitChanges();
}
/// <summary>
/// 修改安全问题分类
/// </summary>
/// <param name="Classify"></param>
public static void UpdateClassify(Model.Base_SafetyProblemClassify Classify)
{
var db = Funs.DB;
Model.Base_SafetyProblemClassify newModel = db.Base_SafetyProblemClassify.FirstOrDefault(e => e.ClassifyId == Classify.ClassifyId);
if (newModel != null)
{
newModel.ClassifyCode = Classify.ClassifyCode;
newModel.ClassifyName = Classify.ClassifyName;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除安全问题分类
/// </summary>
/// <param name="Id"></param>
public static void DeleteClassify(string Id)
{
var db = Funs.DB;
Model.Base_SafetyProblemClassify Classify = db.Base_SafetyProblemClassify.FirstOrDefault(e => e.ClassifyId == Id);
if (Classify != null)
{
var getItems = from x in Funs.DB.Base_SafetyProblemClassifyItem
where x.ClassifyId == Classify.ClassifyId
select x;
if (getItems.Count() > 0)
{
db.Base_SafetyProblemClassifyItem.DeleteAllOnSubmit(getItems);
}
db.Base_SafetyProblemClassify.DeleteOnSubmit(Classify);
db.SubmitChanges();
}
}
///// <summary>
///// 是否可删除资源节点
///// </summary>
///// <param name="postName"></param>
///// <returns>true-可以false-不可以</returns>
//public static bool IsDeleteClassify(string Id)
//{
// bool isDelete = true;
// var Training = BLL.SafetyProblemClassifyService.GetClassifyById(Id);
// if (Training != null)
// {
// if (Training.IsEndLever == true)
// {
// var detailCout = Funs.DB.Training_ClassifyItem.FirstOrDefault(x => x.ClassifyId == Id);
// if (detailCout != null)
// {
// isDelete = false;
// }
// }
// else
// {
// var supItemSetCount = BLL.SafetyProblemClassifyService.GetClassifyBySupItem(Id);
// if (supItemSetCount.Count() > 0)
// {
// isDelete = false;
// }
// }
// }
// return isDelete;
//}
/// <summary>
/// 查询所有安全问题分类
/// </summary>
/// <returns>安全问题分类的集合</returns>
public static List<Model.Base_SafetyProblemClassify> GetClassify()
{
return (from x in Funs.DB.Base_SafetyProblemClassify
orderby x.ClassifyCode
select x).ToList();
}
/// <summary>
/// 类型下拉框(末级)
/// </summary>
/// <param name="dropName"></param>
/// <param name="projectId"></param>
/// <param name="isShowPlease"></param>
public static void InitClassifyIsEndDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
{
dropName.DataValueField = "ClassifyId";
dropName.DataTextField = "ClassifyName";
dropName.DataSource = GetClassify();
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
}
}

View File

@ -1797,6 +1797,26 @@ namespace BLL
public const string ProjectProjectMapMenuId = "F266456A-991F-45A3-BCD6-CF2515D71E39";
#endregion
#region
/// <summary>
/// 安全问题分类
/// </summary>
public const string SafetyProblemClassifyMenuId = "1AFAEEB9-B93C-4472-B81E-081436341001";
/// <summary>
/// 安全问题性质
/// </summary>
public const string SafetyProblemNatureMenuId = "1AFAEEB9-B93C-4472-B81E-081436341002";
/// <summary>
/// 质量问题分类
/// </summary>
public const string QualityProblemClassifyMenuId = "1AFAEEB9-B93C-4472-B81E-081436342001";
/// <summary>
/// 质量问题性质
/// </summary>
public const string QualityProblemNatureMenuId = "1AFAEEB9-B93C-4472-B81E-081436342002";
#endregion
#region

View File

@ -28,6 +28,8 @@ namespace BLL
{
ID = model.ID,
ProjectId = model.ProjectId,
UnitId = model.UnitId,
UnitProjectName = model.UnitProjectName,
Year = model.Year,
Month = model.Month,
State = model.State,

View File

@ -28,6 +28,8 @@ namespace BLL
{
ID = model.ID,
ProjectId = model.ProjectId,
UnitId = model.UnitId,
UnitProjectName = model.UnitProjectName,
Year = model.Year,
Month = model.Month,
State = model.State,

View File

@ -0,0 +1,154 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProblemClassify.aspx.cs"
Inherits="FineUIPro.Web.BaseInfo.SafetyProblemClassify" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>安全问题分类</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
EnableCollapse="true" Width="300" Title="安全问题分类" TitleToolTip="安全问题分类" ShowBorder="true"
ShowHeader="false" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft">
<Items>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:Button ID="btnNew" Icon="Add" runat="server" OnClick="btnNew_Click" Hidden="true">
</f:Button>
<f:Button ID="btnEdit" Icon="Pencil" runat="server" OnClick="btnEdit_Click" Hidden="true">
</f:Button>
<f:Button ID="btnDelete" Icon="Delete" ConfirmText="确定删除当前数据?" OnClick="btnDelete_Click"
runat="server" Hidden="true">
</f:Button>
</Items>
</f:Toolbar>
<f:Tree ID="trObj" EnableCollapse="true" ShowHeader="true" Title="安全问题分类" MinHeight="400px"
OnNodeCommand="trObj_NodeCommand" AutoLeafIdentification="true" runat="server"
EnableTextSelection="True">
</f:Tree>
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="安全问题分类明细"
TitleToolTip="安全问题分类明细" AutoScroll="true">
<Items>
<f:Grid ID="Grid1" Width="850px" ShowBorder="true" ShowHeader="false" EnableCollapse="true" ForceFit="true"
runat="server" BoxFlex="1" DataKeyNames="ClassifyItemId" DataIDField="ClassifyItemId"
AllowSorting="true" SortField="ClassifyItemCode" SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True" EnableColumnLines="true">
<Toolbars>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server">
<Items>
<f:TextBox ID="txtClassifyItemCode" runat="server" Label="编号" EmptyText="输入查询编号"
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
LabelAlign="Right">
</f:TextBox>
<f:TextBox ID="txtClassifyItemName" runat="server" Label="名称" EmptyText="输入查询名称"
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
LabelAlign="Right">
</f:TextBox>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnNewDetail" ToolTip="新增" Icon="Add" runat="server" OnClick="btnNewDetail_Click"
Hidden="true">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField Width="150px" ColumnID="ClassifyItemCode" DataField="ClassifyItemCode" FieldType="String"
HeaderText="编号" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="250px" ColumnID="ClassifyItemName" DataField="ClassifyItemName" FieldType="String"
HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<%-- <f:TemplateField Width="120px" HeaderText="编号" HeaderTextAlign="Center" TextAlign="Center"
SortField="CompanyTrainingItemCode" ColumnID="tfCompanyTrainingItemCode">
<ItemTemplate>
<asp:Label ID="lbCompanyTrainingItemCode" runat="server" Text='<%# Bind("CompanyTrainingItemCode") %>'
ToolTip='<%#Bind("CompanyTrainingItemCode") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField Width="200px" HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left"
SortField="CompanyTrainingItemName" ColumnID="tfCompanyTrainingItemName">
<ItemTemplate>
<asp:Label ID="lbCompanyTrainingItemName" runat="server" Text='<%# Bind("CompanyTrainingItemName") %>'
ToolTip='<%#Bind("CompanyTrainingItemName") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField ColumnID="WorkPostNames" DataField="WorkPostNames" SortField="WorkPostNames"
Width="300px" FieldType="String" HeaderText="适合岗位" HeaderTextAlign="Center" TextAlign="left">
</f:RenderField>
<f:TemplateField Width="100px" HeaderText="整理时间" HeaderTextAlign="Center" TextAlign="Center" ColumnID="tfCompileDate"
SortField="CompileDate">
<ItemTemplate>
<asp:Label ID="lbCompileDate" runat="server" Text='<%# Bind("CompileDate","{0:yyyy-MM-dd}") %>'
ToolTip='<%#Bind("CompileDate") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:BoundField runat="server" Hidden="true" ColumnID="hdUrl" DataField="AttachUrl"></f:BoundField>--%>
</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>
</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="700px" Height="600px">
</f:Window>
<f:Window ID="Window2" Title="详情" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" OnClose="Window2_Close" IsModal="true"
Width="700px" Height="600px">
</f:Window>
<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>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
runat="server" Text="编辑" Hidden="true" Icon="Pencil">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
Icon="Delete" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除"
Hidden="true">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/javascript">
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,541 @@
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;
using AspNet = System.Web.UI.WebControls;
namespace FineUIPro.Web.BaseInfo
{
public partial class SafetyProblemClassify : 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();
InitTreeMenu();
}
}
#endregion
#region
/// <summary>
/// 初始化树
/// </summary>
private void InitTreeMenu()
{
trObj.Nodes.Clear();
trObj.ShowBorder = false;
trObj.ShowHeader = false;
trObj.EnableIcons = true;
trObj.AutoScroll = true;
trObj.EnableSingleClickExpand = true;
TreeNode rootNode = new TreeNode
{
Text = "安全问题分类",
NodeID = "0",
Expanded = true
};
this.trObj.Nodes.Add(rootNode);
BoundTree(rootNode.Nodes, "0");
}
private void BoundTree(TreeNodeCollection nodes, string menuId)
{
var dt = GetNewTraining();
if (dt.Count() > 0)
{
TreeNode tn = null;
foreach (var dr in dt)
{
tn = new TreeNode
{
Text = dr.ClassifyName,
NodeID = dr.ClassifyId,
EnableClickEvent = true,
ToolTip = dr.ClassifyName
};
nodes.Add(tn);
}
}
}
/// <summary>
/// 得到菜单方法
/// </summary>
/// <param name="parentId"></param>
/// <returns></returns>
private List<Model.Base_SafetyProblemClassify> GetNewTraining()
{
return (from x in Funs.DB.Base_SafetyProblemClassify orderby x.ClassifyCode select x).ToList(); ;
}
#endregion
#region
/// <summary>
/// 增加安全问题分类类别
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
if (this.trObj.SelectedNode != null)
{
if (this.trObj.SelectedNode.NodeID == "0") //根节点或者非末级节点,可以增加
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyProblemClassifySave.aspx", this.trObj.SelectedNode.NodeID, "编辑 - ")));
}
else
{
ShowNotify("选择的项已是末级!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
}
}
/// <summary>
/// 修改安全问题分类类别
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnEdit_Click(object sender, EventArgs e)
{
if (this.trObj.SelectedNode != null)
{
if (this.trObj.SelectedNode.NodeID != "0") //非根节点可以编辑
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyProblemClassifySave.aspx?ClassifyId={0}", this.trObj.SelectedNode.NodeID, "编辑 - ")));
}
else
{
ShowNotify("根节点无法编辑!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
}
}
/// <summary>
/// 删除安全问题分类类别
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
if (this.trObj.SelectedNode != null)
{
var q = BLL.SafetyProblemClassifyService.GetClassifyById(this.trObj.SelectedNode.NodeID);
if (q != null)
{
BLL.SafetyProblemClassifyService.DeleteClassify(this.trObj.SelectedNode.NodeID);
InitTreeMenu();
}
else
{
ShowNotify("存在下级菜单或已增加资源数据或者为内置项,不允许删除!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify("请选择删除项!", MessageBoxIcon.Warning);
}
}
#endregion
#region
/// <summary>
/// 树点击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void trObj_NodeCommand(object sender, FineUIPro.TreeCommandEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 适用岗位下拉触发事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drp_SelectedIndexChanged(object sender, EventArgs e)
{
this.BindGrid();
}
#endregion
#region
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
if (this.trObj.SelectedNode != null && !string.IsNullOrEmpty(this.trObj.SelectedNode.NodeID))
{
StringBuilder sb = new StringBuilder();
sb.Append("SELECT item.ClassifyItemId,item.ClassifyId,item.ClassifyItemCode,item.ClassifyItemName,item.CompileMan, item.CompileDate ");
sb.Append("FROM dbo.Base_SafetyProblemClassifyItem AS item ");
sb.Append("WHERE item.ClassifyId=@ClassifyId ");
List<SqlParameter> listStr = new List<SqlParameter>
{
new SqlParameter("@ClassifyId", this.trObj.SelectedNode.NodeID)
};
if (!string.IsNullOrEmpty(this.txtClassifyItemCode.Text.Trim()))
{
sb.Append("AND ClassifyItemCode LIKE @ClassifyItemCode ");
listStr.Add(new SqlParameter("@ClassifyItemCode", "%" + this.txtClassifyItemCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtClassifyItemName.Text.Trim()))
{
sb.Append("AND ClassifyItemName LIKE @ClassifyItemName ");
listStr.Add(new SqlParameter("@ClassifyItemName", "%" + this.txtClassifyItemName.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(sb.ToString(), parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
}
#endregion
#region
protected void Window1_Close(object sender, EventArgs e)
{
InitTreeMenu();
}
protected void Window2_Close(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
BindGrid();
}
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
this.BindGrid();
}
#endregion
#region
#region
/// <summary>
/// 新增明细
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewDetail_Click(object sender, EventArgs e)
{
if (this.trObj.SelectedNode != null)
{
if (this.trObj.SelectedNode.Nodes.Count == 0)
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("SafetyProblemClassifyItemSave.aspx?ClassifyId={0}", this.trObj.SelectedNode.NodeID, "编辑 - ")));
}
else
{
ShowNotify("请选择末级节点!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
}
}
#endregion
#region
protected void btnEditDetail_Click(object sender, EventArgs e)
{
this.EditData();
}
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
this.EditData();
}
/// <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 itemId = Grid1.SelectedRowID;
//itemId = itemId.Substring(0, itemId.IndexOf("_"));
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("SafetyProblemClassifyItemSave.aspx?ClassifyItemId={0}", itemId, "编辑 - ")));
}
#endregion
#region
// 删除数据
protected void btnDeleteDetail_Click(object sender, EventArgs e)
{
this.DeleteData();
}
/// <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();
//rowID = rowID.Substring(0, rowID.IndexOf("_"));
var getD = BLL.SafetyProblemClassifyItemService.GetClassifyItemById(rowID);
if (getD != null)
{
BLL.LogService.AddSys_Log(this.CurrUser, getD.ClassifyItemCode, getD.ClassifyItemId, BLL.Const.SafetyProblemClassifyMenuId, BLL.Const.BtnDelete);
BLL.SafetyProblemClassifyItemService.DeleteClassifyItemById(rowID);
}
}
BindGrid();
ShowNotify("删除数据成功!");
}
}
#endregion
#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.SafetyProblemClassifyMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
this.btnNewDetail.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnEdit.Hidden = false;
this.btnMenuEdit.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnDelete.Hidden = false;
this.btnMenuDelete.Hidden = false;
}
}
}
#endregion
/// <summary>
/// 导出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("安全问题分类" + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Grid1.PageSize = Grid1.RecordCount;
BindGrid();
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}
#region
///// <summary>
///// 导出方法
///// </summary>
///// <param name="grid"></param>
///// <returns></returns>
//public static string GetGridTableHtml(Grid grid, int count)
//{
// StringBuilder sb = new StringBuilder();
// sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
// sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
// sb.Append("<tr>");
// foreach (GridColumn column in grid.Columns)
// {
// if (column.ColumnIndex < count)
// {
// sb.AppendFormat("<td>{0}</td>", column.HeaderText);
// }
// }
// sb.Append("</tr>");
// foreach (GridRow row in grid.Rows)
// {
// sb.Append("<tr>");
// foreach (GridColumn column in grid.Columns)
// {
// if (column.ColumnIndex < count)
// {
// string html = row.Values[column.ColumnIndex].ToString();
// if (column.ColumnID == "tfNumber" && (row.FindControl("lbNumber") as AspNet.Label) != null)
// {
// html = (row.FindControl("lbNumber") as AspNet.Label).Text;
// }
// if (column.ColumnID == "tfCompanyTrainingItemCode" && (row.FindControl("lbCompanyTrainingItemCode") as AspNet.Label) != null)
// {
// html = (row.FindControl("lbCompanyTrainingItemCode") as AspNet.Label).Text;
// }
// if (column.ColumnID == "tfCompanyTrainingItemName" && (row.FindControl("lbCompanyTrainingItemName") as AspNet.Label) != null)
// {
// html = (row.FindControl("lbCompanyTrainingItemName") as AspNet.Label).Text;
// }
// if (column.ColumnID == "tfCompileMan" && (row.FindControl("lbCompileMan") as AspNet.Label) != null)
// {
// html = (row.FindControl("lbCompileMan") as AspNet.Label).Text;
// }
// if (column.ColumnID == "tfCompileDate" && (row.FindControl("lbCompileDate") as AspNet.Label) != null)
// {
// html = (row.FindControl("lbCompileDate") as AspNet.Label).Text;
// }
// sb.AppendFormat("<td>{0}</td>", html);
// }
// }
// sb.Append("</tr>");
// }
// sb.Append("</table>");
// return sb.ToString();
//}
#endregion
///// <summary>
///// 行事件
///// </summary>
///// <param name="sender"></param>
///// <param name="e"></param>
//protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
//{
// if (e.CommandName == "Attach")
// {
// string attUrl = this.Grid1.Rows[e.RowIndex].Values[this.Grid1.Columns.Count - 1].ToString();
// try
// {
// string url = Funs.RootPath + attUrl;
// FileInfo info = new FileInfo(url);
// string savedName = Path.GetFileName(url);
// if (!info.Exists || string.IsNullOrEmpty(savedName))
// {
// url = Funs.RootPath + "Images//Null.jpg";
// info = new FileInfo(url);
// }
// if (Path.GetExtension(savedName) == ".mp4" || Path.GetExtension(savedName).ToLower() == ".mp4" || Path.GetExtension(savedName) == ".m4v")
// {
// string mpUrl = HttpUtility.UrlEncode(attUrl.Replace('\\', '/'));
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/player.aspx?url={0}", attUrl.Replace('\\', '/'), "播放 - "), "播放视频", 700, 560));
// }
// else
// {
// string fileName = Path.GetFileName(url);
// long fileSize = info.Length;
// System.Web.HttpContext.Current.Response.Clear();
// //System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
// System.Web.HttpContext.Current.Response.ContentType = "application/octet-stream";
// System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
// System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
// System.Web.HttpContext.Current.Response.TransmitFile(url, 0, fileSize);
// System.Web.HttpContext.Current.Response.Flush();
// System.Web.HttpContext.Current.Response.End();
// }
// }
// catch (Exception)
// {
// }
// }
//}
}
}

View File

@ -0,0 +1,251 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.BaseInfo
{
public partial class SafetyProblemClassify
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelLeftRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelLeftRegion;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnEdit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnEdit;
/// <summary>
/// btnDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDelete;
/// <summary>
/// trObj 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Tree trObj;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// txtClassifyItemCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtClassifyItemCode;
/// <summary>
/// txtClassifyItemName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtClassifyItemName;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnNewDetail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNewDetail;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
/// <summary>
/// Menu1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDelete;
}
}

View File

@ -0,0 +1,107 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProblemClassifyItemSave.aspx.cs"
Inherits="FineUIPro.Web.BaseInfo.SafetyProblemClassifyItemSave" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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="txtClassifyItemCode" runat="server" Label="编号" Required="true"
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50" LabelWidth="120px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtClassifyItemName" runat="server" Label="名称" Required="true" LabelWidth="120px"
ShowRedStar="true" MaxLength="50" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtCompileMan" runat="server" Label="整理人" Readonly="true" MaxLength="50" LabelWidth="120px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DatePicker runat="server" Label="整理时间" ID="txtCompileDate" LabelWidth="120px">
</f:DatePicker>
</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:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
OnClick="btnSave_Click" Hidden="true">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f: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>
</form>
</body>
<script>
<%-- var ddTestTraining = '<%= ddTestTraining.ClientID %>';
var treeTestTraining = '<%= treeTestTraining.ClientID %>';--%>
function onPopPanelShow(event) {
var nodes = this.getValue();
F.noEvent(function () {
// 第二个参数true是否递归调用子节点
//F(treeTestTraining).checkNodes(nodes, true);
// 启用树控件的级联选择时,确保把树控件的选中值全部同步到下拉框
syncToDropDownBox();
});
}
// 将树控件的选中值同步到下拉框
function syncToDropDownBox() {
var values = [], texts = [];
var checkedNodes = F(treeTestTraining).getCheckedNodes(true);
$.each(checkedNodes, function (index, node) {
debugger;
values.push(node.id);
texts.push(node.text);
});
F(ddTestTraining).setValue(values, texts);
}
F.ready(function () {
F(treeTestTraining).on('nodecheck', function (event, nodeId, checked) {
// 加个延迟,等待复选框的级联选择完成
window.setTimeout(function () {
syncToDropDownBox();
});
});
});
</script>
</html>

View File

@ -0,0 +1,235 @@
using System;
using System.Linq;
using Model;
using BLL;
using System.Collections.Generic;
using Microsoft.Office.Interop.Excel;
namespace FineUIPro.Web.BaseInfo
{
public partial class SafetyProblemClassifyItemSave : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
public string ClassifyItemId
{
get
{
return (string)ViewState["ClassifyItemId"];
}
set
{
ViewState["ClassifyItemId"] = value;
}
}
/// <summary>
/// 主表主键
/// </summary>
public string ClassifyId
{
get
{
return (string)ViewState["ClassifyId"];
}
set
{
ViewState["ClassifyId"] = value;
}
}
#endregion
#region
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.GetButtonPower();
btnClose.OnClientClick = ActiveWindow.GetHideReference();
//BoundTree(treeTestTraining.Nodes, "0");
//BindEnumrableToDropDownList();
this.ClassifyItemId = Request.QueryString["ClassifyItemId"];
this.ClassifyId = Request.QueryString["ClassifyId"];
if (!string.IsNullOrEmpty(this.ClassifyItemId))
{
var model = SafetyProblemClassifyItemService.GetClassifyItemById(this.ClassifyItemId);
if (model != null)
{
this.ClassifyId = model.ClassifyId;
this.txtClassifyItemCode.Text = model.ClassifyItemCode;
this.txtClassifyItemName.Text = model.ClassifyItemName;
this.txtCompileMan.Text = model.CompileManName;
if (model.CompileDate != null)
{
txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", model.CompileDate);
}
}
}
else
{
var model = BLL.CompanyTrainingService.GetCompanyTrainingById(this.ClassifyId);
if (model != null)
{
this.txtCompileMan.Text = this.CurrUser.UserName;
this.txtClassifyItemName.Text = model.CompanyTrainingName;
//this.txtClassifyItemCode.Text = SQLHelper.RunProcNewId("SpGetNewCode3", "Base_SafetyProblemClassifyItem", "ClassifyItemCode", model.ClassifyItemCode + "-");
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
}
}
}
}
#endregion
private List<Model.Training_TestTraining> GetNewTraining(string parentId)
{
return (from x in Funs.DB.Training_TestTraining
where x.SupTrainingId == parentId
orderby x.TrainingCode
select x).ToList();
}
//private void BoundTree(TreeNodeCollection nodes, string parentId)
//{
// var dt = GetNewTraining(parentId);
// if (dt.Count() > 0)
// {
// TreeNode tn = null;
// foreach (var dr in dt)
// {
// string name = dr.TrainingName;
// if (!string.IsNullOrEmpty(dr.TrainingCode))
// {
// name = "[" + dr.TrainingCode + "]" + dr.TrainingName;
// }
// tn = new TreeNode
// {
// Text = name,
// NodeID = dr.TrainingId,
// EnableClickEvent = true,
// ToolTip = dr.TrainingName
// };
// nodes.Add(tn);
// ///是否存在下级节点
// var sup = Funs.DB.Training_TestTraining.FirstOrDefault(x => x.SupTrainingId == tn.NodeID);
// if (sup != null)
// {
// BoundTree(tn.Nodes, tn.NodeID);
// }
// }
// }
//}
#region
/// <summary>
/// 保存数据
/// </summary>
private void SaveData(bool isClose)
{
Model.Base_SafetyProblemClassifyItem newModel = new Base_SafetyProblemClassifyItem
{
ClassifyItemCode = this.txtClassifyItemCode.Text.Trim(),
ClassifyItemName = this.txtClassifyItemName.Text.Trim(),
CompileMan = this.CurrUser.UserId,
CompileManName = this.CurrUser.UserName,
};
if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim()))
{
newModel.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim());
}
if (!string.IsNullOrEmpty(this.ClassifyItemId))
{
newModel.ClassifyItemId = this.ClassifyItemId;
BLL.SafetyProblemClassifyItemService.UpdateClassifyItem(newModel);
BLL.LogService.AddSys_Log(this.CurrUser, newModel.ClassifyItemCode, newModel.ClassifyItemId, BLL.Const.SafetyProblemClassifyMenuId, BLL.Const.BtnModify);
}
else
{
newModel.ClassifyId = this.ClassifyId;
this.ClassifyItemId = SQLHelper.GetNewID(typeof(Model.Base_SafetyProblemClassifyItem));
newModel.ClassifyItemId = this.ClassifyItemId;
BLL.SafetyProblemClassifyItemService.AddClassifyItem(newModel);
BLL.LogService.AddSys_Log(this.CurrUser, newModel.ClassifyItemCode, newModel.ClassifyItemId, BLL.Const.SafetyProblemClassifyMenuId, BLL.Const.BtnAdd);
}
if (isClose)
{
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
}
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
SaveData(true);
}
#endregion
#region
/// <summary>
/// 验证安全问题分类是否存在
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
var q = Funs.DB.Base_SafetyProblemClassifyItem.FirstOrDefault(x => x.ClassifyId == this.ClassifyId && x.ClassifyItemName == this.txtClassifyItemName.Text.Trim() && (x.ClassifyItemId != this.ClassifyItemId || (this.ClassifyItemId == null && x.ClassifyItemId != null)));
if (q != null)
{
ShowNotify("输入的安全问题分类已存在!", MessageBoxIcon.Warning);
}
}
#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/CompanyTraining&menuId={1}&type=-1", ClassifyItemId, BLL.Const.SafetyProblemClassifyMenuId)));
// }
// else
// {
// if (string.IsNullOrEmpty(this.ClassifyItemId))
// {
// SaveData(false);
// }
// PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CompanyTraining&menuId={1}", ClassifyItemId, BLL.Const.SafetyProblemClassifyMenuId)));
// }
//}
//#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.SafetyProblemClassifyMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnSave.Hidden = false;
}
}
}
#endregion
}
}

View File

@ -0,0 +1,134 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.BaseInfo
{
public partial class SafetyProblemClassifyItemSave
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtClassifyItemCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtClassifyItemCode;
/// <summary>
/// txtClassifyItemName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtClassifyItemName;
/// <summary>
/// txtCompileMan 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtCompileMan;
/// <summary>
/// txtCompileDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtCompileDate;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// lbTemp 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbTemp;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}

View File

@ -0,0 +1,45 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProblemClassifySave.aspx.cs"
Inherits="FineUIPro.Web.BaseInfo.SafetyProblemClassifySave" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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="txtClassifyCode" runat="server" Label="编号" Required="true"
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtClassifyName" runat="server" Label="名称" Required="true"
ShowRedStar="true" MaxLength="50" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
</f:TextBox>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
OnClick="btnSave_Click" Hidden="true">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
</form>
</body>
</html>

View File

@ -0,0 +1,132 @@
using System;
using System.Linq;
using BLL;
namespace FineUIPro.Web.BaseInfo
{
public partial class SafetyProblemClassifySave : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
public string ClassifyId
{
get
{
return (string)ViewState["ClassifyId"];
}
set
{
ViewState["ClassifyId"] = 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();
this.ClassifyId = Request.QueryString["ClassifyId"];
if (!string.IsNullOrEmpty(ClassifyId))
{
var q = BLL.SafetyProblemClassifyService.GetClassifyById(ClassifyId);
if (q != null)
{
this.txtClassifyCode.Text = q.ClassifyCode;
this.txtClassifyName.Text = q.ClassifyName;
}
}
}
}
#endregion
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
var obj = Funs.DB.Base_SafetyProblemClassify.FirstOrDefault(x => x.ClassifyCode == this.txtClassifyCode.Text.Trim() && x.ClassifyId != this.ClassifyId);
if (obj != null)
{
ShowNotify("输入的编号已存在!", MessageBoxIcon.Warning);
return;
}
obj = Funs.DB.Base_SafetyProblemClassify.FirstOrDefault(x => x.ClassifyName == this.txtClassifyName.Text.Trim() && x.ClassifyId != this.ClassifyId);
if (obj != null)
{
ShowNotify("输入的名称已存在!", MessageBoxIcon.Warning);
return;
}
Model.Base_SafetyProblemClassify model = new Model.Base_SafetyProblemClassify();
model.ClassifyCode = this.txtClassifyCode.Text.Trim();
model.ClassifyName = this.txtClassifyName.Text.Trim();
if (!string.IsNullOrEmpty(this.ClassifyId))
{
model.ClassifyId = this.ClassifyId;
BLL.SafetyProblemClassifyService.UpdateClassify(model);
}
else
{
this.ClassifyId = SQLHelper.GetNewID(typeof(Model.Base_SafetyProblemClassify));
model.ClassifyId = this.ClassifyId;
BLL.SafetyProblemClassifyService.AddClassify(model);
}
// 2. 关闭本窗体,然后刷新父窗体
// PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
// 2. 关闭本窗体,然后回发父窗体
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
//PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(trainingId) + ActiveWindow.GetHideReference());
}
#endregion
#region
/// <summary>
/// 验证安全问题分类名称是否存在
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
var model = Funs.DB.Base_SafetyProblemClassify.FirstOrDefault(x => x.ClassifyName == this.txtClassifyName.Text.Trim() && (x.ClassifyId != this.ClassifyId || this.ClassifyId == null));
if (model != null)
{
ShowNotify("输入的名称已存在!", MessageBoxIcon.Warning);
}
}
#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.SafetyProblemClassifyMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnSave.Hidden = false;
}
}
}
#endregion
}
}

View File

@ -0,0 +1,89 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.BaseInfo
{
public partial class SafetyProblemClassifySave
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtClassifyCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtClassifyCode;
/// <summary>
/// txtClassifyName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtClassifyName;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
}
}

View File

@ -244,6 +244,9 @@
<Content Include="BaseInfo\CNProfessional.aspx" />
<Content Include="BaseInfo\CNProfessionalEdit.aspx" />
<Content Include="BaseInfo\CNProfessionalView.aspx" />
<Content Include="BaseInfo\SafetyProblemClassifyItemSave.aspx" />
<Content Include="BaseInfo\SafetyProblemClassifySave.aspx" />
<Content Include="BaseInfo\SafetyProblemClassify.aspx" />
<Content Include="BaseInfo\CostType.aspx" />
<Content Include="BaseInfo\DesignProfessional.aspx" />
<Content Include="BaseInfo\DesignProfessionalEdit.aspx" />
@ -7760,6 +7763,27 @@
<Compile Include="BaseInfo\CNProfessionalView.aspx.designer.cs">
<DependentUpon>CNProfessionalView.aspx</DependentUpon>
</Compile>
<Compile Include="BaseInfo\SafetyProblemClassifyItemSave.aspx.cs">
<DependentUpon>SafetyProblemClassifyItemSave.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="BaseInfo\SafetyProblemClassifyItemSave.aspx.designer.cs">
<DependentUpon>SafetyProblemClassifyItemSave.aspx</DependentUpon>
</Compile>
<Compile Include="BaseInfo\SafetyProblemClassifySave.aspx.cs">
<DependentUpon>SafetyProblemClassifySave.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="BaseInfo\SafetyProblemClassifySave.aspx.designer.cs">
<DependentUpon>SafetyProblemClassifySave.aspx</DependentUpon>
</Compile>
<Compile Include="BaseInfo\SafetyProblemClassify.aspx.cs">
<DependentUpon>SafetyProblemClassify.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="BaseInfo\SafetyProblemClassify.aspx.designer.cs">
<DependentUpon>SafetyProblemClassify.aspx</DependentUpon>
</Compile>
<Compile Include="BaseInfo\CostType.aspx.cs">
<DependentUpon>CostType.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

View File

@ -273,7 +273,8 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorOccHealthIn.aspx?ProjectId={0}", this.ProjectId, "导入 - ")));
//PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorOccHealthIn.aspx?ProjectId={0}", this.ProjectId, "导入 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorOccHealthIn.aspx?ProjectId={0}&UnitId={1}", this.CurrUser.LoginProjectId, this.CurrUser.UnitId, "导入 - ")));
}
#region

View File

@ -1,4 +1,5 @@
using BLL;
using FineUIPro.Web.DataShow;
using Model;
using System;
using System.Linq;
@ -144,7 +145,18 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
var yearMonth2 = this.drpYearMonth.SelectedDate;
model.Year = yearMonth.Split('-')[0];
model.Month = yearMonth.Split('-')[1];
model.ProjectId = this.ProjectId;
if (!string.IsNullOrWhiteSpace(this.ProjectId))
{
var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
model.ProjectId = this.ProjectId;
model.UnitProjectName = project.ProjectName;
}
else
{
var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
model.UnitId = unit.UnitId;
model.UnitProjectName = unit.UnitName;
}
model.WorkPlace = this.txtWorkPlace.Text.Trim();
model.JobStep = this.txtJobStep.Text.Trim();
model.Hazard = this.txtHazard.Text.Trim();

View File

@ -39,6 +39,20 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
}
}
/// <summary>
/// 单位id
/// </summary>
public string UnitId
{
get
{
return (string)ViewState["UnitId"];
}
set
{
ViewState["UnitId"] = value;
}
}
/// <summary>
/// 操作人
/// </summary>
public string CompileMan
@ -75,6 +89,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
if (!IsPostBack)
{
this.ProjectId = Request.Params["ProjectId"];
this.UnitId = Request.Params["UnitId"];
this.CompileMan = this.CurrUser.UserId;
@ -303,7 +318,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
else
{
Year = ct.Year.ToString();
Month = ct.Month.ToString();
Month = ct.Month > 9 ? ct.Month.ToString() : $"0{ct.Month}";
}
}
else
@ -425,6 +440,18 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
return (lstError, null);
}
string UnitProjectName = string.Empty;
if (!string.IsNullOrWhiteSpace(this.ProjectId))
{
var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
UnitProjectName = project.ProjectName;
}
else if (!string.IsNullOrWhiteSpace(this.UnitId))
{
var unit = BLL.UnitService.GetUnitByUnitId(this.UnitId);
UnitProjectName = unit.UnitName;
}
// 其余字段可根据实际业务映射到实体
var entity = new Model.HazardFactor_OccHealth
{
@ -433,7 +460,9 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
CompileMan = this.CompileMan,
CompileManName = this.CompileManName,
State = int.Parse(BLL.Const.State_1),//默认已提交
ProjectId =this.ProjectId,
ProjectId = this.ProjectId,
UnitId = this.UnitId,
UnitProjectName = UnitProjectName,
Year = Year,
Month = Month,
WorkPlace = WorkPlace,

View File

@ -64,7 +64,10 @@
</f:RadioButtonList>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<%--<f:Button ID="btnNew" ToolTip="新增" Text="新增" Icon="Add" EnablePostBack="false" runat="server" Hidden="true">
</f:Button>--%>
<f:Button ID="btnImport" ToolTip="导入" Text="导入" Icon="ApplicationGet" runat="server" OnClick="btnImport_Click" Hidden="true">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
@ -90,7 +93,9 @@
<asp:Label ID="lbState" runat="server" Text='<%# ConvertDataState(Eval("State")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="180px" ColumnID="ProjectName" DataField="ProjectName" FieldType="String" HeaderText="项目名称" TextAlign="Center" HeaderTextAlign="Center" Locked="true">
<%--<f:RenderField Width="180px" ColumnID="ProjectName" DataField="ProjectName" FieldType="String" HeaderText="项目名称" TextAlign="Center" HeaderTextAlign="Center" Locked="true">
</f:RenderField>--%>
<f:RenderField Width="180px" ColumnID="UnitProjectName" DataField="UnitProjectName" FieldType="String" HeaderText="单位项目名称" TextAlign="Center" HeaderTextAlign="Center" Locked="true">
</f:RenderField>
<f:RenderField Width="180px" ColumnID="WorkPlace" DataField="WorkPlace" SortField="WorkPlace" FieldType="String" HeaderText="活动区域/场所/设备" TextAlign="Left" HeaderTextAlign="Center" Locked="true">
</f:RenderField>

View File

@ -44,6 +44,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
////权限按钮方法
this.GetButtonPower();
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
//btnNew.OnClientClick = Window1.GetShowReference("HazardFactorSafetyEdit.aspx") + "return false;";
// 绑定表格
BindGrid();
}
@ -64,20 +65,26 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
sb.Append("WITH CTE AS ( ");
if (dedupe == "0")
{//按月
sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.Month,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tbb.ProjectName,tba.* ");
sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.Month,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tba.* ");
}
else
{//按年
sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tbb.ProjectName,tba.* ");
sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tba.* ");
}
}
else
{
sb.Append("SELECT tbb.ProjectName,tba.* ");
sb.Append("SELECT tba.* ");
}
sb.Append("FROM HazardFactor_OccHealth AS tba WITH(NOLOCK) ");
sb.Append("LEFT JOIN Base_Project AS tbb WITH(NOLOCK) ON tbb.ProjectId = tba.ProjectId ");
//sb.Append("LEFT JOIN Base_Project AS tbb WITH(NOLOCK) ON tbb.ProjectId = tba.ProjectId ");
sb.Append("WHERE 1=1 AND tba.State = 1 ");//取已提交数据
if (!string.IsNullOrWhiteSpace(this.CurrUser.UnitId) && this.CurrUser.UnitId != Const.UnitId_XJYJ)
{//分公司只能查看本单位的数据
sb.Append("AND tba.UnitId = @UnitId ");
listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId));
}
if (!string.IsNullOrWhiteSpace(this.drpProject.SelectedValue) && this.drpProject.SelectedValue != Const._Null)
{
sb.Append("AND tba.ProjectId = @ProjectId ");
@ -260,6 +267,8 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
return;
}
this.btnMenuView.Hidden = false;
//this.btnNew.Hidden = false;
this.btnImport.Hidden = false;
if (this.CurrUser.UserId == Const.hfnbdId || this.CurrUser.UserId == Const.sysglyId)
{
this.btnMenuDel.Hidden = false;
@ -272,6 +281,17 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
}
#endregion
/// <summary>
/// 导入按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorSafetyIn.aspx?ProjectId={0}&UnitId={1}", this.CurrUser.LoginProjectId, this.CurrUser.UnitId, "导入 - ")));
}
#region
/// 导出按钮
/// </summary>

View File

@ -131,6 +131,15 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnImport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary>
/// btnOut 控件。
/// </summary>

View File

@ -19,6 +19,12 @@
</f:DatePicker>
<f:DatePicker ID="txtCompileDate" runat="server" DateFormatString="yyyy-MM-dd HH:mm" Label="上报时间" Readonly="true">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtUnitProjectName" runat="server" Label="单位项目" MaxLength="100" Readonly="true">
</f:TextBox>
<f:TextBox ID="txtCompileManName" runat="server" Label="上报人" MaxLength="50" Readonly="true">
</f:TextBox>
</Items>

View File

@ -1,4 +1,5 @@
using BLL;
using NPOI.SS.Formula.Atp;
using System;
namespace FineUIPro.Web.ReportManage.HazardFactor
@ -55,8 +56,9 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
{
this.drpYearMonth.SelectedDate = Convert.ToDateTime($"{model.Year}-{model.Month}");
this.txtCompileDate.Text = model.CompileDate.ToShortDateString();
this.txtCompileDate.Text = model.CompileDate.ToShortDateString();
this.txtCompileManName.Text = model.CompileManName;
this.txtUnitProjectName.Text = model.UnitProjectName;
this.txtWorkPlace.Text = model.WorkPlace;
this.txtJobStep.Text = model.JobStep;

View File

@ -59,6 +59,15 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
/// </remarks>
protected global::FineUIPro.DatePicker txtCompileDate;
/// <summary>
/// txtUnitProjectName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUnitProjectName;
/// <summary>
/// txtCompileManName 控件。
/// </summary>

View File

@ -273,7 +273,8 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorSafetyIn.aspx?ProjectId={0}", this.ProjectId, "导入 - ")));
//PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorSafetyIn.aspx?ProjectId={0}", this.ProjectId, "导入 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorSafetyIn.aspx?ProjectId={0}&UnitId={1}", this.CurrUser.LoginProjectId, this.CurrUser.UnitId, "导入 - ")));
}
#region

View File

@ -144,7 +144,18 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
var yearMonth2 = this.drpYearMonth.SelectedDate;
model.Year = yearMonth.Split('-')[0];
model.Month = yearMonth.Split('-')[1];
model.ProjectId = this.ProjectId;
if (!string.IsNullOrWhiteSpace(this.ProjectId))
{
var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
model.ProjectId = this.ProjectId;
model.UnitProjectName = project.ProjectName;
}
else
{
var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
model.UnitId = unit.UnitId;
model.UnitProjectName = unit.UnitName;
}
model.WorkPlace = this.txtWorkPlace.Text.Trim();
model.JobStep = this.txtJobStep.Text.Trim();
model.Hazard = this.txtHazard.Text.Trim();

View File

@ -39,6 +39,20 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
}
}
/// <summary>
/// 单位id
/// </summary>
public string UnitId
{
get
{
return (string)ViewState["UnitId"];
}
set
{
ViewState["UnitId"] = value;
}
}
/// <summary>
/// 操作人
/// </summary>
public string CompileMan
@ -75,6 +89,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
if (!IsPostBack)
{
this.ProjectId = Request.Params["ProjectId"];
this.UnitId = Request.Params["UnitId"];
this.CompileMan = this.CurrUser.UserId;
@ -303,7 +318,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
else
{
Year = ct.Year.ToString();
Month = ct.Month.ToString();
Month = ct.Month > 9 ? ct.Month.ToString() : $"0{ct.Month}";
}
}
else
@ -425,15 +440,29 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
return (lstError, null);
}
string UnitProjectName = string.Empty;
if (!string.IsNullOrWhiteSpace(this.ProjectId))
{
var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
UnitProjectName = project.ProjectName;
}
else if (!string.IsNullOrWhiteSpace(this.UnitId))
{
var unit = BLL.UnitService.GetUnitByUnitId(this.UnitId);
UnitProjectName = unit.UnitName;
}
// 其余字段可根据实际业务映射到实体
var entity = new Model.HazardFactor_Safety
{
ID = SQLHelper.GetNewID(typeof(Model.HazardFactor_Safety)),
CompileDate=DateTime.Now,
CompileDate = DateTime.Now,
CompileMan = this.CompileMan,
CompileManName = this.CompileManName,
State = int.Parse(BLL.Const.State_1),//默认已提交
ProjectId =this.ProjectId,
ProjectId = this.ProjectId,
UnitId = this.UnitId,
UnitProjectName = UnitProjectName,
Year = Year,
Month = Month,
WorkPlace = WorkPlace,

View File

@ -64,7 +64,10 @@
</f:RadioButtonList>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<%--<f:Button ID="btnNew" ToolTip="新增" Text="新增" Icon="Add" EnablePostBack="false" runat="server" Hidden="true">
</f:Button>--%>
<f:Button ID="btnImport" ToolTip="导入" Text="导入" Icon="ApplicationGet" runat="server" OnClick="btnImport_Click" Hidden="true">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
@ -90,7 +93,9 @@
<asp:Label ID="lbState" runat="server" Text='<%# ConvertDataState(Eval("State")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="180px" ColumnID="ProjectName" DataField="ProjectName" FieldType="String" HeaderText="项目名称" TextAlign="Center" HeaderTextAlign="Center" Locked="true">
<%--<f:RenderField Width="180px" ColumnID="ProjectName" DataField="ProjectName" FieldType="String" HeaderText="项目名称" TextAlign="Center" HeaderTextAlign="Center" Locked="true">
</f:RenderField>--%>
<f:RenderField Width="180px" ColumnID="UnitProjectName" DataField="UnitProjectName" FieldType="String" HeaderText="单位项目名称" TextAlign="Center" HeaderTextAlign="Center" Locked="true">
</f:RenderField>
<f:RenderField Width="180px" ColumnID="WorkPlace" DataField="WorkPlace" SortField="WorkPlace" FieldType="String" HeaderText="活动区域/场所/设备" TextAlign="Left" HeaderTextAlign="Center" Locked="true">
</f:RenderField>

View File

@ -44,6 +44,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
////权限按钮方法
this.GetButtonPower();
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
//btnNew.OnClientClick = Window1.GetShowReference("HazardFactorSafetyEdit.aspx") + "return false;";
// 绑定表格
BindGrid();
}
@ -64,20 +65,26 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
sb.Append("WITH CTE AS ( ");
if (dedupe == "0")
{//按月
sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.Month,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tbb.ProjectName,tba.* ");
sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.Month,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tba.* ");
}
else
{//按年
sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tbb.ProjectName,tba.* ");
sb.Append("SELECT ROW_NUMBER() OVER (PARTITION BY tba.Year,tba.WorkPlace,tba.JobStep,tba.Hazard,tba.Consequence,tba.Illegality,tba.BaseRiskSeverity,tba.BaseRiskProbability,tba.BaseRiskScore,tba.BaseRiskLevel,tba.BaseRiskAcceptabity,tba.NetRiskControlMeasures,tba.NetRiskSeverity,tba.NetRiskProbability,tba.NetRiskScore,tba.NetRiskLevel,tba.NetRiskAcceptabity,tba.AdditionalControlMeasures ORDER BY CompileDate desc) as rn,tba.* ");
}
}
else
{
sb.Append("SELECT tbb.ProjectName,tba.* ");
sb.Append("SELECT tba.* ");
}
sb.Append("FROM HazardFactor_Safety AS tba WITH(NOLOCK) ");
sb.Append("LEFT JOIN Base_Project AS tbb WITH(NOLOCK) ON tbb.ProjectId = tba.ProjectId ");
//sb.Append("LEFT JOIN Base_Project AS tbb WITH(NOLOCK) ON tbb.ProjectId = tba.ProjectId ");
sb.Append("WHERE 1=1 AND tba.State = 1 ");//取已提交数据
if (!string.IsNullOrWhiteSpace(this.CurrUser.UnitId) && this.CurrUser.UnitId != Const.UnitId_XJYJ)
{//分公司只能查看本单位的数据
sb.Append("AND tba.UnitId = @UnitId ");
listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId));
}
if (!string.IsNullOrWhiteSpace(this.drpProject.SelectedValue) && this.drpProject.SelectedValue != Const._Null)
{
sb.Append("AND tba.ProjectId = @ProjectId ");
@ -260,6 +267,8 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
return;
}
this.btnMenuView.Hidden = false;
//this.btnNew.Hidden = false;
this.btnImport.Hidden = false;
if (this.CurrUser.UserId == Const.hfnbdId || this.CurrUser.UserId == Const.sysglyId)
{
this.btnMenuDel.Hidden = false;
@ -272,6 +281,17 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
}
#endregion
/// <summary>
/// 导入按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HazardFactorSafetyIn.aspx?ProjectId={0}&UnitId={1}", this.CurrUser.LoginProjectId, this.CurrUser.UnitId, "导入 - ")));
}
#region
/// 导出按钮
/// </summary>

View File

@ -131,6 +131,15 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnImport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary>
/// btnOut 控件。
/// </summary>

View File

@ -19,6 +19,12 @@
</f:DatePicker>
<f:DatePicker ID="txtCompileDate" runat="server" DateFormatString="yyyy-MM-dd HH:mm" Label="上报时间" Readonly="true">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtUnitProjectName" runat="server" Label="单位项目" MaxLength="100" Readonly="true">
</f:TextBox>
<f:TextBox ID="txtCompileManName" runat="server" Label="上报人" MaxLength="50" Readonly="true">
</f:TextBox>
</Items>

View File

@ -57,6 +57,7 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
this.drpYearMonth.SelectedDate = Convert.ToDateTime($"{model.Year}-{model.Month}");
this.txtCompileDate.Text = model.CompileDate.ToShortDateString();
this.txtCompileManName.Text = model.CompileManName;
this.txtUnitProjectName.Text = model.UnitProjectName;
this.txtWorkPlace.Text = model.WorkPlace;
this.txtJobStep.Text = model.JobStep;

View File

@ -59,6 +59,15 @@ namespace FineUIPro.Web.ReportManage.HazardFactor
/// </remarks>
protected global::FineUIPro.DatePicker txtCompileDate;
/// <summary>
/// txtUnitProjectName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUnitProjectName;
/// <summary>
/// txtCompileManName 控件。
/// </summary>

View File

@ -233,6 +233,12 @@ namespace Model
partial void InsertBase_SafetyMeasures(Base_SafetyMeasures instance);
partial void UpdateBase_SafetyMeasures(Base_SafetyMeasures instance);
partial void DeleteBase_SafetyMeasures(Base_SafetyMeasures instance);
partial void InsertBase_SafetyProblemClassify(Base_SafetyProblemClassify instance);
partial void UpdateBase_SafetyProblemClassify(Base_SafetyProblemClassify instance);
partial void DeleteBase_SafetyProblemClassify(Base_SafetyProblemClassify instance);
partial void InsertBase_SafetyProblemClassifyItem(Base_SafetyProblemClassifyItem instance);
partial void UpdateBase_SafetyProblemClassifyItem(Base_SafetyProblemClassifyItem instance);
partial void DeleteBase_SafetyProblemClassifyItem(Base_SafetyProblemClassifyItem instance);
partial void InsertBase_SecretLevel(Base_SecretLevel instance);
partial void UpdateBase_SecretLevel(Base_SecretLevel instance);
partial void DeleteBase_SecretLevel(Base_SecretLevel instance);
@ -3290,6 +3296,22 @@ namespace Model
}
}
public System.Data.Linq.Table<Base_SafetyProblemClassify> Base_SafetyProblemClassify
{
get
{
return this.GetTable<Base_SafetyProblemClassify>();
}
}
public System.Data.Linq.Table<Base_SafetyProblemClassifyItem> Base_SafetyProblemClassifyItem
{
get
{
return this.GetTable<Base_SafetyProblemClassifyItem>();
}
}
public System.Data.Linq.Table<Base_SecretLevel> Base_SecretLevel
{
get
@ -39817,6 +39839,391 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_SafetyProblemClassify")]
public partial class Base_SafetyProblemClassify : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private string _ClassifyId;
private string _ClassifyCode;
private string _ClassifyName;
private EntitySet<Base_SafetyProblemClassifyItem> _Base_SafetyProblemClassifyItem;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnClassifyIdChanging(string value);
partial void OnClassifyIdChanged();
partial void OnClassifyCodeChanging(string value);
partial void OnClassifyCodeChanged();
partial void OnClassifyNameChanging(string value);
partial void OnClassifyNameChanged();
#endregion
public Base_SafetyProblemClassify()
{
this._Base_SafetyProblemClassifyItem = new EntitySet<Base_SafetyProblemClassifyItem>(new Action<Base_SafetyProblemClassifyItem>(this.attach_Base_SafetyProblemClassifyItem), new Action<Base_SafetyProblemClassifyItem>(this.detach_Base_SafetyProblemClassifyItem));
OnCreated();
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string ClassifyId
{
get
{
return this._ClassifyId;
}
set
{
if ((this._ClassifyId != value))
{
this.OnClassifyIdChanging(value);
this.SendPropertyChanging();
this._ClassifyId = value;
this.SendPropertyChanged("ClassifyId");
this.OnClassifyIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
public string ClassifyCode
{
get
{
return this._ClassifyCode;
}
set
{
if ((this._ClassifyCode != value))
{
this.OnClassifyCodeChanging(value);
this.SendPropertyChanging();
this._ClassifyCode = value;
this.SendPropertyChanged("ClassifyCode");
this.OnClassifyCodeChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)]
public string ClassifyName
{
get
{
return this._ClassifyName;
}
set
{
if ((this._ClassifyName != value))
{
this.OnClassifyNameChanging(value);
this.SendPropertyChanging();
this._ClassifyName = value;
this.SendPropertyChanged("ClassifyName");
this.OnClassifyNameChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_SafetyProblemClassifyItem_Classify", Storage="_Base_SafetyProblemClassifyItem", ThisKey="ClassifyId", OtherKey="ClassifyId", DeleteRule="NO ACTION")]
public EntitySet<Base_SafetyProblemClassifyItem> Base_SafetyProblemClassifyItem
{
get
{
return this._Base_SafetyProblemClassifyItem;
}
set
{
this._Base_SafetyProblemClassifyItem.Assign(value);
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
private void attach_Base_SafetyProblemClassifyItem(Base_SafetyProblemClassifyItem entity)
{
this.SendPropertyChanging();
entity.Base_SafetyProblemClassify = this;
}
private void detach_Base_SafetyProblemClassifyItem(Base_SafetyProblemClassifyItem entity)
{
this.SendPropertyChanging();
entity.Base_SafetyProblemClassify = null;
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_SafetyProblemClassifyItem")]
public partial class Base_SafetyProblemClassifyItem : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private string _ClassifyItemId;
private string _ClassifyId;
private string _ClassifyItemCode;
private string _ClassifyItemName;
private string _CompileMan;
private string _CompileManName;
private System.Nullable<System.DateTime> _CompileDate;
private EntityRef<Base_SafetyProblemClassify> _Base_SafetyProblemClassify;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnClassifyItemIdChanging(string value);
partial void OnClassifyItemIdChanged();
partial void OnClassifyIdChanging(string value);
partial void OnClassifyIdChanged();
partial void OnClassifyItemCodeChanging(string value);
partial void OnClassifyItemCodeChanged();
partial void OnClassifyItemNameChanging(string value);
partial void OnClassifyItemNameChanged();
partial void OnCompileManChanging(string value);
partial void OnCompileManChanged();
partial void OnCompileManNameChanging(string value);
partial void OnCompileManNameChanged();
partial void OnCompileDateChanging(System.Nullable<System.DateTime> value);
partial void OnCompileDateChanged();
#endregion
public Base_SafetyProblemClassifyItem()
{
this._Base_SafetyProblemClassify = default(EntityRef<Base_SafetyProblemClassify>);
OnCreated();
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyItemId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string ClassifyItemId
{
get
{
return this._ClassifyItemId;
}
set
{
if ((this._ClassifyItemId != value))
{
this.OnClassifyItemIdChanging(value);
this.SendPropertyChanging();
this._ClassifyItemId = value;
this.SendPropertyChanged("ClassifyItemId");
this.OnClassifyItemIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyId", DbType="NVarChar(50)")]
public string ClassifyId
{
get
{
return this._ClassifyId;
}
set
{
if ((this._ClassifyId != value))
{
if (this._Base_SafetyProblemClassify.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnClassifyIdChanging(value);
this.SendPropertyChanging();
this._ClassifyId = value;
this.SendPropertyChanged("ClassifyId");
this.OnClassifyIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyItemCode", DbType="NVarChar(50)")]
public string ClassifyItemCode
{
get
{
return this._ClassifyItemCode;
}
set
{
if ((this._ClassifyItemCode != value))
{
this.OnClassifyItemCodeChanging(value);
this.SendPropertyChanging();
this._ClassifyItemCode = value;
this.SendPropertyChanged("ClassifyItemCode");
this.OnClassifyItemCodeChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyItemName", DbType="NVarChar(100)")]
public string ClassifyItemName
{
get
{
return this._ClassifyItemName;
}
set
{
if ((this._ClassifyItemName != value))
{
this.OnClassifyItemNameChanging(value);
this.SendPropertyChanging();
this._ClassifyItemName = value;
this.SendPropertyChanged("ClassifyItemName");
this.OnClassifyItemNameChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileMan", DbType="NVarChar(50)")]
public string CompileMan
{
get
{
return this._CompileMan;
}
set
{
if ((this._CompileMan != value))
{
this.OnCompileManChanging(value);
this.SendPropertyChanging();
this._CompileMan = value;
this.SendPropertyChanged("CompileMan");
this.OnCompileManChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileManName", DbType="NVarChar(50)")]
public string CompileManName
{
get
{
return this._CompileManName;
}
set
{
if ((this._CompileManName != value))
{
this.OnCompileManNameChanging(value);
this.SendPropertyChanging();
this._CompileManName = value;
this.SendPropertyChanged("CompileManName");
this.OnCompileManNameChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileDate", DbType="DateTime")]
public System.Nullable<System.DateTime> CompileDate
{
get
{
return this._CompileDate;
}
set
{
if ((this._CompileDate != value))
{
this.OnCompileDateChanging(value);
this.SendPropertyChanging();
this._CompileDate = value;
this.SendPropertyChanged("CompileDate");
this.OnCompileDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_SafetyProblemClassifyItem_Classify", Storage="_Base_SafetyProblemClassify", ThisKey="ClassifyId", OtherKey="ClassifyId", IsForeignKey=true)]
public Base_SafetyProblemClassify Base_SafetyProblemClassify
{
get
{
return this._Base_SafetyProblemClassify.Entity;
}
set
{
Base_SafetyProblemClassify previousValue = this._Base_SafetyProblemClassify.Entity;
if (((previousValue != value)
|| (this._Base_SafetyProblemClassify.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Base_SafetyProblemClassify.Entity = null;
previousValue.Base_SafetyProblemClassifyItem.Remove(this);
}
this._Base_SafetyProblemClassify.Entity = value;
if ((value != null))
{
value.Base_SafetyProblemClassifyItem.Add(this);
this._ClassifyId = value.ClassifyId;
}
else
{
this._ClassifyId = default(string);
}
this.SendPropertyChanged("Base_SafetyProblemClassify");
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_SecretLevel")]
public partial class Base_SecretLevel : INotifyPropertyChanging, INotifyPropertyChanged
{
@ -168600,6 +169007,10 @@ namespace Model
private int _State;
private string _UnitId;
private string _UnitProjectName;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
@ -168656,6 +169067,10 @@ namespace Model
partial void OnResponsibleDepartmentChanged();
partial void OnStateChanging(int value);
partial void OnStateChanged();
partial void OnUnitIdChanging(string value);
partial void OnUnitIdChanged();
partial void OnUnitProjectNameChanging(string value);
partial void OnUnitProjectNameChanged();
#endregion
public HazardFactor_OccHealth()
@ -168783,7 +169198,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")]
public string ProjectId
{
get
@ -168843,7 +169258,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Hazard", DbType="NVarChar(500) NOT NULL", CanBeNull=false)]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Hazard", DbType="NVarChar(2000)")]
public string Hazard
{
get
@ -169003,7 +169418,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NetRiskControlMeasures", DbType="NVarChar(500)")]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NetRiskControlMeasures", DbType="NVarChar(2000)")]
public string NetRiskControlMeasures
{
get
@ -169123,7 +169538,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AdditionalControlMeasures", DbType="NVarChar(500)")]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AdditionalControlMeasures", DbType="NVarChar(2000)")]
public string AdditionalControlMeasures
{
get
@ -169183,6 +169598,46 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50)")]
public string UnitId
{
get
{
return this._UnitId;
}
set
{
if ((this._UnitId != value))
{
this.OnUnitIdChanging(value);
this.SendPropertyChanging();
this._UnitId = value;
this.SendPropertyChanged("UnitId");
this.OnUnitIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitProjectName", DbType="NVarChar(200)")]
public string UnitProjectName
{
get
{
return this._UnitProjectName;
}
set
{
if ((this._UnitProjectName != value))
{
this.OnUnitProjectNameChanging(value);
this.SendPropertyChanging();
this._UnitProjectName = value;
this.SendPropertyChanged("UnitProjectName");
this.OnUnitProjectNameChanged();
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
@ -169262,6 +169717,10 @@ namespace Model
private int _State;
private string _UnitId;
private string _UnitProjectName;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
@ -169318,6 +169777,10 @@ namespace Model
partial void OnResponsibleDepartmentChanged();
partial void OnStateChanging(int value);
partial void OnStateChanged();
partial void OnUnitIdChanging(string value);
partial void OnUnitIdChanged();
partial void OnUnitProjectNameChanging(string value);
partial void OnUnitProjectNameChanged();
#endregion
public HazardFactor_Safety()
@ -169445,7 +169908,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")]
public string ProjectId
{
get
@ -169505,7 +169968,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Hazard", DbType="NVarChar(500) NOT NULL", CanBeNull=false)]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Hazard", DbType="NVarChar(2000)")]
public string Hazard
{
get
@ -169665,7 +170128,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NetRiskControlMeasures", DbType="NVarChar(500)")]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NetRiskControlMeasures", DbType="NVarChar(2000)")]
public string NetRiskControlMeasures
{
get
@ -169785,7 +170248,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AdditionalControlMeasures", DbType="NVarChar(500)")]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AdditionalControlMeasures", DbType="NVarChar(2000)")]
public string AdditionalControlMeasures
{
get
@ -169845,6 +170308,46 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50)")]
public string UnitId
{
get
{
return this._UnitId;
}
set
{
if ((this._UnitId != value))
{
this.OnUnitIdChanging(value);
this.SendPropertyChanging();
this._UnitId = value;
this.SendPropertyChanged("UnitId");
this.OnUnitIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitProjectName", DbType="NVarChar(200)")]
public string UnitProjectName
{
get
{
return this._UnitProjectName;
}
set
{
if ((this._UnitProjectName != value))
{
this.OnUnitProjectNameChanging(value);
this.SendPropertyChanging();
this._UnitProjectName = value;
this.SendPropertyChanged("UnitProjectName");
this.OnUnitProjectNameChanged();
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;