提交代码

This commit is contained in:
高飞 2025-04-01 09:32:32 +08:00
commit a3e06cfc69
29 changed files with 4575 additions and 48 deletions

View File

@ -0,0 +1,250 @@
UPDATE [dbo].[Sys_Menu] SET [IsUsed] = '0' WHERE CONVERT(NVARCHAR(MAX), [MenuId]) = N'C502FC6D-DE43-4646-AE28-168D8C7BF4C0';
UPDATE [dbo].[Sys_Menu] SET [IsUsed] = '0' WHERE CONVERT(NVARCHAR(MAX), [MenuId]) = N'6090DD54-FE59-4011-92EE-9906C9BC69B6';
UPDATE [dbo].[Sys_Menu] SET [IsUsed] = '0' WHERE CONVERT(NVARCHAR(MAX), [MenuId]) = N'DEE90726-E00D-462B-A4BF-7E36180DD5B8';
INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed], [MenuEnName])
VALUES (N'CAAD533A-D199-4CFB-BCC1-980FBE1085EC', N'安全专检', NULL, N'OfficeCheck/Inspect/SafetyInspection.aspx', 40, N'0', N'Menu_Server', '1', '1', '1', NULL);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'CAAD533A-D199-4CFB-BCC1-980FBE1085EC', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'CAAD533A-D199-4CFB-BCC1-980FBE1085EC', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'CAAD533A-D199-4CFB-BCC1-980FBE1085EC', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'CAAD533A-D199-4CFB-BCC1-980FBE1085EC', N'保存', 4);
INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed], [MenuEnName])
VALUES (N'BDCCE638-E9EF-421D-B09B-699F02A4462C', N'质量专检', NULL, N'OfficeCheck/Inspect/QualityInspection.aspx', 50, N'0', N'Menu_Server', '1', '1', '1', NULL);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'BDCCE638-E9EF-421D-B09B-699F02A4462C', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'BDCCE638-E9EF-421D-B09B-699F02A4462C', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'BDCCE638-E9EF-421D-B09B-699F02A4462C', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'BDCCE638-E9EF-421D-B09B-699F02A4462C', N'保存', 4);
INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed], [MenuEnName])
VALUES (N'0DAAF731-D058-41E9-9C8A-0647DF82E0D0', N'安全专检', NULL, N'OfficeCheck/Inspect/ProjectSafetyInspection.aspx', 140, N'467A0CB9-737D-4451-965E-869EBC3A4BD6', N'Menu_HSSE', '1', '1', '1', NULL);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'0DAAF731-D058-41E9-9C8A-0647DF82E0D0', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'0DAAF731-D058-41E9-9C8A-0647DF82E0D0', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'0DAAF731-D058-41E9-9C8A-0647DF82E0D0', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'0DAAF731-D058-41E9-9C8A-0647DF82E0D0', N'保存', 4);
INSERT INTO [dbo].[Sys_Menu] ([MenuId], [MenuName], [Icon], [Url], [SortIndex], [SuperMenu], [MenuType], [IsOffice], [IsEnd], [IsUsed], [MenuEnName])
VALUES (N'66A8D852-A542-47C7-B474-C0EEA73AC58E', N'质量专检', NULL, N'OfficeCheck/Inspect/ProjectQualityInspection.aspx', 40, N'A54EC449-5F77-4068-83B9-AA305B721A0B', N'Menu_CQMS', '1', '1', '1', NULL);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'66A8D852-A542-47C7-B474-C0EEA73AC58E', N'增加', 1);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'66A8D852-A542-47C7-B474-C0EEA73AC58E', N'修改', 2);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'66A8D852-A542-47C7-B474-C0EEA73AC58E', N'删除', 3);
INSERT INTO [dbo].[Sys_ButtonToMenu] ([ButtonToMenuId], [MenuId], [ButtonName], [SortIndex])
VALUES (NEWID(), N'66A8D852-A542-47C7-B474-C0EEA73AC58E', N'保存', 4);
CREATE TABLE [dbo].[Inspect_Inspection] (
[InspectionId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[InspectionCode] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[ProjectId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PersonResponsible] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[InspectTime] datetime NULL,
[Description] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL,
[States] char(1) COLLATE Chinese_PRC_CI_AS NULL,
[InspectMan] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[InspectType] char(1) COLLATE Chinese_PRC_CI_AS NULL,
[InspectItemSetId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ProjectStates] char(1) COLLATE Chinese_PRC_CI_AS NULL,
[CreateMan] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CreateTime] datetime NULL,
CONSTRAINT [PK_Inspect_Inspection_1] PRIMARY KEY CLUSTERED ([InspectionId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY],
CONSTRAINT [FK_Inspect_Inspection_Base_Project] FOREIGN KEY ([ProjectId]) REFERENCES [dbo].[Base_Project] ([ProjectId]) ON DELETE NO ACTION ON UPDATE NO ACTION
)
ON [PRIMARY]
GO
ALTER TABLE [dbo].[Inspect_Inspection] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'专检编号',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_Inspection',
'COLUMN', N'InspectionCode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'项目',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_Inspection',
'COLUMN', N'ProjectId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'项目责任人',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_Inspection',
'COLUMN', N'PersonResponsible'
GO
EXEC sp_addextendedproperty
'MS_Description', N'检查时间',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_Inspection',
'COLUMN', N'InspectTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'检查人',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_Inspection',
'COLUMN', N'InspectMan'
GO
EXEC sp_addextendedproperty
'MS_Description', N'描述',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_Inspection',
'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty
'MS_Description', N'检查类型(1安全;2质量)',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_Inspection',
'COLUMN', N'InspectType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'(安全/质量)专检表',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_Inspection'
CREATE TABLE [dbo].[Inspect_InspectionItem] (
[InspectionItemId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[InspectionId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[InspectionItemCode] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ProjectId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[InspectionDescribe] nvarchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
[PhotoUrl] nvarchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
[VideoUrl] nvarchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
[EvaluateResults] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[TimeLimited] datetime NULL,
[RectificationDescription] nvarchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
[RectificationResults] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[States] char(1) COLLATE Chinese_PRC_CI_AS NULL,
[CompileMan] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[CompileTime] datetime NULL,
[RectificationPhotoUrl] nvarchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_Inspect_InspectionItem_1] PRIMARY KEY CLUSTERED ([InspectionItemId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY],
CONSTRAINT [FK_Inspect_InspectionItem_Base_Project] FOREIGN KEY ([ProjectId]) REFERENCES [dbo].[Base_Project] ([ProjectId]) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT [FK_Inspect_InspectionItem_Inspect_Inspection] FOREIGN KEY ([InspectionId]) REFERENCES [dbo].[Inspect_Inspection] ([InspectionId]) ON DELETE NO ACTION ON UPDATE NO ACTION
)
ON [PRIMARY]
GO
ALTER TABLE [dbo].[Inspect_InspectionItem] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'专项表id',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_InspectionItem',
'COLUMN', N'InspectionId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'项目',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_InspectionItem',
'COLUMN', N'ProjectId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'检查项',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_InspectionItem',
'COLUMN', N'InspectionDescribe'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图片',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_InspectionItem',
'COLUMN', N'PhotoUrl'
GO
EXEC sp_addextendedproperty
'MS_Description', N'视频',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_InspectionItem',
'COLUMN', N'VideoUrl'
GO
EXEC sp_addextendedproperty
'MS_Description', N'评价结果(合格/不合格)',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_InspectionItem',
'COLUMN', N'EvaluateResults'
GO
EXEC sp_addextendedproperty
'MS_Description', N'限时时间',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_InspectionItem',
'COLUMN', N'TimeLimited'
GO
EXEC sp_addextendedproperty
'MS_Description', N'整改描述',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_InspectionItem',
'COLUMN', N'RectificationDescription'
GO
EXEC sp_addextendedproperty
'MS_Description', N'整改结果',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_InspectionItem',
'COLUMN', N'RectificationResults'
GO
EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_InspectionItem',
'COLUMN', N'States'
GO
EXEC sp_addextendedproperty
'MS_Description', N'(安全/质量)专检明细表',
'SCHEMA', N'dbo',
'TABLE', N'Inspect_InspectionItem'

View File

@ -2674,6 +2674,14 @@ namespace BLL
/// </summary>
public const string ProjectCheckSpecialMenuId = "1B08048F-93ED-4E84-AE65-DB7917EA2DFB";
/// <summary>
/// 安全专检
/// </summary>
public const string SafetyInspectionMenuId = "CAAD533A-D199-4CFB-BCC1-980FBE1085EC";
/// <summary>
/// 安全专检
/// </summary>
public const string ProjectSafetyInspectionMenuId = "0DAAF731-D058-41E9-9C8A-0647DF82E0D0";
/// <summary>
/// HSSE综合检查
/// </summary>
public const string ProjectCheckColligationMenuId = "C198EBA8-9E23-4654-92E1-09C61105C522";

View File

@ -64,14 +64,10 @@ namespace BLL.OfficeCheck.Inspect
RectificationResults = InspectionItem.RectificationResults,
States = InspectionItem.States,
CompileMan = InspectionItem.CompileMan,
CompileTime = InspectionItem.CompileTime,
CompileTime = DateTime.Now,
};
db.Inspect_InspectionItem.InsertOnSubmit(newInspectionItem);
db.SubmitChanges();
// ////增加一条编码记录
// BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectSafetyInspectionMenuId,
// InspectionItem.ProjectId, null, InspectionItem.InspectionItemId, new DateTime());
}
@ -114,12 +110,26 @@ namespace BLL.OfficeCheck.Inspect
newInspection.InspectTime = Inspection.InspectTime;
newInspection.Description = Inspection.Description;
newInspection.States = Inspection.States;
newInspection.InspectMan = Inspection.InspectMan;
newInspection.InspectType = Inspection.InspectType;
newInspection.InspectItemSetId = Inspection.InspectItemSetId;
db.SubmitChanges();
}
}
/// <summary>
/// 修改安全专项检查状态信息
/// </summary>
/// <param name="Inspection"></param>
public static void UpdateInspectionStates(string InspectionId, string States)
{
Model.SGGLDB db = Funs.DB;
Model.Inspect_Inspection newInspection =
db.Inspect_Inspection.FirstOrDefault(e => e.InspectionId == InspectionId);
if (newInspection != null)
{
newInspection.States = States;
db.SubmitChanges();
}
}
/// <summary>
/// 修改安全专项检查明细
/// </summary>
@ -306,6 +316,7 @@ namespace BLL.OfficeCheck.Inspect
{
var list = (from x in Funs.DB.Inspect_InspectionItem
where x.InspectionId == InspectionId
orderby x.CompileTime descending
select x).ToList();
return list;
}

View File

@ -2408,6 +2408,14 @@
<Content Include="OfficeCheck\Check\CheckReport.aspx" />
<Content Include="OfficeCheck\Check\CheckTeamEdit.aspx" />
<Content Include="OfficeCheck\Check\RectifyEdit.aspx" />
<Content Include="OfficeCheck\Inspect\ProjectQualityInspection.aspx" />
<Content Include="OfficeCheck\Inspect\ProjectSafetyInspection.aspx" />
<Content Include="OfficeCheck\Inspect\ProjectSafetyInspectionEdit.aspx" />
<Content Include="OfficeCheck\Inspect\ProjectSafetyInspectionRectify.aspx" />
<Content Include="OfficeCheck\Inspect\QualityInspection.aspx" />
<Content Include="OfficeCheck\Inspect\SafetyInspection.aspx" />
<Content Include="OfficeCheck\Inspect\SafetyInspectionEdit.aspx" />
<Content Include="OfficeCheck\Inspect\SafetyInspectionRectify.aspx" />
<Content Include="OfficeCheck\ProjectEvaluation\ProjectEvaluation.aspx" />
<Content Include="OfficeCheck\ProjectEvaluation\ProjectEvaluationEdit.aspx" />
<Content Include="Personal\FileSearch.aspx" />
@ -16171,6 +16179,59 @@
<Compile Include="OfficeCheck\Check\RectifyEdit.aspx.designer.cs">
<DependentUpon>RectifyEdit.aspx</DependentUpon>
</Compile>
<Compile Include="OfficeCheck\Inspect\ProjectQualityInspection.aspx.cs">
<DependentUpon>ProjectQualityInspection.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="OfficeCheck\Inspect\ProjectQualityInspection.aspx.designer.cs">
<DependentUpon>ProjectQualityInspection.aspx</DependentUpon>
</Compile>
<Compile Include="OfficeCheck\Inspect\ProjectSafetyInspection.aspx.cs">
<DependentUpon>ProjectSafetyInspection.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="OfficeCheck\Inspect\ProjectSafetyInspection.aspx.designer.cs">
<DependentUpon>ProjectSafetyInspection.aspx</DependentUpon>
</Compile>
<Compile Include="OfficeCheck\Inspect\ProjectSafetyInspectionEdit.aspx.cs">
<DependentUpon>ProjectSafetyInspectionEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="OfficeCheck\Inspect\ProjectSafetyInspectionEdit.aspx.designer.cs">
<DependentUpon>ProjectSafetyInspectionEdit.aspx</DependentUpon>
</Compile>
<Compile Include="OfficeCheck\Inspect\ProjectSafetyInspectionRectify.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="OfficeCheck\Inspect\ProjectSafetyInspectionRectify.aspx.designer.cs" />
<Compile Include="OfficeCheck\Inspect\QualityInspection.aspx.cs">
<DependentUpon>QualityInspection.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="OfficeCheck\Inspect\QualityInspection.aspx.designer.cs">
<DependentUpon>QualityInspection.aspx</DependentUpon>
</Compile>
<Compile Include="OfficeCheck\Inspect\SafetyInspection.aspx.cs">
<DependentUpon>SafetyInspection.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="OfficeCheck\Inspect\SafetyInspection.aspx.designer.cs">
<DependentUpon>SafetyInspection.aspx</DependentUpon>
</Compile>
<Compile Include="OfficeCheck\Inspect\SafetyInspectionEdit.aspx.cs">
<DependentUpon>SafetyInspectionEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="OfficeCheck\Inspect\SafetyInspectionEdit.aspx.designer.cs">
<DependentUpon>SafetyInspectionEdit.aspx</DependentUpon>
</Compile>
<Compile Include="OfficeCheck\Inspect\SafetyInspectionRectify.aspx.cs">
<DependentUpon>SafetyInspectionRectify.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="OfficeCheck\Inspect\SafetyInspectionRectify.aspx.designer.cs">
<DependentUpon>SafetyInspectionRectify.aspx</DependentUpon>
</Compile>
<Compile Include="OfficeCheck\ProjectEvaluation\ProjectEvaluation.aspx.cs">
<DependentUpon>ProjectEvaluation.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -19658,7 +19719,7 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@ -0,0 +1,16 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectQualityInspection.aspx.cs" Inherits="FineUIPro.Web.OfficeCheck.Inspect.ProjectQualityInspection" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class ProjectQualityInspection : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}

View File

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

View File

@ -0,0 +1,139 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectSafetyInspection.aspx.cs" Inherits="FineUIPro.Web.OfficeCheck.Inspect.ProjectSafetyInspection" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="安全专检" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="InspectionId" EnableColumnLines="true"
DataIDField="InspectionId" AllowSorting="true" ForceFit="true"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox runat="server" Label="责任人" ID="txtPersonResponsible" EmptyText="输入查询条件" AutoPostBack="true"
OnTextChanged="TextBox_TextChanged" LabelAlign="right" Width="210px" LabelWidth="80px">
</f:TextBox>
<f:DatePicker ID="txtStartTime" runat="server" Label="检查时间" LabelAlign="Right"
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="200px" LabelWidth="80px">
</f:DatePicker>
<f:Label ID="Label3" runat="server" Text="至">
</f:Label>
<f:DatePicker ID="txtEndTime" runat="server" AutoPostBack="true" OnTextChanged="TextBox_TextChanged"
Width="130px">
</f:DatePicker>
<f:RadioButtonList runat="server" ID="rbStates" Width="280px" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
<f:RadioItem Text="全部" Value="-1" Selected="true"/>
<f:RadioItem Text="待提交" Value="0"/>
<f:RadioItem Text="待整改" Value="1"/>
<f:RadioItem Text="已完成" Value="2"/>
</f:RadioButtonList>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<%-- <f:RadioButtonList ID="rbOutType" Label="导出格式" runat="server"> --%>
<%-- <f:RadioItem Text="无图" Value="0" Selected="true"/> --%>
<%-- <f:RadioItem Text="有图" Value="1"/> --%>
<%-- </f:RadioButtonList> --%>
<%-- <f:Button ID="btnNew" Icon="Add" runat="server" OnClick="btnNew_Click" ToolTip="新增"> --%>
<%-- </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:TemplateField ColumnID="tfNumber" Width="100px" HeaderText="序号" HeaderTextAlign="Center"
TextAlign="Center">
<ItemTemplate>
<asp:Label ID="labNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="200px" ColumnID="InspectionCode" DataField="InspectionCode"
SortField="InspectionCode" FieldType="String" HeaderText="编号" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="800px" ColumnID="Description" DataField="Description"
SortField="Description" FieldType="String" HeaderText="描述" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="PersonResponsible" DataField="PersonResponsible"
SortField="PersonResponsible" FieldType="String" HeaderText="责任人" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="InspectTime" DataField="InspectTime" SortField="InspectTime"
FieldType="Date" Renderer="Date" HeaderText="检查日期" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField ColumnID="States" DataField="States"
SortField="States" FieldType="String" HeaderText="状态" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu"/>
</Listeners>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" runat="server" Hidden="true" ShowHeader="true"
IsModal="true" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window1_Close"
Title="编辑" EnableIFrame="true" Height="500px"
Width="900px">
</f:Window>
<f:Window ID="Window2" Title="导入" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Top" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
Width="700px" Height="560px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnEdit_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="编辑" Icon="TableEdit">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnDelete_Click" EnablePostBack="true" Icon="Delete"
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
</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,319 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Newtonsoft.Json.Linq;
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class ProjectSafetyInspection : PageBase
{
public Model.SGGLDB db = Funs.DB;
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#region
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
GetButtonPower();
Funs.DropDownPageSize(this.ddlPageSize);
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
BindGrid();
}
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (this.CurrUser != null)
{
this.btnMenuEdit.Hidden = false;
this.btnMenuDelete.Hidden = false;
// var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SafetyInspectionMenuId);
// if (buttonList.Count() > 0)
// {
// if (buttonList.Contains(BLL.Const.BtnAdd))
// {
// // this.btnNew.Hidden = false;
// }
// if (buttonList.Contains(BLL.Const.BtnModify))
// {
// this.btnMenuEdit.Hidden = false;
// }
// if (buttonList.Contains(BLL.Const.BtnDelete))
// {
// //this.btnDelete.Hidden = false;
// this.btnMenuDelete.Hidden = false;
// }
// }
}
}
#endregion
#region
/// <summary>
/// 加载树
/// </summary>
private void InitTreeMenu()
{
}
#endregion
#region Tree点击事件
/// <summary>
/// Tree点击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void trProjects_NodeCommand(object sender, TreeCommandEventArgs e)
{
BindGrid();
}
#endregion
#region
private void BindGrid()
{
string strSql =
@"select Inspection.InspectionId,Inspection.InspectionCode,Inspection.ProjectId,b.UserName as PersonResponsible,Inspection.InspectTime,Inspection.Description,"
+ @" (CASE WHEN Inspection.States ='1' THEN '待整改'
WHEN Inspection.States ='2' THEN ''
WHEN Inspection.States ='3' THEN ''
WHEN Inspection.States ='4' THEN ''
WHEN Inspection.States ='5' THEN ''
ELSE '' END) AS States, "
+ @" c.UserName as InspectMan,Inspection.InspectType,Inspection.InspectItemSetId from Inspect_Inspection Inspection left join Sys_User b on Inspection.PersonResponsible = b.UserID left join Sys_User c on Inspection.InspectMan = c.UserID where Inspection.InspectType='1' ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND Inspection.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
strSql += " AND Inspection.PersonResponsible = @PersonResponsible";
listStr.Add(new SqlParameter("@PersonResponsible", this.CurrUser.UserId));
if (!string.IsNullOrEmpty(txtPersonResponsible.Text.Trim()))
{
strSql += " AND b.UserName like @PersonResponsible";
listStr.Add(new SqlParameter("@PersonResponsible", "%" + txtPersonResponsible.Text.Trim() + "%"));
}
if (this.rbStates.SelectedValue!="-1")
{
strSql += " AND Inspection.States = @States";
listStr.Add(new SqlParameter("@States", this.rbStates.SelectedValue));
}
if (!string.IsNullOrEmpty(this.txtStartTime.Text.Trim()))
{
strSql += " AND Inspection.InspectTime >= @StartTime";
listStr.Add(new SqlParameter("@StartTime", this.txtStartTime.Text.Trim()));
}
if (!string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
{
strSql += " AND Inspection.InspectTime <= @EndTime";
listStr.Add(new SqlParameter("@EndTime", this.txtEndTime.Text.Trim()));
}
strSql += " order by Inspection.InspectTime desc";
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region
/// <summary>
/// 关闭窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
ShowNotify("操作成功!", MessageBoxIcon.Success);
BindGrid();
}
protected void Window2_Close(object sender, WindowCloseEventArgs e)
{
ShowNotify("增加成功!", MessageBoxIcon.Success);
BindGrid();
}
#endregion
#region
protected void btnNew_Click(object sender, EventArgs e) {
// if (trProjects.SelectedNode==null)
// {
// ShowNotify("请选择子节点进行添加!", MessageBoxIcon.Warning);
// return;
// }
// if (trProjects.SelectedNode.CommandName == "parent")
// {
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectSafetyInspectionEdit.aspx?ProjectId={0}",trProjects.SelectedNode.NodeID ,"增加 - ")));
// }
// else {
// ShowNotify("请选择子节点进行添加!", MessageBoxIcon.Warning);
// }
}
#endregion
/// <summary>
/// 编辑按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnEdit_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
Debug.WriteLine(this.Grid1.SelectedRowID);
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectSafetyInspectionEdit.aspx?InspectionId={0}", this.Grid1.SelectedRowID, "编辑 - ")));
}
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
this.btnEdit_Click(null, null);
}
/// <summary>
/// 批量删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
// BLL.DCGL.CheckTemplateCopyService.DeleteCheckTemplateCopyById(rowID);
}
BindGrid();
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
}
}
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
// string name = this.trProjects.SelectedNode.Text;
string filename = Funs.GetNewFileName();
// Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode(name + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Grid1.PageSize = this.Grid1.RecordCount;
this.BindGrid();
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(this.txtStartTime.Text.Trim()) && !string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
{
if (Funs.GetNewDateTime(this.txtStartTime.Text.Trim()) > Funs.GetNewDateTime(this.txtEndTime.Text.Trim()))
{
Alert.ShowInTop("开始时间不能大于结束时间!", MessageBoxIcon.Warning);
return;
}
}
this.BindGrid();
}
#endregion
#region GV
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
this.Grid1.PageIndex = e.NewPageIndex;
this.BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
this.BindGrid();
}
/// <summary>
/// 分页显示条数下拉框
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue);
this.BindGrid();
}
#endregion
}
}

View File

@ -0,0 +1,197 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class ProjectSafetyInspection
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// txtPersonResponsible control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtPersonResponsible;
/// <summary>
/// txtStartTime control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DatePicker txtStartTime;
/// <summary>
/// Label3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Label Label3;
/// <summary>
/// txtEndTime control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DatePicker txtEndTime;
/// <summary>
/// rbStates control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.RadioButtonList rbStates;
/// <summary>
/// btnOut control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// labNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label labNumber;
/// <summary>
/// ToolbarSeparator1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Menu1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuDelete control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDelete;
}
}

View File

@ -0,0 +1,170 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectSafetyInspectionEdit.aspx.cs" Inherits="FineUIPro.Web.OfficeCheck.Inspect.ProjectSafetyInspectionEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>编辑安全专检</title>
<link href="~/res/css/common.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.labcenter
{
text-align: center;
}
.f-grid-row.burlywood
{
background-color: burlywood;
background-image: none;
}
.fontred
{
color: #FF7575;
background-image: none;
}
</style>
</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 ColumnWidths="50%">
<Items>
<f:TextBox ID="txtInspectionCode" runat="server" Label="编号" MaxLength="50" Readonly="True">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="50%">
<Items>
<f:TextArea ID="txtDescription" runat="server" Label="描述" MaxLength="2000" Readonly="True"></f:TextArea>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="50%">
<Items>
<f:DropDownList ID="drpPersonResponsible" runat="server" Label="责任人" EnableEdit="true" EnableMultiSelect="true"
ForceSelection="false" MaxLength="100" EnableCheckBoxSelect="true" OnSelectedIndexChanged="drpPersonResponsible_SelectedIndexChanged"
AutoPostBack="true" Readonly="True">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="50%">
<Items>
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="检查日期" ID="dpkInspectTime" EnableEdit="false" Readonly="True">
</f:DatePicker>
</Items>
<Items>
<f:Button ID="btnNew" Text="新增检查" Icon="Add" OnClick="btnAdd_Click" runat="server" MarginLeft="50px">
</f:Button>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" runat="server" DataIDField="InspectionItemId"
DataKeyNames="InspectionItemId" ShowGridHeader="true" SortDirection="ASC" OnRowCommand="Grid1_RowCommand"
MinHeight="350px" AllowCellEditing="true" ClicksToEdit="1" AllowSorting="true" EnableColumnLines="true" OnPreDataBound="Grid1_PreDataBound"
EnableTextSelection="True" OnSort="Grid1_Sort">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
TextAlign="Center"/>
<f:RenderField Width="300px" ColumnID="InspectionDescribe" DataField="InspectionDescribe"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="检查项">
<Editor>
<f:TextBox ID="txtInspectionDescribe" runat="server" ShowRedStar="true">
</f:TextBox>
</Editor>
</f:RenderField>
<f:LinkButtonField Width="200px" HeaderText="图片" ConfirmTarget="Top" CommandName="PhotoUrl"
TextAlign="Center" ToolTip="上传" Text="上传">
</f:LinkButtonField>
<f:LinkButtonField Width="200px" HeaderText="视频" ConfirmTarget="Top" CommandName="VideoUrl"
TextAlign="Center" ToolTip="上传" Text="上传"/>
<f:RenderField Width="200px" ColumnID="EvaluateResults" DataField="EvaluateResults" FieldType="String"
HeaderTextAlign="Center" TextAlign="Left" HeaderText="评价结果" Locked="True">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="TimeLimited" DataField="TimeLimited" FieldType="Date"
Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="限时日期" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="RectificationDescription" DataField="RectificationDescription"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="整改描述">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="RectificationResults" DataField="RectificationResults" FieldType="String"
HeaderTextAlign="Center" TextAlign="Left" HeaderText="整改结果">
</f:RenderField>
<f:RenderField ColumnID="States" DataField="States"
SortField="States" FieldType="String" HeaderText="状态" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
<f:LinkButtonField ColumnID="Delete" Width="100px" EnablePostBack="false" Icon="Delete"
HeaderTextAlign="Center" HeaderText="删除" TextAlign="Center"/>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu"/>
</Listeners>
</f:Grid>
</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" ToolTip="保存" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<%-- <f:Button ID="btnSubmit" Icon="SystemSaveNew" runat="server" ToolTip="提交" ValidateForms="SimpleForm1" --%>
<%-- OnClick="btnSubmit_Click"> --%>
<%-- </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>
<f:Window ID="Window1" runat="server" Hidden="true" ShowHeader="true"
IsModal="true" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window1_Close"
Title="整改" EnableIFrame="true" Height="500px"
Width="900px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuRectify" OnClick="btnRectify_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="整改" Icon="TableEdit">
</f:MenuButton>
<f:MenuButton ID="btnMenuShow" OnClick="btnShow_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="查看" Icon="ApplicationViewIcons">
</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,470 @@
using BLL;
using Model;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Diagnostics;
using System.Linq;
using BLL.OfficeCheck.Inspect;
using System.Data.SqlClient;
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class ProjectSafetyInspectionEdit : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
public string InspectionId
{
get
{
return (string)ViewState["InspectionId"];
}
set
{
ViewState["InspectionId"] = value;
}
}
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
public string PhotoUrl
{
get
{
return (string)ViewState["PhotoUrl"];
}
set
{
ViewState["PhotoUrl"] = value;
}
}
public string VideoUrl
{
get
{
return (string)ViewState["VideoUrl"];
}
set
{
ViewState["VideoUrl"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnMenuRectify.Hidden = false;
this.btnMenuShow.Hidden = false;
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
this.ProjectId = Request.Params["ProjectId"];
UserService.InitUserDropDownList(this.drpPersonResponsible, this.ProjectId, true);
this.dpkInspectTime.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
BindGrid();
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
this.InspectionId = Request.Params["InspectionId"];
var Inspection = Inspect_InspectionService.GetInspectionByInspectionId(this.InspectionId);
if (Inspection != null)
{
this.ProjectId = Inspection.ProjectId;
if (this.ProjectId != this.CurrUser.LoginProjectId)
{
this.InitDropDownList();
}
txtInspectionCode.Text = Inspection.InspectionCode;
txtDescription.Text = Inspection.Description;
this.drpPersonResponsible.SelectedValue = Inspection.PersonResponsible;
if (Inspection.InspectTime != null)
{
this.dpkInspectTime.Text = string.Format("{0:yyyy-MM-dd}", Inspection.InspectTime);
}
string strSql =
@"select item.InspectionItemId,item.InspectionId,item.InspectionDescribe,item.PhotoUrl,item.VideoUrl,item.EvaluateResults,item.TimeLimited,item.RectificationDescription,"
+ @" (CASE WHEN item.RectificationResults ='1' THEN '同意'
WHEN item.RectificationResults ='2' THEN ''
ELSE '' END) AS RectificationResults, "
+ @" (CASE WHEN item.States ='1' THEN '待评价'
WHEN item.States ='2' THEN ''
WHEN item.States ='3' THEN ''
WHEN item.States ='5' THEN ''
ELSE '' END) AS States, "
+ @" item.CompileMan ,item.CompileTime,item.RectificationPhotoUrl from Inspect_InspectionItem item where 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.InspectionId))
{
strSql += " AND item.InspectionId = @InspectionId";
listStr.Add(new SqlParameter("@InspectionId", this.InspectionId));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
else
{
this.dpkInspectTime.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
}
}
/// <summary>
/// 初始化下拉框
/// </summary>
private void InitDropDownList()
{
//检查组成员
UserService.InitUserDropDownList(this.drpPersonResponsible, this.ProjectId, true);
}
protected void btnAdd_Click(object sender, EventArgs e)
{
JArray teamGroupData = Grid1.GetMergedData();
List<JObject> list = new List<JObject>();
foreach (JObject teamGroupRow in teamGroupData)
{
JObject values = teamGroupRow.Value<JObject>("values");
values.Add("InspectionItemId", teamGroupRow.Value<string>("id"));
list.Add(values);
}
JObject defaultObj = new JObject
{ { "InspectionItemId",Guid.NewGuid() },
{ "InspectionDescribe", "" },
{ "PhotoUrl", "" },
{ "VideoUrl",""},
{ "RectificationDescription",""},
{ "Delete", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", GetDeleteScript(), IconHelper.GetResolvedIconUrl(Icon.Delete)) }
};
list.Add( defaultObj);
Grid1.DataSource = list;
Grid1.DataBind();
}
/// <summary>
/// 删除提示
/// </summary>
/// <returns></returns>
private string GetDeleteScript()
{
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, Grid1.GetDeleteSelectedRowsReference(), String.Empty);
}
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
string itemId = string.Empty;
if (e.CommandName == "PhotoUrl")
{
itemId = Grid1.DataKeys[e.RowIndex][0].ToString() + "_1";
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
"../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/InspectionItem&menuId={1}", itemId,
BLL.Const.ProjectSafetyInspectionMenuId)));
this.PhotoUrl = itemId;
}
else if (e.CommandName == "VideoUrl")
{
itemId = Grid1.DataKeys[e.RowIndex][0].ToString() + "_2";
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
"../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/InspectionItem&menuId={1}",
itemId + "_2", BLL.Const.ProjectSafetyInspectionMenuId)));
this.VideoUrl = itemId;
}
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PreDataBound(object sender, EventArgs e)
{
// 设置LinkButtonField的点击客户端事件
LinkButtonField deleteField = Grid1.FindColumn("Delete") as LinkButtonField;
deleteField.OnClientClick = GetDeleteScript();
}
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
}
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
this.SaveData(Const.BtnSave);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
#region
/// <summary>
/// 保存数据
/// </summary>
/// <param name="type"></param>
private void SaveData(string type)
{
var register = Inspect_InspectionService.GetInspectionByInspectionId(this.InspectionId);
// if (register.States != "1")
// {
List<string> ids = new List<string>();
List<Model.Inspect_InspectionItem> list = Inspect_InspectionService.GetInspectItemsByInspectionId(this.InspectionId);
list.ForEach(item => { ids.Add(item.InspectionItemId); });
Model.Inspect_InspectionItem InspectionItem;
JArray data = Grid1.GetMergedData();
if (data.Count > 0)
{
foreach (var item in data)
{
JObject values = item.Value<JObject>("values");
string id = item.Value<string>("id");
if (!ids.Contains(id))
{
InspectionItem = new Model.Inspect_InspectionItem
{
InspectionItemId = id,
InspectionId = this.InspectionId,
ProjectId = this.ProjectId,
States = "1",
};
}
else
{
InspectionItem=Inspect_InspectionService.GetInspectItemsById(id);
}
if (!string.IsNullOrEmpty(values.Value<string>("InspectionDescribe")))
{
InspectionItem.InspectionDescribe = values.Value<string>("InspectionDescribe");
}
var file = AttachFileService.GetAttachFile(id + "_1", BLL.Const.ProjectSafetyInspectionMenuId);
if (file != null)
{
InspectionItem.PhotoUrl = file.AttachUrl.Trim();
}
var file1 = AttachFileService.GetAttachFile(id + "_2", BLL.Const.ProjectSafetyInspectionMenuId);
if (file1 != null)
{
InspectionItem.VideoUrl = file1.AttachUrl.Trim();
}
if (string.IsNullOrEmpty(InspectionItem.PhotoUrl) &&
string.IsNullOrEmpty(InspectionItem.VideoUrl) &&
string.IsNullOrEmpty(InspectionItem.InspectionDescribe))
{
ShowNotify("注意其中有检查项、图片、视频全是空!", MessageBoxIcon.Warning);
return;
}
if (!ids.Contains(id))
{
Inspect_InspectionService.AddInspectionItem(InspectionItem);
}
else
{
Inspect_InspectionService.UpdateInspectionItem(InspectionItem);
}
ids.Remove(id);
}
}
//删除多余数据
foreach (var id in ids)
{
Inspect_InspectionService.DeleteInspectItemsById(id);
}
List<Model.Inspect_InspectionItem> arr = Inspect_InspectionService.GetInspectItemsByInspectionId(this.InspectionId);
int EvaluateResultsCount = 0; // 初始化计数器
int StatesCount = 0; // 初始化计数器
if (int.Parse(register.States) > 2 && arr.Count > 0)
{
arr.ForEach(item =>
{
if (item.EvaluateResults == "不合格")
{
EvaluateResultsCount++;
}
if (item.States == "3")
{
StatesCount++;
}
});
if (EvaluateResultsCount == StatesCount)
{
Inspect_InspectionService.UpdateInspectionStates(this.InspectionId,"4");
}
}
else
{
Inspect_InspectionService.UpdateInspectionStates(this.InspectionId,"2");
}
// }
// else
// {
// //全删
// Inspect_InspectionService.DeleteInspectionItemsByInspectionId(this.InspectionId);
//
// //新增 从Grid中获取数据
// JArray data = Grid1.GetMergedData();
// if (data.Count > 0)
// {
// foreach (var item in data)
// {
// JObject values = item.Value<JObject>("values");
// string id = item.Value<string>("id");
// Model.Inspect_InspectionItem InspectionItem = new Model.Inspect_InspectionItem
// {
// InspectionItemId = id,
// InspectionId = this.InspectionId,
// ProjectId = this.ProjectId,
// States = "1",
// };
// if (!string.IsNullOrEmpty(values.Value<string>("InspectionDescribe")))
// {
// InspectionItem.InspectionDescribe = values.Value<string>("InspectionDescribe");
// }
//
// var file = AttachFileService.GetAttachFile(id + "_1", BLL.Const.ProjectSafetyInspectionMenuId);
// if (file != null)
// {
// InspectionItem.PhotoUrl = file.AttachUrl.Trim();
// }
//
// var file1 = AttachFileService.GetAttachFile(id + "_2", BLL.Const.ProjectSafetyInspectionMenuId);
// if (file1 != null)
// {
// InspectionItem.VideoUrl = file1.AttachUrl.Trim();
// }
//
// if (string.IsNullOrEmpty(InspectionItem.PhotoUrl) &&
// string.IsNullOrEmpty(InspectionItem.VideoUrl) &&
// string.IsNullOrEmpty(InspectionItem.InspectionDescribe))
// {
// ShowNotify("注意其中有检查项、图片、视频全是空!", MessageBoxIcon.Warning);
// return;
// }
//
// Inspect_InspectionService.AddInspectionItem(InspectionItem);
// }
//
// //改主表状态为待评价
// Inspect_InspectionService.UpdateInspectionStates(this.InspectionId, "2");
// }
// }
}
#endregion
/// <summary>
/// 提交按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSubmit_Click(object sender, EventArgs e)
{
}
/// <summary>
/// 获取图片(放于Img中)
/// </summary>
/// <param name="registrationId"></param>
/// <returns></returns>
protected string ConvertImageUrlByImage(object registrationId)
{
string url = string.Empty;
if (registrationId != null)
{
var registration = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(registrationId.ToString());
if (registration != null)
{
url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["CEMS_IMG_URL"], registration.ImageUrl);
}
}
return url;
}
protected void drpPersonResponsible_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpPersonResponsible.SelectedValueArray = Funs.RemoveDropDownListNull(this.drpPersonResponsible.SelectedValueArray);
}
protected void btnRectify_Click(object sender, EventArgs e)
{
//获取当前数据的明细
var register = Inspect_InspectionService.GetInspectItemsById(this.Grid1.SelectedRowID);
if (register.EvaluateResults == "合格")
{
Alert.ShowInTop("当前项已合格,无需整改!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectSafetyInspectionRectify.aspx?InspectionItemId={0}&type={1}", this.Grid1.SelectedRowID,'0', "编辑 - ")));
}
protected void btnShow_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectSafetyInspectionRectify.aspx?InspectionItemId={0}&type={1}", this.Grid1.SelectedRowID,'1', "查看 - ")));
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
ShowNotify("操作成功!", MessageBoxIcon.Success);
}
}
}

View File

@ -0,0 +1,197 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class ProjectSafetyInspectionEdit
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtInspectionCode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtInspectionCode;
/// <summary>
/// txtDescription control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextArea txtDescription;
/// <summary>
/// drpPersonResponsible control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList drpPersonResponsible;
/// <summary>
/// dpkInspectTime control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DatePicker dpkInspectTime;
/// <summary>
/// btnNew control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// Grid1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// txtInspectionDescribe control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtInspectionDescribe;
/// <summary>
/// Toolbar1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// lbTemp control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Label lbTemp;
/// <summary>
/// ToolbarFill1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// WindowAtt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
/// <summary>
/// Window1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Menu1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuRectify control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuRectify;
/// <summary>
/// btnMenuShow control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuShow;
}
}

View File

@ -0,0 +1,89 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectSafetyInspectionRectify.aspx.cs" Inherits="FineUIPro.Web.OfficeCheck.Inspect.ProjectSafetyInspectionRectify" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>安全专检</title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="txtInspectionDescribe" runat="server" Label="检查项" Readonly="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:LinkButton ID="UploadPhoto" runat="server" Label="图片" Text="查看" OnClick="btnPhotoUrl_Click" LabelAlign="Right">
</f:LinkButton>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:LinkButton ID="UploadVideo" runat="server" Label="视频" Text="查看" OnClick="btnVideoUrl_Click" LabelAlign="Right">
</f:LinkButton>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtCheckManName" runat="server" Label="检查人" Readonly="true">
</f:TextBox>
<f:TextBox ID="txtEvaluateResults" runat="server" Label="评价结果" Readonly="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtResponsibleManName" runat="server" Label="责任人" Readonly="true">
</f:TextBox>
<f:TextBox ID="txtTimeLimited" runat="server" Label="限时日期" Readonly="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRectificationDescription" runat="server" Label="整改描述" Readonly="true">
</f:TextArea>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:LinkButton ID="UploadRectificationPhoto" ShowRedStar="True" runat="server" Label="整改后照片" Text="上传和查看" OnClick="btnAttachUrlR_Click" LabelAlign="Right">
</f:LinkButton>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</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>
<f:Window ID="Window1" Title="文件上传" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="680px"
Height="480px">
</f:Window>
</form>
</body>
</html>

View File

@ -0,0 +1,234 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using BLL.OfficeCheck.Inspect;
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class ProjectSafetyInspectionRectify : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
private string InspectionItemId
{
get
{
return (string)ViewState["InspectionItemId"];
}
set
{
ViewState["InspectionItemId"] = value;
}
}
/// <summary>
/// 责任人
/// </summary>
public string PersonResponsible
{
get
{
return (string)ViewState["PersonResponsible"];
}
set
{
ViewState["PersonResponsible"] = value;
}
}
/// <summary>
/// 类型
/// </summary>
public string type
{
get
{
return (string)ViewState["type"];
}
set
{
ViewState["type"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
this.InspectionItemId = Request.QueryString["InspectionItemId"];
this.type = Request.QueryString["type"];
if (this.type == "1")
{
this.btnSave.Hidden = true;
}
if (!string.IsNullOrEmpty(this.InspectionItemId))
{
var registration = (from x in Funs.DB.Inspect_InspectionItem
join y in Funs.DB.Inspect_Inspection on x.InspectionId equals y.InspectionId into inspection
from inspectionJoin in inspection.DefaultIfEmpty()
where x.InspectionItemId == this.InspectionItemId
select new
{
x.InspectionItemId,
x.InspectionDescribe,
x.PhotoUrl,
x.VideoUrl,
inspectionJoin.PersonResponsible,
x.EvaluateResults,
inspectionJoin.InspectMan,
x.TimeLimited,
x.RectificationDescription
}).FirstOrDefault();
if (registration != null)
{
this.txtInspectionDescribe.Text = registration.InspectionDescribe;
// this.UploadPhoto.Text = registration.PhotoUrl;
// this.UploadVideo.Text = registration.VideoUrl;
if (registration.InspectMan != null)
{
//查询用户名
var user = (from x in Funs.DB.Sys_User
where x.UserId == registration.InspectMan
select new { x.UserName }).FirstOrDefault();
if (user != null)
{
this.txtCheckManName.Text = user.UserName;
}
}
this.txtEvaluateResults.Text = registration.EvaluateResults;
if (registration.PersonResponsible != null)
{
//查询用户名
var user = (from x in Funs.DB.Sys_User
where x.UserId == registration.PersonResponsible
select new { x.UserName }).FirstOrDefault();
if (user != null)
{
this.txtResponsibleManName.Text = user.UserName;
}
}
if (registration.TimeLimited != null)
{
this.txtTimeLimited.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", registration.TimeLimited);
}
this.txtRectificationDescription.Text = registration.RectificationDescription;
this.PersonResponsible = registration.PersonResponsible;
}
}
}
}
#endregion
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(this.PersonResponsible) && this.PersonResponsible == this.CurrUser.UserId)
{
SaveData(true);
}
else
{
Alert.ShowInTop("您不是当前责任人,无法整改!", MessageBoxIcon.Warning);
return;
}
}
/// <summary>
/// 保存数据
/// </summary>
/// <param name="p"></param>
private void SaveData(bool isClosed)
{
var register = Inspect_InspectionService.GetInspectItemsById(this.InspectionItemId);
if (register != null)
{
var file = AttachFileService.GetAttachFile(register.InspectionItemId + "_3", BLL.Const.ProjectSafetyInspectionMenuId);
if (file != null && file.AttachUrl != "")
{
register.States = "3"; //已整改待复查
register.RectificationPhotoUrl = file.AttachUrl.Trim();
}
else
{
ShowNotify("请先上传整改后照片!", MessageBoxIcon.Warning);
return;
}
Inspect_InspectionService.UpdateInspectionItem(register);
if (isClosed)
{
if (string.IsNullOrEmpty(Request.Params["Main"]))
{
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
PageContext.RegisterStartupScript(String.Format("window.close();"));
}
}
}
}
#endregion
#region
/// <summary>
/// 附件查看
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnPhotoUrl_Click(object sender, EventArgs e)
{
var itemId = this.InspectionItemId + "_1";
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
"../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/InspectionItem&menuId={1}", itemId,
BLL.Const.ProjectSafetyInspectionMenuId)));
}
protected void btnVideoUrl_Click(object sender, EventArgs e)
{
var itemId = this.InspectionItemId + "_2";
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
"../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/InspectionItem&menuId={1}", itemId,
BLL.Const.ProjectSafetyInspectionMenuId)));
}
#endregion
#region
/// <summary>
/// 附件上传
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttachUrlR_Click(object sender, EventArgs e)
{
var itemId = this.InspectionItemId + "_3";
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format(
"../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/InspectionItem&menuId={1}", itemId,
BLL.Const.ProjectSafetyInspectionMenuId)));
}
#endregion
}
}

View File

@ -0,0 +1,179 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class ProjectSafetyInspectionRectify
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtInspectionDescribe control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtInspectionDescribe;
/// <summary>
/// UploadPhoto control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.LinkButton UploadPhoto;
/// <summary>
/// UploadVideo control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.LinkButton UploadVideo;
/// <summary>
/// txtCheckManName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtCheckManName;
/// <summary>
/// txtEvaluateResults control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtEvaluateResults;
/// <summary>
/// txtResponsibleManName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtResponsibleManName;
/// <summary>
/// txtTimeLimited control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtTimeLimited;
/// <summary>
/// txtRectificationDescription control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextArea txtRectificationDescription;
/// <summary>
/// UploadRectificationPhoto control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.LinkButton UploadRectificationPhoto;
/// <summary>
/// Toolbar1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// ToolbarFill1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// WindowAtt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
/// <summary>
/// Window1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window1;
}
}

View File

@ -0,0 +1,16 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityInspection.aspx.cs" Inherits="FineUIPro.Web.OfficeCheck.Inspect.QualityInspection" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class QualityInspection : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}

View File

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

View File

@ -0,0 +1,162 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyInspection.aspx.cs" Inherits="FineUIPro.Web.OfficeCheck.Inspect.SafetyInspection" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="RegionPanel1" runat="server"/>
<f:RegionPanel ID="RegionPanel1" ShowBorder="false" runat="server" Margin="5px">
<Regions>
<f:Region ID="Region1" ShowBorder="false" ShowHeader="false" RegionPosition="Left"
Title="安全专检" BodyPadding="0 5 0 0" Width="300px" Layout="Fit" runat="server"
EnableCollapse="true" Height="1200px">
<Items>
<f:Panel runat="server" ID="panel2" RegionPosition="Left" RegionSplit="true" EnableCollapse="true"
Width="400" Title="安全专检" TitleToolTip="安全专检" ShowBorder="true" ShowHeader="true"
BodyPadding="5px" IconFont="ArrowCircleLeft" Height="1200px" AutoScroll="true">
<Items>
<f:Tree ID="trProjects" Width="290" ShowHeader="true"
OnNodeCommand="trProjects_NodeCommand" AutoLeafIdentification="true"
runat="server">
</f:Tree>
<f:HiddenField runat="server" ID="hdSelectId">
</f:HiddenField>
</Items>
</f:Panel>
</Items>
</f:Region>
<f:Region ID="Region2" ShowBorder="false" ShowHeader="false" Position="Center" Layout="VBox"
BoxConfigAlign="Stretch" BoxConfigPosition="Left" runat="server">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="安全专检" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="InspectionId" EnableColumnLines="true"
DataIDField="InspectionId" AllowSorting="true" ForceFit="true"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox runat="server" Label="责任人" ID="txtPersonResponsible" EmptyText="输入查询条件" AutoPostBack="true"
OnTextChanged="TextBox_TextChanged" LabelAlign="right" Width="210px" LabelWidth="80px">
</f:TextBox>
<f:DatePicker ID="txtStartTime" runat="server" Label="检查时间" LabelAlign="Right"
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="200px" LabelWidth="80px">
</f:DatePicker>
<f:Label ID="Label3" runat="server" Text="至">
</f:Label>
<f:DatePicker ID="txtEndTime" runat="server" AutoPostBack="true" OnTextChanged="TextBox_TextChanged"
Width="130px">
</f:DatePicker>
<%-- <f:RadioButtonList runat="server" ID="rbStates" Width="280px" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged"> --%>
<%-- <f:RadioItem Text="全部" Value="-1" Selected="true"/> --%>
<%-- <f:RadioItem Text="待提交" Value="0"/> --%>
<%-- <f:RadioItem Text="待整改" Value="1"/> --%>
<%-- <f:RadioItem Text="已完成" Value="2"/> --%>
<%-- </f:RadioButtonList> --%>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<%-- <f:RadioButtonList ID="rbOutType" Label="导出格式" runat="server"> --%>
<%-- <f:RadioItem Text="无图" Value="0" Selected="true"/> --%>
<%-- <f:RadioItem Text="有图" Value="1"/> --%>
<%-- </f:RadioButtonList> --%>
<f:Button ID="btnNew" Icon="Add" runat="server" OnClick="btnNew_Click" ToolTip="新增">
</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:TemplateField ColumnID="tfNumber" Width="100px" HeaderText="序号" HeaderTextAlign="Center"
TextAlign="Center">
<ItemTemplate>
<asp:Label ID="labNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="200px" ColumnID="InspectionCode" DataField="InspectionCode"
SortField="InspectionCode" FieldType="String" HeaderText="编号" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="800px" ColumnID="Description" DataField="Description"
SortField="Description" FieldType="String" HeaderText="描述" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="PersonResponsible" DataField="PersonResponsible"
SortField="PersonResponsible" FieldType="String" HeaderText="责任人" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="InspectTime" DataField="InspectTime" SortField="InspectTime"
FieldType="Date" Renderer="Date" HeaderText="检查日期" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField ColumnID="States" DataField="States"
SortField="States" FieldType="String" HeaderText="状态" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
</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:Region>
</Regions>
</f:RegionPanel>
<f:Window ID="Window1" runat="server" Hidden="true" ShowHeader="true"
IsModal="true" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window1_Close"
Title="编辑" EnableIFrame="true" Height="500px"
Width="900px">
</f:Window>
<f:Window ID="Window2" Title="导入" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Top" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
Width="700px" Height="560px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnEdit_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="编辑" Icon="TableEdit">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnDelete_Click" EnablePostBack="true" Icon="Delete"
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/jscript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
</html>

View File

@ -0,0 +1,363 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Newtonsoft.Json.Linq;
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class SafetyInspection : PageBase
{
public Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
GetButtonPower();
Funs.DropDownPageSize(this.ddlPageSize);
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
InitTreeMenu();
}
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (this.CurrUser != null)
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SafetyInspectionMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuEdit.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
//this.btnDelete.Hidden = false;
this.btnMenuDelete.Hidden = false;
}
}
}
}
#endregion
#region
/// <summary>
/// 加载树
/// </summary>
private void InitTreeMenu()
{
this.trProjects.Nodes.Clear();
this.trProjects.ShowBorder = false;
this.trProjects.ShowHeader = false;
this.trProjects.EnableIcons = true;
this.trProjects.AutoScroll = true;
this.trProjects.EnableSingleClickExpand = true;
//默认加载
TreeNode node = new TreeNode();
node.Text = "全部";
node.NodeID = "1";
node.CommandName = "all";
node.EnableClickEvent = true;
node.EnableExpandEvent = true;
node.Expanded = true;
this.trProjects.Nodes.Add(node);
var list = BLL.ProjectService.GetProjectWorkList();
if (list.Count() > 0)
{
foreach (var item in list)
{
var Snode = new TreeNode();
Snode.Text = item.ProjectName;
Snode.NodeID = item.ProjectId;
Snode.CommandName = "parent";
Snode.EnableClickEvent = true;
Snode.EnableExpandEvent = true;
Snode.Expanded = true;
node.Nodes.Add(Snode);
}
}
}
#endregion
#region Tree点击事件
/// <summary>
/// Tree点击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void trProjects_NodeCommand(object sender, TreeCommandEventArgs e)
{
this.BindGrid();
}
#endregion
#region
private void BindGrid()
{
string strSql =
@"select Inspection.InspectionId,Inspection.InspectionCode,Inspection.ProjectId,b.UserName as PersonResponsible,Inspection.InspectTime,Inspection.Description,"
+ @" (CASE WHEN Inspection.States ='1' THEN '待整改'
WHEN Inspection.States ='2' THEN ''
WHEN Inspection.States ='3' THEN ''
WHEN Inspection.States ='4' THEN ''
WHEN Inspection.States ='5' THEN ''
ELSE '' END) AS States, "
+ @" c.UserName as InspectMan,Inspection.InspectType,Inspection.InspectItemSetId from Inspect_Inspection Inspection left join Sys_User b on Inspection.PersonResponsible = b.UserID left join Sys_User c on Inspection.InspectMan = c.UserID where Inspection.InspectType='1' ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (this.trProjects.SelectedNode != null)
{
strSql += " AND Inspection.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.trProjects.SelectedNode.NodeID));
}
if (!string.IsNullOrEmpty(txtPersonResponsible.Text.Trim()))
{
strSql += " AND b.UserName like @PersonResponsible";
listStr.Add(new SqlParameter("@PersonResponsible", "%" + txtPersonResponsible.Text.Trim() + "%"));
}
// if (this.rbStates.SelectedValue!="-1")
// {
// strSql += " AND Inspection.States = @States";
// listStr.Add(new SqlParameter("@States", this.rbStates.SelectedValue));
// }
if (!string.IsNullOrEmpty(this.txtStartTime.Text.Trim()))
{
strSql += " AND Inspection.InspectTime >= @StartTime";
listStr.Add(new SqlParameter("@StartTime", this.txtStartTime.Text.Trim()));
}
if (!string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
{
strSql += " AND Inspection.InspectTime <= @EndTime";
listStr.Add(new SqlParameter("@EndTime", this.txtEndTime.Text.Trim()));
}
strSql += " order by Inspection.InspectTime desc";
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
//if (tb != null)
//{
// foreach (DataRow row in tb.Rows)
// {
// if (!string.IsNullOrEmpty(row["InspectionCode"].ToString()))
// {
// row["index"] = int.Parse(System.Text.RegularExpressions.Regex.Replace(row["InspectionCode"].ToString(), @"[^0-9]+", ""));
// }
// }
//}
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region
/// <summary>
/// 关闭窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
ShowNotify("操作成功!", MessageBoxIcon.Success);
this.BindGrid();
}
protected void Window2_Close(object sender, WindowCloseEventArgs e)
{
ShowNotify("增加成功!", MessageBoxIcon.Success);
this.BindGrid();
}
#endregion
#region
protected void btnNew_Click(object sender, EventArgs e) {
if (trProjects.SelectedNode==null)
{
ShowNotify("请选择子节点进行添加!", MessageBoxIcon.Warning);
return;
}
if (trProjects.SelectedNode.CommandName == "parent")
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyInspectionEdit.aspx?ProjectId={0}",trProjects.SelectedNode.NodeID ,"增加 - ")));
}
else {
ShowNotify("请选择子节点进行添加!", MessageBoxIcon.Warning);
}
}
#endregion
/// <summary>
/// 编辑按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnEdit_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
Debug.WriteLine(this.Grid1.SelectedRowID);
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyInspectionEdit.aspx?InspectionId={0}", this.Grid1.SelectedRowID, "编辑 - ")));
}
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
this.btnEdit_Click(null, null);
}
/// <summary>
/// 批量删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
BLL.OfficeCheck.Inspect.Inspect_InspectionService.DeleteInspectionById(rowID);
}
BindGrid();
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
}
}
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string name = this.trProjects.SelectedNode.Text;
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode(name + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Grid1.PageSize = this.Grid1.RecordCount;
this.BindGrid();
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(this.txtStartTime.Text.Trim()) && !string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
{
if (Funs.GetNewDateTime(this.txtStartTime.Text.Trim()) > Funs.GetNewDateTime(this.txtEndTime.Text.Trim()))
{
Alert.ShowInTop("开始时间不能大于结束时间!", MessageBoxIcon.Warning);
return;
}
}
this.BindGrid();
}
#endregion
#region GV
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
this.Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
this.BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
this.Grid1.SortDirection = e.SortDirection;
this.Grid1.SortField = e.SortField;
this.BindGrid();
}
/// <summary>
/// 分页显示条数下拉框
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
this.Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
this.BindGrid();
}
#endregion
}
}

View File

@ -0,0 +1,242 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class SafetyInspection
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// RegionPanel1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.RegionPanel RegionPanel1;
/// <summary>
/// Region1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Region Region1;
/// <summary>
/// panel2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Panel panel2;
/// <summary>
/// trProjects control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Tree trProjects;
/// <summary>
/// hdSelectId control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.HiddenField hdSelectId;
/// <summary>
/// Region2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Region Region2;
/// <summary>
/// Grid1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// txtPersonResponsible control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtPersonResponsible;
/// <summary>
/// txtStartTime control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DatePicker txtStartTime;
/// <summary>
/// Label3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Label Label3;
/// <summary>
/// txtEndTime control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DatePicker txtEndTime;
/// <summary>
/// btnNew control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnOut control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// labNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label labNumber;
/// <summary>
/// ToolbarSeparator1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Menu1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuDelete control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDelete;
}
}

View File

@ -0,0 +1,159 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyInspectionEdit.aspx.cs" Inherits="FineUIPro.Web.OfficeCheck.Inspect.SafetyInspectionEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>编辑安全专检</title>
<link href="~/res/css/common.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server"/>
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow ColumnWidths="50%">
<Items>
<f:TextBox ID="txtInspectionCode" runat="server" Label="编号" MaxLength="50">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="50%">
<Items>
<f:TextArea ID="txtDescription" runat="server" Label="描述" MaxLength="2000"></f:TextArea>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="50%">
<Items>
<f:DropDownList ID="drpPersonResponsible" runat="server" Label="责任人" EnableEdit="true" EnableMultiSelect="False"
ForceSelection="false" MaxLength="100" EnableCheckBoxSelect="true" OnSelectedIndexChanged="drpPersonResponsible_SelectedIndexChanged"
AutoPostBack="true">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="50%">
<Items>
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="检查日期" ID="dpkInspectTime" EnableEdit="false">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" runat="server" DataIDField="InspectionItemId"
DataKeyNames="InspectionItemId" ShowGridHeader="true" SortDirection="ASC" OnRowCommand="Grid1_RowCommand"
MinHeight="350px" AllowCellEditing="true" ClicksToEdit="1" AllowSorting="true" EnableColumnLines="true" OnPreDataBound="Grid1_PreDataBound"
EnableTextSelection="True" OnSort="Grid1_Sort">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
TextAlign="Center"/>
<f:RenderField Width="300px" ColumnID="InspectionDescribe" DataField="InspectionDescribe"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="检查项">
</f:RenderField>
<f:LinkButtonField Width="200px" HeaderText="图片" ConfirmTarget="Top" CommandName="PhotoUrl"
TextAlign="Center" ToolTip="查看" Text="查看"/>
<f:LinkButtonField Width="200px" HeaderText="视频" ConfirmTarget="Top" CommandName="VideoUrl"
TextAlign="Center" ToolTip="查看" Text="查看"/>
<f:RenderField Width="200px" ColumnID="EvaluateResults" DataField="EvaluateResults" FieldType="String"
HeaderTextAlign="Center" TextAlign="Left" HeaderText="评价结果" Locked="True">
<Editor>
<f:DropDownList ID="ddlEvaluateResults" runat="server" AutoPostBack="True" OnSelectedIndexChanged="drpddlEvaluateResults">
<f:ListItem Text="合格" Value="合格"/>
<f:ListItem Text="不合格" Value="不合格"/>
</f:DropDownList>
</Editor>
</f:RenderField>
<f:RenderField Width="200px" ColumnID="TimeLimited" DataField="TimeLimited" FieldType="Date"
Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="限时日期" TextAlign="Center">
<Editor>
<f:DatePicker ID="dpTimeLimited" runat="server">
</f:DatePicker>
</Editor>
</f:RenderField>
<f:RenderField Width="300px" ColumnID="RectificationDescription" DataField="RectificationDescription"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="整改描述">
<Editor>
<f:TextBox ID="txtRectificationDescription" runat="server" ShowRedStar="true">
</f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField Width="200px" ColumnID="RectificationResults" DataField="RectificationResults" FieldType="String"
HeaderTextAlign="Center" TextAlign="Left" HeaderText="整改结果">
</f:RenderField>
<f:RenderField ColumnID="States" DataField="States"
SortField="States" FieldType="String" HeaderText="状态" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
<%-- <f:LinkButtonField ColumnID="Delete" Width="100px" EnablePostBack="false" Icon="Delete" --%>
<%-- HeaderTextAlign="Center" HeaderText="删除" TextAlign="Center"/> --%>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu"/>
</Listeners>
</f:Grid>
</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" ToolTip="保存" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<%-- <f:Button ID="btnSubmit" Icon="SystemSaveNew" runat="server" ToolTip="提交" ValidateForms="SimpleForm1" --%>
<%-- OnClick="btnSubmit_Click"> --%>
<%-- </f:Button> --%>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Window ID="Window1" runat="server" Hidden="true" ShowHeader="true"
IsModal="true" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window1_Close"
Title="复查" EnableIFrame="true" Height="500px"
Width="900px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuRectify" OnClick="btnRectify_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="复查" Icon="TableEdit">
</f:MenuButton>
<f:MenuButton ID="btnMenuShow" OnClick="btnShow_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="查看" Icon="ApplicationViewIcons">
</f:MenuButton>
</f:Menu>
</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>
<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,421 @@
using BLL;
using Model;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using BLL.OfficeCheck.Inspect;
using NPOI.SS.Formula.Functions;
using System.Data.SqlClient;
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class SafetyInspectionEdit : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
public string InspectionId
{
get
{
return (string)ViewState["InspectionId"];
}
set
{
ViewState["InspectionId"] = value;
}
}
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
public string PhotoUrl
{
get
{
return (string)ViewState["PhotoUrl"];
}
set
{
ViewState["PhotoUrl"] = value;
}
}
public string VideoUrl
{
get
{
return (string)ViewState["VideoUrl"];
}
set
{
ViewState["VideoUrl"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
this.btnMenuRectify.Hidden = false;
this.btnMenuShow.Hidden = false;
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
this.ProjectId = Request.Params["ProjectId"];
UserService.InitUserDropDownList(this.drpPersonResponsible, this.ProjectId, true);
this.dpkInspectTime.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
BindGrid();
}
}
#endregion
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
this.InspectionId = Request.Params["InspectionId"];
var Inspection = Inspect_InspectionService.GetInspectionByInspectionId(this.InspectionId);
if (Inspection != null)
{
this.ProjectId = Inspection.ProjectId;
if (this.ProjectId != this.CurrUser.LoginProjectId)
{
this.InitDropDownList();
}
txtInspectionCode.Text = Inspection.InspectionCode;
txtDescription.Text = Inspection.Description;
this.drpPersonResponsible.SelectedValue = Inspection.PersonResponsible;
if (Inspection.InspectTime != null)
{
this.dpkInspectTime.Text = string.Format("{0:yyyy-MM-dd}", Inspection.InspectTime);
}
//获取明细
string strSql =
@"select item.InspectionItemId,item.InspectionId,item.InspectionDescribe,item.PhotoUrl,item.VideoUrl,item.EvaluateResults,item.TimeLimited,item.RectificationDescription,"
+ @" (CASE WHEN item.RectificationResults ='1' THEN '同意'
WHEN item.RectificationResults ='2' THEN ''
ELSE '' END) AS RectificationResults, "
+ @" (CASE WHEN item.States ='1' THEN '待评价'
WHEN item.States ='2' THEN ''
WHEN item.States ='3' THEN ''
WHEN item.States ='5' THEN ''
ELSE '' END) AS States, "
+ @" item.CompileMan ,item.CompileTime,item.RectificationPhotoUrl from Inspect_InspectionItem item where 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.InspectionId))
{
strSql += " AND item.InspectionId = @InspectionId";
listStr.Add(new SqlParameter("@InspectionId", this.InspectionId));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
else
{
////自动生成编码
this.dpkInspectTime.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
}
var val = Inspect_InspectionService.GetInspectionByInspectionId(this.InspectionId);
if (val.States == "5")
{
this.btnSave.Hidden = true;
}
}
/// <summary>
/// 初始化下拉框
/// </summary>
private void InitDropDownList()
{
//检查组成员
UserService.InitUserDropDownList(this.drpPersonResponsible, this.ProjectId, true);
}
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
string itemId = string.Empty;
if (e.CommandName == "PhotoUrl")
{
itemId = Grid1.DataKeys[e.RowIndex][0].ToString() + "_1";
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
"../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/InspectionItem&menuId={1}", itemId,
BLL.Const.ProjectSafetyInspectionMenuId)));
this.PhotoUrl = itemId;
}
else if (e.CommandName == "VideoUrl")
{
itemId = Grid1.DataKeys[e.RowIndex][0].ToString() + "_2";
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
"../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/InspectionItem&menuId={1}",
itemId + "_2", BLL.Const.ProjectSafetyInspectionMenuId)));
this.VideoUrl = itemId;
}
}
/// <summary>
/// 点击客户端事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PreDataBound(object sender, EventArgs e)
{
// 设置LinkButtonField的点击客户端事件
LinkButtonField deleteField = Grid1.FindColumn("Delete") as LinkButtonField;
}
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
}
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
this.SaveData(Const.BtnSave);
}
#region
/// <summary>
/// 保存数据
/// </summary>
/// <param name="type"></param>
private void SaveData(string type)
{
Model.Inspect_Inspection inspection = new Inspect_Inspection();
//主表数据赋值
if (!string.IsNullOrEmpty(this.txtInspectionCode.Text.Trim()))
{
inspection.InspectionCode = this.txtInspectionCode.Text.Trim();
}
if (!string.IsNullOrEmpty(this.txtDescription.Text.Trim()))
{
inspection.Description = this.txtDescription.Text.Trim();
}
if (this.drpPersonResponsible.SelectedValue != BLL.Const._Null)
{
inspection.PersonResponsible = this.drpPersonResponsible.SelectedValue;
}
if (!string.IsNullOrEmpty(this.dpkInspectTime.Text.Trim()))
{
inspection.InspectTime = DateTime.Parse(this.dpkInspectTime.Text.Trim());
}
//判断是否有主键
if (string.IsNullOrEmpty(this.InspectionId))
{
//新增
inspection.InspectionId = Guid.NewGuid().ToString();
inspection.ProjectId = this.ProjectId;
inspection.InspectType = "1";
inspection.States = "1";
inspection.InspectMan = this.CurrUser.UserId;
inspection.CreateMan = this.CurrUser.UserId;
inspection.CreateTime = DateTime.Now;
Inspect_InspectionService.AddInspection(inspection);
}
var val = Inspect_InspectionService.GetInspectionByInspectionId(this.InspectionId);
//明细数据赋值
JArray data = Grid1.GetMergedData();
//判断是否有明细数据
if (data.Count > 0)
{
foreach (var item in data)
{
JObject values = item.Value<JObject>("values");
string id = item.Value<string>("id");
var InspectItems = Inspect_InspectionService.GetInspectItemsById(id);
if (InspectItems != null)
{
var evaluateResults = values.Value<string>("EvaluateResults");
if (!string.IsNullOrEmpty(evaluateResults))
{
InspectItems.EvaluateResults = evaluateResults.Trim();
if (evaluateResults == "合格")
{
InspectItems.States = "5"; //闭环
}
else if (evaluateResults == "不合格")
{
InspectItems.States = "2"; //已评价
}
}
if (!string.IsNullOrEmpty(values.Value<string>("TimeLimited")))
{
InspectItems.TimeLimited = values.Value<DateTime>("TimeLimited");
}
else
{
InspectItems.TimeLimited = null;
}
if (!string.IsNullOrEmpty(values.Value<string>("RectificationDescription")))
{
//有整改描述 是不合格的复查提交
InspectItems.RectificationDescription =
values.Value<string>("RectificationDescription").Trim();
}
else
{
InspectItems.RectificationDescription = "";
}
// if (!string.IsNullOrEmpty(values.Value<string>("RectificationResults")))
// {
// InspectItems.RectificationResults = values.Value<string>("RectificationResults");
// }
//编辑
Inspect_InspectionService.UpdateInspectionItem(InspectItems);
}
}
// 修改主表状态
var InspectItemsList = Inspect_InspectionService.GetInspectItemsByInspectionId(this.InspectionId);
HashSet<string> list = new HashSet<string>();
foreach (var item in InspectItemsList)
{
list.Add(item.EvaluateResults);
}
if (val.States != "1")
{
var states = "3";
if (list.Count() == 1)
{
if (list.Contains("合格"))
{
states = "5";
}
else if (list.Contains("不合格"))
{
states = "3";
}
else
{
states = "2";
}
}
Inspect_InspectionService.UpdateInspectionStates(this.InspectionId,states);
}
}
else
{
// 修改主表状态
if (!string.IsNullOrEmpty(this.InspectionId))
{
//编辑
inspection.InspectionId = this.InspectionId;
inspection.States = val.States;
Inspect_InspectionService.UpdateInspection(inspection);
}
}
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
/// <summary>
/// 责任人下拉框选择改变事件,去除下拉框中的空值选项。
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpPersonResponsible_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpPersonResponsible.SelectedValueArray = Funs.RemoveDropDownListNull(this.drpPersonResponsible.SelectedValueArray);
}
/// <summary>
/// 责任人下拉框选择改变事件,去除下拉框中的空值选项。
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpddlEvaluateResults(object sender, EventArgs e)
{
if (this.ddlEvaluateResults.SelectedValue == "不合格")
{
//改限时时间
}
else
{
}
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
ShowNotify("操作成功!", MessageBoxIcon.Success);
}
protected void btnRectify_Click(object sender, EventArgs e)
{
//获取当前数据的明细
var register = Inspect_InspectionService.GetInspectItemsById(this.Grid1.SelectedRowID);
if (register.EvaluateResults == "合格")
{
Alert.ShowInTop("当前项已合格,无需整改!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyInspectionRectify.aspx?InspectionItemId={0}&type={1}", this.Grid1.SelectedRowID,'0', "编辑 - ")));
}
protected void btnShow_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyInspectionRectify.aspx?InspectionItemId={0}&type={1}", this.Grid1.SelectedRowID,'1', "查看 - ")));
}
}
}

View File

@ -0,0 +1,206 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class SafetyInspectionEdit
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtInspectionCode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtInspectionCode;
/// <summary>
/// txtDescription control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextArea txtDescription;
/// <summary>
/// drpPersonResponsible control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList drpPersonResponsible;
/// <summary>
/// dpkInspectTime control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DatePicker dpkInspectTime;
/// <summary>
/// Grid1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// ddlEvaluateResults control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList ddlEvaluateResults;
/// <summary>
/// dpTimeLimited control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DatePicker dpTimeLimited;
/// <summary>
/// txtRectificationDescription control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtRectificationDescription;
/// <summary>
/// Toolbar1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// lbTemp control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Label lbTemp;
/// <summary>
/// ToolbarFill1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// Window1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Menu1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuRectify control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuRectify;
/// <summary>
/// btnMenuShow control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuShow;
/// <summary>
/// WindowAtt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}

View File

@ -0,0 +1,94 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyInspectionRectify.aspx.cs" Inherits="FineUIPro.Web.OfficeCheck.Inspect.SafetyInspectionRectify" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>安全专检</title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="txtInspectionDescribe" runat="server" Label="检查项" Readonly="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:LinkButton ID="UploadPhoto" runat="server" Label="图片" Text="查看" OnClick="btnPhotoUrl_Click" LabelAlign="Right">
</f:LinkButton>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:LinkButton ID="UploadVideo" runat="server" Label="视频" Text="查看" OnClick="btnVideoUrl_Click" LabelAlign="Right">
</f:LinkButton>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtCheckManName" runat="server" Label="检查人" Readonly="true">
</f:TextBox>
<f:TextBox ID="txtEvaluateResults" runat="server" Label="评价结果" Readonly="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtResponsibleManName" runat="server" Label="责任人" Readonly="true">
</f:TextBox>
<f:TextBox ID="txtTimeLimited" runat="server" Label="限时日期" Readonly="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRectificationDescription" runat="server" Label="整改描述" Readonly="true">
</f:TextArea>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:LinkButton ID="UploadRectificationPhoto" ShowRedStar="True" runat="server" Label="整改后照片" Text="上传和查看" OnClick="btnAttachUrlR_Click" LabelAlign="Right">
</f:LinkButton>
<f:DropDownList ID="ddlRectificationResults" runat="server" Label="整改结果" LabelAlign="Right">
<f:ListItem Value="1" Text="同意" Selected="true"/>
<f:ListItem Value="2" Text="不同意"/>
</f:DropDownList>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</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>
<f:Window ID="Window1" Title="文件上传" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="680px"
Height="480px">
</f:Window>
</form>
</body>
</html>

View File

@ -0,0 +1,226 @@
using System;
using System.Linq;
using BLL;
using BLL.OfficeCheck.Inspect;
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class SafetyInspectionRectify : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
private string InspectionItemId
{
get
{
return (string)ViewState["InspectionItemId"];
}
set
{
ViewState["InspectionItemId"] = value;
}
}
/// <summary>
/// 检查人
/// </summary>
public string InspectMan
{
get
{
return (string)ViewState["InspectMan"];
}
set
{
ViewState["InspectMan"] = value;
}
}
/// <summary>
/// 类型
/// </summary>
public string type
{
get
{
return (string)ViewState["type"];
}
set
{
ViewState["type"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
this.InspectionItemId = Request.QueryString["InspectionItemId"];
this.type = Request.QueryString["type"];
if (this.type == "1")
{
this.btnSave.Hidden = true;
}
if (!string.IsNullOrEmpty(this.InspectionItemId))
{
var registration = (from x in Funs.DB.Inspect_InspectionItem
join y in Funs.DB.Inspect_Inspection on x.InspectionId equals y.InspectionId into inspection
from inspectionJoin in inspection.DefaultIfEmpty()
where x.InspectionItemId == this.InspectionItemId
select new
{
x.InspectionItemId,
x.InspectionDescribe,
x.PhotoUrl,
x.VideoUrl,
inspectionJoin.PersonResponsible,
x.EvaluateResults,
inspectionJoin.InspectMan,
x.TimeLimited,
x.RectificationDescription
}).FirstOrDefault();
if (registration != null)
{
this.txtInspectionDescribe.Text = registration.InspectionDescribe;
if (registration.InspectMan != null)
{
//查询用户名
var user = (from x in Funs.DB.Sys_User
where x.UserId == registration.InspectMan
select new { x.UserName }).FirstOrDefault();
if (user != null)
{
this.txtCheckManName.Text = user.UserName;
}
}
this.txtEvaluateResults.Text = registration.EvaluateResults;
if (registration.PersonResponsible != null)
{
//查询用户名
var user = (from x in Funs.DB.Sys_User
where x.UserId == registration.PersonResponsible
select new { x.UserName }).FirstOrDefault();
if (user != null)
{
this.txtResponsibleManName.Text = user.UserName;
}
}
if (registration.TimeLimited != null)
{
this.txtTimeLimited.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", registration.TimeLimited);
}
this.txtRectificationDescription.Text = registration.RectificationDescription;
this.InspectMan = registration.InspectMan;
}
}
}
}
#endregion
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(this.InspectMan) && this.InspectMan == this.CurrUser.UserId)
{
SaveData(true);
}
else
{
Alert.ShowInTop("您不是当前检查人,无法审批!", MessageBoxIcon.Warning);
return;
}
}
/// <summary>
/// 保存数据
/// </summary>
/// <param name="p"></param>
private void SaveData(bool isClosed)
{
var register = Inspect_InspectionService.GetInspectItemsById(this.InspectionItemId);
if (register != null)
{
//获取ddlRectificationResults的值
var rectificationResults = this.ddlRectificationResults.SelectedValue;
if (rectificationResults == "1") //同意
{
register.EvaluateResults = "合格";
register.States = "5";
}
else if (rectificationResults == "2") //不同意
{
register.States = "2";
}
register.RectificationResults = rectificationResults;
Inspect_InspectionService.UpdateInspectionItem(register);
if (isClosed)
{
if (string.IsNullOrEmpty(Request.Params["Main"]))
{
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
PageContext.RegisterStartupScript(String.Format("window.close();"));
// PageContext.RegisterStartupScript("openAndClose", "window.open('yourPageUrl', '_blank'); window.close();");
}
}
}
}
#endregion
#region
/// <summary>
/// 附件查看
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnPhotoUrl_Click(object sender, EventArgs e)
{
var itemId = this.InspectionItemId + "_1";
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
"../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/InspectionItem&menuId={1}", itemId,
BLL.Const.ProjectSafetyInspectionMenuId)));
}
protected void btnVideoUrl_Click(object sender, EventArgs e)
{
var itemId = this.InspectionItemId + "_2";
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
"../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/InspectionItem&menuId={1}", itemId,
BLL.Const.ProjectSafetyInspectionMenuId)));
}
#endregion
#region
/// <summary>
/// 附件上传
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttachUrlR_Click(object sender, EventArgs e)
{
var itemId = this.InspectionItemId + "_3";
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format(
"../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/InspectionItem&menuId={1}", itemId,
BLL.Const.ProjectSafetyInspectionMenuId)));
}
#endregion
}
}

View File

@ -0,0 +1,188 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.OfficeCheck.Inspect
{
public partial class SafetyInspectionRectify
{
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtInspectionDescribe control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtInspectionDescribe;
/// <summary>
/// UploadPhoto control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.LinkButton UploadPhoto;
/// <summary>
/// UploadVideo control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.LinkButton UploadVideo;
/// <summary>
/// txtCheckManName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtCheckManName;
/// <summary>
/// txtEvaluateResults control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtEvaluateResults;
/// <summary>
/// txtResponsibleManName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtResponsibleManName;
/// <summary>
/// txtTimeLimited control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextBox txtTimeLimited;
/// <summary>
/// txtRectificationDescription control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.TextArea txtRectificationDescription;
/// <summary>
/// UploadRectificationPhoto control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.LinkButton UploadRectificationPhoto;
/// <summary>
/// ddlRectificationResults control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.DropDownList ddlRectificationResults;
/// <summary>
/// Toolbar1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// ToolbarFill1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// WindowAtt control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
/// <summary>
/// Window1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::FineUIPro.Window Window1;
}
}

View File

@ -228874,7 +228874,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InspectionCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InspectionCode", DbType="NVarChar(50)")]
public string InspectionCode
{
get
@ -229232,6 +229232,8 @@ namespace Model
private System.Nullable<System.DateTime> _CompileTime;
private string _RectificationPhotoUrl;
private EntityRef<Base_Project> _Base_Project;
private EntityRef<Inspect_Inspection> _Inspect_Inspection;
@ -229268,6 +229270,8 @@ namespace Model
partial void OnCompileManChanged();
partial void OnCompileTimeChanging(System.Nullable<System.DateTime> value);
partial void OnCompileTimeChanged();
partial void OnRectificationPhotoUrlChanging(string value);
partial void OnRectificationPhotoUrlChanged();
#endregion
public Inspect_InspectionItem()
@ -229505,7 +229509,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_States", DbType="Char(1)")]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_States", DbType="NVarChar(100)")]
public string States
{
get
@ -229565,6 +229569,26 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectificationPhotoUrl", DbType="NVarChar(1000)")]
public string RectificationPhotoUrl
{
get
{
return this._RectificationPhotoUrl;
}
set
{
if ((this._RectificationPhotoUrl != value))
{
this.OnRectificationPhotoUrlChanging(value);
this.SendPropertyChanging();
this._RectificationPhotoUrl = value;
this.SendPropertyChanged("RectificationPhotoUrl");
this.OnRectificationPhotoUrlChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Inspect_InspectionItem_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
public Base_Project Base_Project
{
@ -427869,6 +427893,10 @@ namespace Model
private string _RegisterTypesName;
private string _RectifyId;
private string _RectifyName;
private string _DIC_ID;
private string _CCManIds;
@ -428665,6 +428693,38 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectifyId", DbType="NVarChar(50)")]
public string RectifyId
{
get
{
return this._RectifyId;
}
set
{
if ((this._RectifyId != value))
{
this._RectifyId = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RectifyName", DbType="VarChar(255)")]
public string RectifyName
{
get
{
return this._RectifyName;
}
set
{
if ((this._RectifyName != value))
{
this._RectifyName = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DIC_ID", DbType="VarChar(60)")]
public string DIC_ID
{
@ -456729,8 +456789,6 @@ namespace Model
private string _Major;
private string _DrawingId;
private string _Part;
private string _ProjectContent;
@ -456859,23 +456917,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DrawingId", DbType="NVarChar(50)")]
public string DrawingId
{
get
{
return this._DrawingId;
}
set
{
if ((this._DrawingId != value))
{
this._DrawingId = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Part", DbType="NVarChar(100)")]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Part", DbType="NVarChar(50)")]
public string Part
{
get
@ -457721,8 +457763,6 @@ namespace Model
private string _WorkTeamId;
private string _Major;
public View_QuantityManagement_WorkTeamStatistics()
{
}
@ -457854,22 +457894,6 @@ namespace Model
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Major", DbType="NVarChar(30)")]
public string Major
{
get
{
return this._Major;
}
set
{
if ((this._Major != value))
{
this._Major = value;
}
}
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_Question_QuestionDBItem")]