不符合项清单基础数据字典(安全问题分类、性质;质量问题分类、性质)
This commit is contained in:
parent
0c0ceebd0f
commit
578085acd1
|
|
@ -137,3 +137,184 @@ GO
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--安全问题性质
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Base_SafetyProblemNature') AND type = N'U')
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[Base_SafetyProblemNature](
|
||||
[NatureId] [nvarchar](50) NOT NULL,
|
||||
[NatureCode] [nvarchar](50) NOT NULL,
|
||||
[NatureName] [nvarchar](100) NOT NULL,
|
||||
CONSTRAINT [PK_Base_SafetyProblemNature] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[NatureId] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemNature', @level2type=N'COLUMN',@level2name=N'NatureId'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemNature', @level2type=N'COLUMN',@level2name=N'NatureCode'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'性质名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemNature', @level2type=N'COLUMN',@level2name=N'NatureName'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'安全问题性质' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemNature'
|
||||
END
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--安全问题性质详细定义
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Base_SafetyProblemNatureItem') AND type = N'U')
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[Base_SafetyProblemNatureItem](
|
||||
[NatureItemId] [nvarchar](50) NOT NULL,
|
||||
[NatureId] [nvarchar](50) NULL,
|
||||
[NatureItemCode] [nvarchar](50) NULL,
|
||||
[NatureItemType] [nvarchar](200) NULL,
|
||||
[NatureItemContent] [nvarchar](max) NULL,
|
||||
[NatureItemDep] [nvarchar](200) NULL,
|
||||
[CompileMan] [nvarchar](50) NULL,
|
||||
[CompileManName] [nvarchar](50) NULL,
|
||||
[CompileDate] [datetime] NULL,
|
||||
CONSTRAINT [PK_Base_SafetyProblemNatureItem] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[NatureItemId] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
ALTER TABLE [dbo].[Base_SafetyProblemNatureItem] WITH CHECK ADD CONSTRAINT [FK_Base_SafetyProblemNatureItem_Nature] FOREIGN KEY([NatureId])
|
||||
REFERENCES [dbo].[Base_SafetyProblemNature] ([NatureId])
|
||||
ALTER TABLE [dbo].[Base_SafetyProblemNatureItem] CHECK CONSTRAINT [FK_Base_SafetyProblemNatureItem_Nature]
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'明细id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemNatureItem', @level2type=N'COLUMN',@level2name=N'NatureItemId'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'性质id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemNatureItem', @level2type=N'COLUMN',@level2name=N'NatureId'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemNatureItem', @level2type=N'COLUMN',@level2name=N'NatureItemCode'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemNatureItem', @level2type=N'COLUMN',@level2name=N'NatureItemType'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'定义内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemNatureItem', @level2type=N'COLUMN',@level2name=N'NatureItemContent'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'职能部门' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemNatureItem', @level2type=N'COLUMN',@level2name=N'NatureItemDep'
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'安全问题性质详细定义' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_SafetyProblemNatureItem'
|
||||
END
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--质量问题分类
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Base_QualityProblemClassify') AND type = N'U')
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[Base_QualityProblemClassify](
|
||||
[ClassifyId] [nvarchar](50) NOT NULL,
|
||||
[ClassifyCode] [nvarchar](50) NOT NULL,
|
||||
[ClassifyName] [nvarchar](100) NOT NULL,
|
||||
CONSTRAINT [PK_Base_QualityProblemClassify] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[ClassifyId] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemClassify', @level2type=N'COLUMN',@level2name=N'ClassifyId'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemClassify', @level2type=N'COLUMN',@level2name=N'ClassifyCode'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemClassify', @level2type=N'COLUMN',@level2name=N'ClassifyName'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'质量问题分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemClassify'
|
||||
END
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--质量问题子类
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Base_QualityProblemClassifyItem') AND type = N'U')
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[Base_QualityProblemClassifyItem](
|
||||
[ClassifyItemId] [nvarchar](50) NOT NULL,
|
||||
[ClassifyId] [nvarchar](50) NULL,
|
||||
[ClassifyItemCode] [nvarchar](50) NULL,
|
||||
[ClassifyItemName] [nvarchar](100) NULL,
|
||||
[CompileMan] [nvarchar](50) NULL,
|
||||
[CompileManName] [nvarchar](50) NULL,
|
||||
[CompileDate] [datetime] NULL,
|
||||
CONSTRAINT [PK_Base_QualityProblemClassifyItem] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[ClassifyItemId] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
ALTER TABLE [dbo].[Base_QualityProblemClassifyItem] WITH CHECK ADD CONSTRAINT [FK_Base_QualityProblemClassifyItem_Classify] FOREIGN KEY([ClassifyId])
|
||||
REFERENCES [dbo].[Base_QualityProblemClassify] ([ClassifyId])
|
||||
ALTER TABLE [dbo].[Base_QualityProblemClassifyItem] CHECK CONSTRAINT [FK_Base_QualityProblemClassifyItem_Classify]
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子类id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemClassifyItem', @level2type=N'COLUMN',@level2name=N'ClassifyItemId'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemClassifyItem', @level2type=N'COLUMN',@level2name=N'ClassifyId'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemClassifyItem', @level2type=N'COLUMN',@level2name=N'ClassifyItemCode'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemClassifyItem', @level2type=N'COLUMN',@level2name=N'ClassifyItemName'
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'质量问题子类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemClassifyItem'
|
||||
END
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--质量问题性质
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Base_QualityProblemNature') AND type = N'U')
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[Base_QualityProblemNature](
|
||||
[NatureId] [nvarchar](50) NOT NULL,
|
||||
[NatureCode] [nvarchar](50) NOT NULL,
|
||||
[NatureName] [nvarchar](100) NOT NULL,
|
||||
CONSTRAINT [PK_Base_QualityProblemNature] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[NatureId] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemNature', @level2type=N'COLUMN',@level2name=N'NatureId'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemNature', @level2type=N'COLUMN',@level2name=N'NatureCode'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'性质名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemNature', @level2type=N'COLUMN',@level2name=N'NatureName'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'质量问题性质' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemNature'
|
||||
END
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
--质量问题性质详细定义
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Base_QualityProblemNatureItem') AND type = N'U')
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[Base_QualityProblemNatureItem](
|
||||
[NatureItemId] [nvarchar](50) NOT NULL,
|
||||
[NatureId] [nvarchar](50) NULL,
|
||||
[NatureItemCode] [nvarchar](50) NULL,
|
||||
[NatureItemType] [nvarchar](200) NULL,
|
||||
[NatureItemContent] [nvarchar](max) NULL,
|
||||
[NatureItemDep] [nvarchar](200) NULL,
|
||||
[CompileMan] [nvarchar](50) NULL,
|
||||
[CompileManName] [nvarchar](50) NULL,
|
||||
[CompileDate] [datetime] NULL,
|
||||
CONSTRAINT [PK_Base_QualityProblemNatureItem] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[NatureItemId] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
ALTER TABLE [dbo].[Base_QualityProblemNatureItem] WITH CHECK ADD CONSTRAINT [FK_Base_QualityProblemNatureItem_Nature] FOREIGN KEY([NatureId])
|
||||
REFERENCES [dbo].[Base_QualityProblemNature] ([NatureId])
|
||||
ALTER TABLE [dbo].[Base_QualityProblemNatureItem] CHECK CONSTRAINT [FK_Base_QualityProblemNatureItem_Nature]
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'明细id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemNatureItem', @level2type=N'COLUMN',@level2name=N'NatureItemId'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'性质id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemNatureItem', @level2type=N'COLUMN',@level2name=N'NatureId'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemNatureItem', @level2type=N'COLUMN',@level2name=N'NatureItemCode'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemNatureItem', @level2type=N'COLUMN',@level2name=N'NatureItemType'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'定义内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemNatureItem', @level2type=N'COLUMN',@level2name=N'NatureItemContent'
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'职能部门' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemNatureItem', @level2type=N'COLUMN',@level2name=N'NatureItemDep'
|
||||
|
||||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'质量问题性质详细定义' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Base_QualityProblemNatureItem'
|
||||
END
|
||||
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ namespace BLL
|
|||
if (tasks.Count() > 0)
|
||||
{
|
||||
var taskItems = from x in db.Training_TaskItem where x.PlanId == newTrainingPlan.PlanId select x;
|
||||
if (tasks.Count() > 0)
|
||||
if (taskItems.Count() > 0)
|
||||
{
|
||||
db.Training_TaskItem.DeleteAllOnSubmit(taskItems);
|
||||
db.SubmitChanges();
|
||||
|
|
|
|||
|
|
@ -255,7 +255,13 @@
|
|||
<Compile Include="BaseInfo\BaseFactoryService.cs" />
|
||||
<Compile Include="BaseInfo\CertificateService.cs" />
|
||||
<Compile Include="BaseInfo\CNProfessionalService.cs" />
|
||||
<Compile Include="BaseInfo\QualityProblemClassifyItemService.cs" />
|
||||
<Compile Include="BaseInfo\QualityProblemClassifyService.cs" />
|
||||
<Compile Include="BaseInfo\QualityProblemNatureItemService.cs" />
|
||||
<Compile Include="BaseInfo\SafetyProblemNatureItemService.cs" />
|
||||
<Compile Include="BaseInfo\SafetyProblemClassifyItemService.cs" />
|
||||
<Compile Include="BaseInfo\QualityProblemNatureService.cs" />
|
||||
<Compile Include="BaseInfo\SafetyProblemNatureService.cs" />
|
||||
<Compile Include="BaseInfo\SafetyProblemClassifyService.cs" />
|
||||
<Compile Include="BaseInfo\CostTypeService.cs" />
|
||||
<Compile Include="BaseInfo\DesignProfessionalService.cs" />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,127 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量问题分类
|
||||
/// </summary>
|
||||
public class QualityProblemClassifyItemService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取质量问题分类明细信息
|
||||
/// </summary>
|
||||
/// <param name="ItemId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Base_QualityProblemClassifyItem GetClassifyItemById(string ItemId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return db.Base_QualityProblemClassifyItem.FirstOrDefault(e => e.ClassifyItemId == ItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加质量问题分类明细
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void AddClassifyItem(Model.Base_QualityProblemClassifyItem model)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Base_QualityProblemClassifyItem newModel = new Model.Base_QualityProblemClassifyItem();
|
||||
newModel.ClassifyItemId = model.ClassifyItemId;
|
||||
newModel.ClassifyId = model.ClassifyId;
|
||||
newModel.ClassifyItemCode = model.ClassifyItemCode;
|
||||
newModel.ClassifyItemName = model.ClassifyItemName;
|
||||
newModel.CompileMan = model.CompileMan;
|
||||
newModel.CompileManName = model.CompileManName;
|
||||
newModel.CompileDate = model.CompileDate;
|
||||
db.Base_QualityProblemClassifyItem.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改质量问题分类明细
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void UpdateClassifyItem(Model.Base_QualityProblemClassifyItem model)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Base_QualityProblemClassifyItem newModel = db.Base_QualityProblemClassifyItem.FirstOrDefault(e => e.ClassifyItemId == model.ClassifyItemId);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.ClassifyId = model.ClassifyId;
|
||||
newModel.ClassifyItemCode = model.ClassifyItemCode;
|
||||
newModel.ClassifyItemName = model.ClassifyItemName;
|
||||
newModel.CompileMan = model.CompileMan;
|
||||
newModel.CompileManName = model.CompileManName;
|
||||
newModel.CompileDate = model.CompileDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除明细信息
|
||||
/// </summary>
|
||||
/// <param name="ItemId"></param>
|
||||
public static void DeleteClassifyItemById(string ItemId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Base_QualityProblemClassifyItem model = db.Base_QualityProblemClassifyItem.FirstOrDefault(e => e.ClassifyItemId == ItemId);
|
||||
if (model != null)
|
||||
{
|
||||
db.Base_QualityProblemClassifyItem.DeleteOnSubmit(model);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除明细信息
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteClassifyItemByClassifyId(string Id)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
var Items = from x in db.Base_QualityProblemClassifyItem where x.ClassifyId == Id select x;
|
||||
if (Items.Count() > 0)
|
||||
{
|
||||
db.Base_QualityProblemClassifyItem.DeleteAllOnSubmit(Items);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 教材库下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="workPostId">职务Id</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitClassifyItemDownList(FineUIPro.DropDownList dropName, string workPostId, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "ClassifyItemId";
|
||||
dropName.DataTextField = "ClassifyItemName";
|
||||
dropName.DataSource = GetClassifyItemList(workPostId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取下拉项
|
||||
/// </summary>
|
||||
/// <param name="classifyId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_QualityProblemClassifyItem> GetClassifyItemList(string classifyId)
|
||||
{
|
||||
var lst = (from x in Funs.DB.Base_QualityProblemClassifyItem orderby x.ClassifyItemCode select x).ToList();
|
||||
if (!string.IsNullOrWhiteSpace(classifyId))
|
||||
{
|
||||
lst = lst.Where(x => x.ClassifyId == classifyId).ToList();
|
||||
}
|
||||
return lst;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量问题分类主表
|
||||
/// </summary>
|
||||
public class QualityProblemClassifyService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取质量问题分类
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Base_QualityProblemClassify GetClassifyById(string Id)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
return db.Base_QualityProblemClassify.FirstOrDefault(e => e.ClassifyId == Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加质量问题分类
|
||||
/// </summary>
|
||||
/// <param name="Classify"></param>
|
||||
public static void AddClassify(Model.Base_QualityProblemClassify Classify)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.Base_QualityProblemClassify newModel = new Model.Base_QualityProblemClassify();
|
||||
newModel.ClassifyId = Classify.ClassifyId;
|
||||
newModel.ClassifyCode = Classify.ClassifyCode;
|
||||
newModel.ClassifyName = Classify.ClassifyName;
|
||||
db.Base_QualityProblemClassify.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改质量问题分类
|
||||
/// </summary>
|
||||
/// <param name="Classify"></param>
|
||||
public static void UpdateClassify(Model.Base_QualityProblemClassify Classify)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.Base_QualityProblemClassify newModel = db.Base_QualityProblemClassify.FirstOrDefault(e => e.ClassifyId == Classify.ClassifyId);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.ClassifyCode = Classify.ClassifyCode;
|
||||
newModel.ClassifyName = Classify.ClassifyName;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除质量问题分类
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteClassify(string Id)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.Base_QualityProblemClassify Classify = db.Base_QualityProblemClassify.FirstOrDefault(e => e.ClassifyId == Id);
|
||||
if (Classify != null)
|
||||
{
|
||||
var getItems = from x in Funs.DB.Base_QualityProblemClassifyItem
|
||||
where x.ClassifyId == Classify.ClassifyId
|
||||
select x;
|
||||
if (getItems.Count() > 0)
|
||||
{
|
||||
db.Base_QualityProblemClassifyItem.DeleteAllOnSubmit(getItems);
|
||||
}
|
||||
db.Base_QualityProblemClassify.DeleteOnSubmit(Classify);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询所有质量问题分类
|
||||
/// </summary>
|
||||
/// <returns>质量问题分类的集合</returns>
|
||||
public static List<Model.Base_QualityProblemClassify> GetClassify()
|
||||
{
|
||||
return (from x in Funs.DB.Base_QualityProblemClassify
|
||||
orderby x.ClassifyCode
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 类型下拉框(末级)
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitClassifyIsEndDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "ClassifyId";
|
||||
dropName.DataTextField = "ClassifyName";
|
||||
dropName.DataSource = GetClassify();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量问题性质
|
||||
/// </summary>
|
||||
public class QualityProblemNatureItemService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取质量问题性质明细信息
|
||||
/// </summary>
|
||||
/// <param name="ItemId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Base_QualityProblemNatureItem GetNatureItemById(string ItemId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return db.Base_QualityProblemNatureItem.FirstOrDefault(e => e.NatureItemId == ItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加质量问题性质明细
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void AddNatureItem(Model.Base_QualityProblemNatureItem model)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Base_QualityProblemNatureItem newModel = new Model.Base_QualityProblemNatureItem();
|
||||
newModel.NatureItemId = model.NatureItemId;
|
||||
newModel.NatureId = model.NatureId;
|
||||
newModel.NatureItemCode = model.NatureItemCode;
|
||||
newModel.NatureItemType = model.NatureItemType;
|
||||
newModel.NatureItemContent = model.NatureItemContent;
|
||||
newModel.NatureItemDep = model.NatureItemDep;
|
||||
newModel.CompileMan = model.CompileMan;
|
||||
newModel.CompileManName = model.CompileManName;
|
||||
newModel.CompileDate = model.CompileDate;
|
||||
db.Base_QualityProblemNatureItem.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改质量问题性质明细
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void UpdateNatureItem(Model.Base_QualityProblemNatureItem model)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Base_QualityProblemNatureItem newModel = db.Base_QualityProblemNatureItem.FirstOrDefault(e => e.NatureItemId == model.NatureItemId);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.NatureId = model.NatureId;
|
||||
newModel.NatureItemCode = model.NatureItemCode;
|
||||
newModel.NatureItemType = model.NatureItemType;
|
||||
newModel.NatureItemContent = model.NatureItemContent;
|
||||
newModel.NatureItemDep = model.NatureItemDep;
|
||||
newModel.CompileMan = model.CompileMan;
|
||||
newModel.CompileManName = model.CompileManName;
|
||||
newModel.CompileDate = model.CompileDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除明细信息
|
||||
/// </summary>
|
||||
/// <param name="ItemId"></param>
|
||||
public static void DeleteNatureItemById(string ItemId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Base_QualityProblemNatureItem model = db.Base_QualityProblemNatureItem.FirstOrDefault(e => e.NatureItemId == ItemId);
|
||||
if (model != null)
|
||||
{
|
||||
db.Base_QualityProblemNatureItem.DeleteOnSubmit(model);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除明细信息
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteNatureItemByNatureId(string Id)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
var Items = from x in db.Base_QualityProblemNatureItem where x.NatureId == Id select x;
|
||||
if (Items.Count() > 0)
|
||||
{
|
||||
db.Base_QualityProblemNatureItem.DeleteAllOnSubmit(Items);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 教材库下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="workPostId">职务Id</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitNatureItemDownList(FineUIPro.DropDownList dropName, string workPostId, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "NatureItemId";
|
||||
dropName.DataTextField = "NatureItemName";
|
||||
dropName.DataSource = GetNatureItemList(workPostId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取下拉项
|
||||
/// </summary>
|
||||
/// <param name="classifyId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_QualityProblemNatureItem> GetNatureItemList(string classifyId)
|
||||
{
|
||||
var lst = (from x in Funs.DB.Base_QualityProblemNatureItem orderby x.NatureItemCode select x).ToList();
|
||||
if (!string.IsNullOrWhiteSpace(classifyId))
|
||||
{
|
||||
lst = lst.Where(x => x.NatureId == classifyId).ToList();
|
||||
}
|
||||
return lst;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量问题性质主表
|
||||
/// </summary>
|
||||
public class QualityProblemNatureService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取质量问题性质
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Base_QualityProblemNature GetNatureById(string Id)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
return db.Base_QualityProblemNature.FirstOrDefault(e => e.NatureId == Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加质量问题性质
|
||||
/// </summary>
|
||||
/// <param name="Nature"></param>
|
||||
public static void AddNature(Model.Base_QualityProblemNature Nature)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.Base_QualityProblemNature newModel = new Model.Base_QualityProblemNature();
|
||||
newModel.NatureId = Nature.NatureId;
|
||||
newModel.NatureCode = Nature.NatureCode;
|
||||
newModel.NatureName = Nature.NatureName;
|
||||
db.Base_QualityProblemNature.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改质量问题性质
|
||||
/// </summary>
|
||||
/// <param name="Nature"></param>
|
||||
public static void UpdateNature(Model.Base_QualityProblemNature Nature)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.Base_QualityProblemNature newModel = db.Base_QualityProblemNature.FirstOrDefault(e => e.NatureId == Nature.NatureId);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.NatureCode = Nature.NatureCode;
|
||||
newModel.NatureName = Nature.NatureName;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除质量问题性质
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteNature(string Id)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.Base_QualityProblemNature Nature = db.Base_QualityProblemNature.FirstOrDefault(e => e.NatureId == Id);
|
||||
if (Nature != null)
|
||||
{
|
||||
var getItems = from x in Funs.DB.Base_QualityProblemNatureItem
|
||||
where x.NatureId == Nature.NatureId
|
||||
select x;
|
||||
if (getItems.Count() > 0)
|
||||
{
|
||||
db.Base_QualityProblemNatureItem.DeleteAllOnSubmit(getItems);
|
||||
}
|
||||
db.Base_QualityProblemNature.DeleteOnSubmit(Nature);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询所有质量问题性质
|
||||
/// </summary>
|
||||
/// <returns>质量问题性质的集合</returns>
|
||||
public static List<Model.Base_QualityProblemNature> GetNature()
|
||||
{
|
||||
return (from x in Funs.DB.Base_QualityProblemNature
|
||||
orderby x.NatureCode
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 类型下拉框(末级)
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitNatureIsEndDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "NatureId";
|
||||
dropName.DataTextField = "NatureName";
|
||||
dropName.DataSource = GetNature();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -62,11 +62,11 @@ namespace BLL
|
|||
/// <summary>
|
||||
/// 根据主键删除明细信息
|
||||
/// </summary>
|
||||
/// <param name="companyTrainItemId"></param>
|
||||
public static void DeleteClassifyItemById(string companyTrainItemId)
|
||||
/// <param name="ItemId"></param>
|
||||
public static void DeleteClassifyItemById(string ItemId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Base_SafetyProblemClassifyItem model = db.Base_SafetyProblemClassifyItem.FirstOrDefault(e => e.ClassifyItemId == companyTrainItemId);
|
||||
Model.Base_SafetyProblemClassifyItem model = db.Base_SafetyProblemClassifyItem.FirstOrDefault(e => e.ClassifyItemId == ItemId);
|
||||
if (model != null)
|
||||
{
|
||||
db.Base_SafetyProblemClassifyItem.DeleteOnSubmit(model);
|
||||
|
|
@ -74,6 +74,21 @@ namespace BLL
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除明细信息
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteClassifyItemByClassifyId(string Id)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
var Items = from x in db.Base_SafetyProblemClassifyItem where x.ClassifyId == Id select x;
|
||||
if (Items.Count() > 0)
|
||||
{
|
||||
db.Base_SafetyProblemClassifyItem.DeleteAllOnSubmit(Items);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 教材库下拉框
|
||||
|
|
|
|||
|
|
@ -73,37 +73,6 @@ namespace BLL
|
|||
}
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// 是否可删除资源节点
|
||||
///// </summary>
|
||||
///// <param name="postName"></param>
|
||||
///// <returns>true-可以,false-不可以</returns>
|
||||
//public static bool IsDeleteClassify(string Id)
|
||||
//{
|
||||
// bool isDelete = true;
|
||||
// var Training = BLL.SafetyProblemClassifyService.GetClassifyById(Id);
|
||||
// if (Training != null)
|
||||
// {
|
||||
// if (Training.IsEndLever == true)
|
||||
// {
|
||||
// var detailCout = Funs.DB.Training_ClassifyItem.FirstOrDefault(x => x.ClassifyId == Id);
|
||||
// if (detailCout != null)
|
||||
// {
|
||||
// isDelete = false;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// var supItemSetCount = BLL.SafetyProblemClassifyService.GetClassifyBySupItem(Id);
|
||||
// if (supItemSetCount.Count() > 0)
|
||||
// {
|
||||
// isDelete = false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return isDelete;
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 查询所有安全问题分类
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,131 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全问题性质
|
||||
/// </summary>
|
||||
public class SafetyProblemNatureItemService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取安全问题性质明细信息
|
||||
/// </summary>
|
||||
/// <param name="ItemId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Base_SafetyProblemNatureItem GetNatureItemById(string ItemId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return db.Base_SafetyProblemNatureItem.FirstOrDefault(e => e.NatureItemId == ItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安全问题性质明细
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void AddNatureItem(Model.Base_SafetyProblemNatureItem model)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Base_SafetyProblemNatureItem newModel = new Model.Base_SafetyProblemNatureItem();
|
||||
newModel.NatureItemId = model.NatureItemId;
|
||||
newModel.NatureId = model.NatureId;
|
||||
newModel.NatureItemCode = model.NatureItemCode;
|
||||
newModel.NatureItemType = model.NatureItemType;
|
||||
newModel.NatureItemContent = model.NatureItemContent;
|
||||
newModel.NatureItemDep = model.NatureItemDep;
|
||||
newModel.CompileMan = model.CompileMan;
|
||||
newModel.CompileManName = model.CompileManName;
|
||||
newModel.CompileDate = model.CompileDate;
|
||||
db.Base_SafetyProblemNatureItem.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安全问题性质明细
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
public static void UpdateNatureItem(Model.Base_SafetyProblemNatureItem model)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Base_SafetyProblemNatureItem newModel = db.Base_SafetyProblemNatureItem.FirstOrDefault(e => e.NatureItemId == model.NatureItemId);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.NatureId = model.NatureId;
|
||||
newModel.NatureItemCode = model.NatureItemCode;
|
||||
newModel.NatureItemType = model.NatureItemType;
|
||||
newModel.NatureItemContent = model.NatureItemContent;
|
||||
newModel.NatureItemDep = model.NatureItemDep;
|
||||
newModel.CompileMan = model.CompileMan;
|
||||
newModel.CompileManName = model.CompileManName;
|
||||
newModel.CompileDate = model.CompileDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除明细信息
|
||||
/// </summary>
|
||||
/// <param name="ItemId"></param>
|
||||
public static void DeleteNatureItemById(string ItemId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Base_SafetyProblemNatureItem model = db.Base_SafetyProblemNatureItem.FirstOrDefault(e => e.NatureItemId == ItemId);
|
||||
if (model != null)
|
||||
{
|
||||
db.Base_SafetyProblemNatureItem.DeleteOnSubmit(model);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除明细信息
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteNatureItemByNatureId(string Id)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
var Items = from x in db.Base_SafetyProblemNatureItem where x.NatureId == Id select x;
|
||||
if (Items.Count() > 0)
|
||||
{
|
||||
db.Base_SafetyProblemNatureItem.DeleteAllOnSubmit(Items);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 教材库下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="workPostId">职务Id</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitNatureItemDownList(FineUIPro.DropDownList dropName, string workPostId, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "NatureItemId";
|
||||
dropName.DataTextField = "NatureItemName";
|
||||
dropName.DataSource = GetNatureItemList(workPostId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取下拉项
|
||||
/// </summary>
|
||||
/// <param name="classifyId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_SafetyProblemNatureItem> GetNatureItemList(string classifyId)
|
||||
{
|
||||
var lst = (from x in Funs.DB.Base_SafetyProblemNatureItem orderby x.NatureItemCode select x).ToList();
|
||||
if (!string.IsNullOrWhiteSpace(classifyId))
|
||||
{
|
||||
lst = lst.Where(x => x.NatureId == classifyId).ToList();
|
||||
}
|
||||
return lst;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全问题性质主表
|
||||
/// </summary>
|
||||
public class SafetyProblemNatureService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取安全问题性质
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Base_SafetyProblemNature GetNatureById(string Id)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
return db.Base_SafetyProblemNature.FirstOrDefault(e => e.NatureId == Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安全问题性质
|
||||
/// </summary>
|
||||
/// <param name="Nature"></param>
|
||||
public static void AddNature(Model.Base_SafetyProblemNature Nature)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.Base_SafetyProblemNature newModel = new Model.Base_SafetyProblemNature();
|
||||
newModel.NatureId = Nature.NatureId;
|
||||
newModel.NatureCode = Nature.NatureCode;
|
||||
newModel.NatureName = Nature.NatureName;
|
||||
db.Base_SafetyProblemNature.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安全问题性质
|
||||
/// </summary>
|
||||
/// <param name="Nature"></param>
|
||||
public static void UpdateNature(Model.Base_SafetyProblemNature Nature)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.Base_SafetyProblemNature newModel = db.Base_SafetyProblemNature.FirstOrDefault(e => e.NatureId == Nature.NatureId);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.NatureCode = Nature.NatureCode;
|
||||
newModel.NatureName = Nature.NatureName;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除安全问题性质
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
public static void DeleteNature(string Id)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.Base_SafetyProblemNature Nature = db.Base_SafetyProblemNature.FirstOrDefault(e => e.NatureId == Id);
|
||||
if (Nature != null)
|
||||
{
|
||||
var getItems = from x in Funs.DB.Base_SafetyProblemNatureItem
|
||||
where x.NatureId == Nature.NatureId
|
||||
select x;
|
||||
if (getItems.Count() > 0)
|
||||
{
|
||||
db.Base_SafetyProblemNatureItem.DeleteAllOnSubmit(getItems);
|
||||
}
|
||||
db.Base_SafetyProblemNature.DeleteOnSubmit(Nature);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询所有安全问题性质
|
||||
/// </summary>
|
||||
/// <returns>安全问题性质的集合</returns>
|
||||
public static List<Model.Base_SafetyProblemNature> GetNature()
|
||||
{
|
||||
return (from x in Funs.DB.Base_SafetyProblemNature
|
||||
orderby x.NatureCode
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 类型下拉框(末级)
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitNatureIsEndDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "NatureId";
|
||||
dropName.DataTextField = "NatureName";
|
||||
dropName.DataSource = GetNature();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -784,7 +784,11 @@ namespace BLL
|
|||
/// <summary>
|
||||
/// 默认用户密码
|
||||
/// </summary>
|
||||
public const string Password = "XJYJ.1234";
|
||||
public const string Password = "XJYJ!@#qwe.1234";
|
||||
/// <summary>
|
||||
/// 默认用户密码前缀
|
||||
/// </summary>
|
||||
public const string PasswordPrefixValue = "XJYJ!@#qwe.";
|
||||
|
||||
/// <summary>
|
||||
/// 培训类型——入场培训类型ID
|
||||
|
|
|
|||
|
|
@ -1599,7 +1599,7 @@ namespace BLL
|
|||
|
||||
public static string getInitialPassword(string unitId, string idCard)
|
||||
{
|
||||
string prefixValue = "XJYJ!@#qwe";
|
||||
string prefixValue = Const.PasswordPrefixValue;
|
||||
string suffixValue = "1234";
|
||||
//var getUnit = UnitService.GetUnitByUnitId(unitId);
|
||||
//if (getUnit != null)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,129 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityProblemClassify.aspx.cs"
|
||||
Inherits="FineUIPro.Web.BaseInfo.QualityProblemClassify" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>质量问题分类</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
|
||||
EnableCollapse="true" Width="300" Title="质量问题分类" TitleToolTip="质量问题分类" ShowBorder="true"
|
||||
ShowHeader="false" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft">
|
||||
<Items>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:Button ID="btnNew" Icon="Add" runat="server" OnClick="btnNew_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnEdit" Icon="Pencil" runat="server" OnClick="btnEdit_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" Icon="Delete" ConfirmText="确定删除当前数据?" OnClick="btnDelete_Click"
|
||||
runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
<f:Tree ID="trObj" EnableCollapse="true" ShowHeader="true" Title="质量问题分类" MinHeight="400px"
|
||||
OnNodeCommand="trObj_NodeCommand" AutoLeafIdentification="true" runat="server"
|
||||
EnableTextSelection="True">
|
||||
</f:Tree>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
|
||||
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="质量问题分类明细"
|
||||
TitleToolTip="质量问题分类明细" AutoScroll="true">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" Width="850px" ShowBorder="true" ShowHeader="false" EnableCollapse="true" ForceFit="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="ClassifyItemId" DataIDField="ClassifyItemId"
|
||||
AllowSorting="true" SortField="ClassifyItemCode" SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
|
||||
PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
|
||||
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True" EnableColumnLines="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar3" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox ID="txtClassifyItemCode" runat="server" Label="编号" EmptyText="输入查询编号"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
|
||||
LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtClassifyItemName" runat="server" Label="名称" EmptyText="输入查询名称"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
|
||||
LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnNewDetail" ToolTip="新增" Icon="Add" runat="server" OnClick="btnNewDetail_Click"
|
||||
Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center" />
|
||||
<f:RenderField Width="150px" ColumnID="ClassifyItemCode" DataField="ClassifyItemCode" FieldType="String"
|
||||
HeaderText="编号" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="250px" ColumnID="ClassifyItemName" DataField="ClassifyItemName" FieldType="String"
|
||||
HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="类别" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
|
||||
Width="700px" Height="600px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="详情" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window2_Close" IsModal="true"
|
||||
Width="700px" Height="600px">
|
||||
</f:Window>
|
||||
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
runat="server" Text="编辑" Hidden="true" Icon="Pencil">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
|
||||
Icon="Delete" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除"
|
||||
Hidden="true">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,433 @@
|
|||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using AspNet = System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
public partial class QualityProblemClassify : PageBase
|
||||
{
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.GetButtonPower();
|
||||
InitTreeMenu();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载树
|
||||
/// <summary>
|
||||
/// 初始化树
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
trObj.Nodes.Clear();
|
||||
trObj.ShowBorder = false;
|
||||
trObj.ShowHeader = false;
|
||||
trObj.EnableIcons = true;
|
||||
trObj.AutoScroll = true;
|
||||
trObj.EnableSingleClickExpand = true;
|
||||
TreeNode rootNode = new TreeNode
|
||||
{
|
||||
Text = "质量问题分类",
|
||||
NodeID = "0",
|
||||
Expanded = true
|
||||
};
|
||||
this.trObj.Nodes.Add(rootNode);
|
||||
BoundTree(rootNode.Nodes, "0");
|
||||
}
|
||||
|
||||
private void BoundTree(TreeNodeCollection nodes, string menuId)
|
||||
{
|
||||
var dt = GetNewTraining();
|
||||
if (dt.Count() > 0)
|
||||
{
|
||||
TreeNode tn = null;
|
||||
foreach (var dr in dt)
|
||||
{
|
||||
tn = new TreeNode
|
||||
{
|
||||
Text = dr.ClassifyName,
|
||||
NodeID = dr.ClassifyId,
|
||||
EnableClickEvent = true,
|
||||
ToolTip = dr.ClassifyName
|
||||
};
|
||||
nodes.Add(tn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到菜单方法
|
||||
/// </summary>
|
||||
/// <param name="parentId"></param>
|
||||
/// <returns></returns>
|
||||
private List<Model.Base_QualityProblemClassify> GetNewTraining()
|
||||
{
|
||||
return (from x in Funs.DB.Base_QualityProblemClassify orderby x.ClassifyCode select x).ToList(); ;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 增加、修改、删除质量问题分类类别
|
||||
/// <summary>
|
||||
/// 增加质量问题分类类别
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trObj.SelectedNode != null)
|
||||
{
|
||||
if (this.trObj.SelectedNode.NodeID == "0") //根节点或者非末级节点,可以增加
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("QualityProblemClassifySave.aspx", this.trObj.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("选择的项已是末级!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改质量问题分类类别
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trObj.SelectedNode != null)
|
||||
{
|
||||
if (this.trObj.SelectedNode.NodeID != "0") //非根节点可以编辑
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("QualityProblemClassifySave.aspx?ClassifyId={0}", this.trObj.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("根节点无法编辑!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除质量问题分类类别
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trObj.SelectedNode != null)
|
||||
{
|
||||
var q = BLL.QualityProblemClassifyService.GetClassifyById(this.trObj.SelectedNode.NodeID);
|
||||
|
||||
if (q != null)
|
||||
{
|
||||
BLL.QualityProblemClassifyService.DeleteClassify(this.trObj.SelectedNode.NodeID);
|
||||
InitTreeMenu();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("存在下级菜单或已增加资源数据或者为内置项,不允许删除!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择删除项!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 树点击事件
|
||||
/// <summary>
|
||||
/// 树点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void trObj_NodeCommand(object sender, FineUIPro.TreeCommandEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 下拉触发事件
|
||||
|
||||
/// <summary>
|
||||
/// 适用岗位下拉触发事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drp_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 绑定数据
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (this.trObj.SelectedNode != null && !string.IsNullOrEmpty(this.trObj.SelectedNode.NodeID))
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("SELECT item.ClassifyItemId,item.ClassifyId,item.ClassifyItemCode,item.ClassifyItemName,item.CompileMan, item.CompileDate ");
|
||||
sb.Append("FROM dbo.Base_QualityProblemClassifyItem AS item ");
|
||||
sb.Append("WHERE item.ClassifyId=@ClassifyId ");
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@ClassifyId", this.trObj.SelectedNode.NodeID)
|
||||
};
|
||||
if (!string.IsNullOrEmpty(this.txtClassifyItemCode.Text.Trim()))
|
||||
{
|
||||
sb.Append("AND ClassifyItemCode LIKE @ClassifyItemCode ");
|
||||
listStr.Add(new SqlParameter("@ClassifyItemCode", "%" + this.txtClassifyItemCode.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtClassifyItemName.Text.Trim()))
|
||||
{
|
||||
sb.Append("AND ClassifyItemName LIKE @ClassifyItemName ");
|
||||
listStr.Add(new SqlParameter("@ClassifyItemName", "%" + this.txtClassifyItemName.Text.Trim() + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(sb.ToString(), parameter);
|
||||
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 弹出窗关闭事件
|
||||
protected void Window1_Close(object sender, EventArgs e)
|
||||
{
|
||||
InitTreeMenu();
|
||||
}
|
||||
|
||||
protected void Window2_Close(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 排序、分页
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 增加、修改、删除明细信息
|
||||
#region 新增明细
|
||||
/// <summary>
|
||||
/// 新增明细
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNewDetail_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trObj.SelectedNode != null)
|
||||
{
|
||||
if (this.trObj.SelectedNode.Nodes.Count == 0)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("QualityProblemClassifyItemSave.aspx?ClassifyId={0}", this.trObj.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择末级节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑明细
|
||||
protected void btnEditDetail_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 右键编辑事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑数据方法
|
||||
/// </summary>
|
||||
private void EditData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string Id = this.trObj.SelectedNode.Nodes.Count == 0 ? this.trObj.SelectedNode.NodeID : string.Empty;
|
||||
string itemId = Grid1.SelectedRowID;
|
||||
//itemId = itemId.Substring(0, itemId.IndexOf("_"));
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("QualityProblemClassifyItemSave.aspx?ClassifyItemId={0}&ClassifyId={1}", itemId, Id, "编辑 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除明细
|
||||
// 删除数据
|
||||
protected void btnDeleteDetail_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DeleteData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 右键删除事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DeleteData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除方法
|
||||
/// </summary>
|
||||
private void DeleteData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
//rowID = rowID.Substring(0, rowID.IndexOf("_"));
|
||||
|
||||
var getD = BLL.QualityProblemClassifyItemService.GetClassifyItemById(rowID);
|
||||
if (getD != null)
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, getD.ClassifyItemCode, getD.ClassifyItemId, BLL.Const.QualityProblemClassifyMenuId, BLL.Const.BtnDelete);
|
||||
BLL.QualityProblemClassifyItemService.DeleteClassifyItemById(rowID);
|
||||
}
|
||||
}
|
||||
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.QualityProblemClassifyMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
this.btnNewDetail.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnEdit.Hidden = false;
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnDelete.Hidden = false;
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 导出
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.ClearContent();
|
||||
string filename = Funs.GetNewFileName();
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("质量问题分类" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
Response.ContentType = "application/excel";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid1.PageSize = Grid1.RecordCount;
|
||||
BindGrid();
|
||||
Response.Write(GetGridTableHtml(Grid1));
|
||||
Response.End();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,251 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
|
||||
|
||||
public partial class QualityProblemClassify
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// panelLeftRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelLeftRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDelete;
|
||||
|
||||
/// <summary>
|
||||
/// trObj 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tree trObj;
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar3;
|
||||
|
||||
/// <summary>
|
||||
/// txtClassifyItemCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtClassifyItemCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtClassifyItemName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtClassifyItemName;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnNewDetail 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNewDetail;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityProblemClassifyItemSave.aspx.cs"
|
||||
Inherits="FineUIPro.Web.BaseInfo.QualityProblemClassifyItemSave" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>编辑质量问题分类</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtClassifyItemCode" runat="server" Label="编号" Required="true"
|
||||
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50" LabelWidth="120px" >
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtClassifyItemName" runat="server" Label="名称" Required="true" LabelWidth="120px"
|
||||
ShowRedStar="true" MaxLength="50" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCompileMan" runat="server" Label="整理人" Readonly="true" MaxLength="50" LabelWidth="120px">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DatePicker runat="server" Label="整理时间" ID="txtCompileDate" LabelWidth="120px">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Label runat="server" ID="lbTemp">
|
||||
</f:Label>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using Model;
|
||||
using BLL;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
public partial class QualityProblemClassifyItemSave : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string ClassifyItemId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ClassifyItemId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ClassifyItemId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 主表主键
|
||||
/// </summary>
|
||||
public string ClassifyId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ClassifyId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ClassifyId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.GetButtonPower();
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
|
||||
this.ClassifyItemId = Request.QueryString["ClassifyItemId"];
|
||||
this.ClassifyId = Request.QueryString["ClassifyId"];
|
||||
if (!string.IsNullOrEmpty(this.ClassifyItemId))
|
||||
{
|
||||
var model = QualityProblemClassifyItemService.GetClassifyItemById(this.ClassifyItemId);
|
||||
if (model != null)
|
||||
{
|
||||
this.ClassifyId = model.ClassifyId;
|
||||
this.txtClassifyItemCode.Text = model.ClassifyItemCode;
|
||||
this.txtClassifyItemName.Text = model.ClassifyItemName;
|
||||
this.txtCompileMan.Text = model.CompileManName;
|
||||
if (model.CompileDate != null)
|
||||
{
|
||||
txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", model.CompileDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtCompileMan.Text = this.CurrUser.UserName;
|
||||
//this.txtClassifyItemName.Text = model.ClassifyName;
|
||||
//this.txtClassifyItemCode.Text = SQLHelper.RunProcNewId("SpGetNewCode3", "Base_QualityProblemClassifyItem", "ClassifyItemCode", model.ClassifyItemCode + "-");
|
||||
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
private void SaveData(bool isClose)
|
||||
{
|
||||
Model.Base_QualityProblemClassifyItem newModel = new Base_QualityProblemClassifyItem
|
||||
{
|
||||
ClassifyId = this.ClassifyId,
|
||||
ClassifyItemCode = this.txtClassifyItemCode.Text.Trim(),
|
||||
ClassifyItemName = this.txtClassifyItemName.Text.Trim(),
|
||||
CompileMan = this.CurrUser.UserId,
|
||||
CompileManName = this.CurrUser.UserName,
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim()))
|
||||
{
|
||||
newModel.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.ClassifyItemId))
|
||||
{
|
||||
newModel.ClassifyItemId = this.ClassifyItemId;
|
||||
BLL.QualityProblemClassifyItemService.UpdateClassifyItem(newModel);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newModel.ClassifyItemCode, newModel.ClassifyItemId, BLL.Const.QualityProblemClassifyMenuId, BLL.Const.BtnModify);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ClassifyItemId = SQLHelper.GetNewID(typeof(Model.Base_QualityProblemClassifyItem));
|
||||
newModel.ClassifyItemId = this.ClassifyItemId;
|
||||
BLL.QualityProblemClassifyItemService.AddClassifyItem(newModel);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newModel.ClassifyItemCode, newModel.ClassifyItemId, BLL.Const.QualityProblemClassifyMenuId, BLL.Const.BtnAdd);
|
||||
}
|
||||
if (isClose)
|
||||
{
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveData(true);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 验证质量问题分类是否存在
|
||||
/// <summary>
|
||||
/// 验证质量问题分类是否存在
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
var q = Funs.DB.Base_QualityProblemClassifyItem.FirstOrDefault(x => x.ClassifyId == this.ClassifyId && x.ClassifyItemCode == this.txtClassifyItemCode.Text.Trim() && (x.ClassifyItemId != this.ClassifyItemId || (this.ClassifyItemId == null && x.ClassifyItemId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
ShowNotify("输入的质量问题分类编号已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
var q2 = Funs.DB.Base_QualityProblemClassifyItem.FirstOrDefault(x => x.ClassifyId == this.ClassifyId && x.ClassifyItemName == this.txtClassifyItemName.Text.Trim() && (x.ClassifyItemId != this.ClassifyItemId || (this.ClassifyItemId == null && x.ClassifyItemId != null)));
|
||||
if (q2 != null)
|
||||
{
|
||||
ShowNotify("输入的质量问题分类已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
if (Request.Params["value"] == "0")
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.QualityProblemClassifyMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
134
SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifyItemSave.aspx.designer.cs
generated
Normal file
134
SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifyItemSave.aspx.designer.cs
generated
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
|
||||
|
||||
public partial class QualityProblemClassifyItemSave
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtClassifyItemCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtClassifyItemCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtClassifyItemName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtClassifyItemName;
|
||||
|
||||
/// <summary>
|
||||
/// txtCompileMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCompileMan;
|
||||
|
||||
/// <summary>
|
||||
/// txtCompileDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtCompileDate;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// lbTemp 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbTemp;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityProblemClassifySave.aspx.cs"
|
||||
Inherits="FineUIPro.Web.BaseInfo.QualityProblemClassifySave" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>编辑质量问题分类</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtClassifyCode" runat="server" Label="编号" Required="true"
|
||||
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtClassifyName" runat="server" Label="名称" Required="true"
|
||||
ShowRedStar="true" MaxLength="50" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using BLL;
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
public partial class QualityProblemClassifySave : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string ClassifyId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ClassifyId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ClassifyId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.GetButtonPower();
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
|
||||
this.ClassifyId = Request.QueryString["ClassifyId"];
|
||||
if (!string.IsNullOrEmpty(ClassifyId))
|
||||
{
|
||||
var q = BLL.QualityProblemClassifyService.GetClassifyById(ClassifyId);
|
||||
if (q != null)
|
||||
{
|
||||
this.txtClassifyCode.Text = q.ClassifyCode;
|
||||
this.txtClassifyName.Text = q.ClassifyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
var obj = Funs.DB.Base_QualityProblemClassify.FirstOrDefault(x => x.ClassifyCode == this.txtClassifyCode.Text.Trim() && x.ClassifyId != this.ClassifyId);
|
||||
if (obj != null)
|
||||
{
|
||||
ShowNotify("输入的编号已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
obj = Funs.DB.Base_QualityProblemClassify.FirstOrDefault(x => x.ClassifyName == this.txtClassifyName.Text.Trim() && x.ClassifyId != this.ClassifyId);
|
||||
if (obj != null)
|
||||
{
|
||||
ShowNotify("输入的名称已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Model.Base_QualityProblemClassify model = new Model.Base_QualityProblemClassify();
|
||||
model.ClassifyCode = this.txtClassifyCode.Text.Trim();
|
||||
model.ClassifyName = this.txtClassifyName.Text.Trim();
|
||||
if (!string.IsNullOrEmpty(this.ClassifyId))
|
||||
{
|
||||
model.ClassifyId = this.ClassifyId;
|
||||
BLL.QualityProblemClassifyService.UpdateClassify(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ClassifyId = SQLHelper.GetNewID(typeof(Model.Base_QualityProblemClassify));
|
||||
model.ClassifyId = this.ClassifyId;
|
||||
BLL.QualityProblemClassifyService.AddClassify(model);
|
||||
}
|
||||
// 2. 关闭本窗体,然后刷新父窗体
|
||||
// PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
// 2. 关闭本窗体,然后回发父窗体
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
//PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(trainingId) + ActiveWindow.GetHideReference());
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 验证质量问题分类名称是否存在
|
||||
/// <summary>
|
||||
/// 验证质量问题分类名称是否存在
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
var model = Funs.DB.Base_QualityProblemClassify.FirstOrDefault(x => x.ClassifyName == this.txtClassifyName.Text.Trim() && (x.ClassifyId != this.ClassifyId || this.ClassifyId == null));
|
||||
if (model != null)
|
||||
{
|
||||
ShowNotify("输入的名称已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.QualityProblemClassifyMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
|
||||
|
||||
public partial class QualityProblemClassifySave
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtClassifyCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtClassifyCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtClassifyName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtClassifyName;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityProblemNature.aspx.cs"
|
||||
Inherits="FineUIPro.Web.BaseInfo.QualityProblemNature" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>质量问题性质</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
|
||||
EnableCollapse="true" Width="300" Title="质量问题性质" TitleToolTip="质量问题性质" ShowBorder="true"
|
||||
ShowHeader="false" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft">
|
||||
<Items>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:Button ID="btnNew" Icon="Add" runat="server" OnClick="btnNew_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnEdit" Icon="Pencil" runat="server" OnClick="btnEdit_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" Icon="Delete" ConfirmText="确定删除当前数据?" OnClick="btnDelete_Click"
|
||||
runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
<f:Tree ID="trObj" EnableCollapse="true" ShowHeader="true" Title="质量问题性质" MinHeight="400px"
|
||||
OnNodeCommand="trObj_NodeCommand" AutoLeafIdentification="true" runat="server"
|
||||
EnableTextSelection="True">
|
||||
</f:Tree>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
|
||||
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="质量问题性质明细"
|
||||
TitleToolTip="质量问题性质明细" AutoScroll="true">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" Width="850px" ShowBorder="true" ShowHeader="false" EnableCollapse="true" ForceFit="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="NatureItemId" DataIDField="NatureItemId"
|
||||
AllowSorting="true" SortField="NatureItemCode" SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
|
||||
PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
|
||||
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True" EnableColumnLines="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar3" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox ID="txtNatureItemCode" runat="server" Label="编号" EmptyText="输入查询编号"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
|
||||
LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtNatureItemName" runat="server" Label="名称" EmptyText="输入查询名称"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
|
||||
LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnNewDetail" ToolTip="新增" Icon="Add" runat="server" OnClick="btnNewDetail_Click"
|
||||
Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center" />
|
||||
<f:RenderField Width="60px" ColumnID="NatureItemCode" DataField="NatureItemCode" FieldType="String"
|
||||
HeaderText="编号" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="180px" ColumnID="NatureItemType" DataField="NatureItemType" FieldType="String"
|
||||
HeaderText="性质归类" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="250px" ColumnID="NatureItemContent" DataField="NatureItemContent" FieldType="String"
|
||||
ExpandUnusedSpace="true" HeaderText="定义内容" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="160px" ColumnID="NatureItemDep" DataField="NatureItemDep" FieldType="String"
|
||||
HeaderText="职能部门" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</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>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="类别" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
|
||||
Width="700px" Height="600px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="详情" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window2_Close" IsModal="true"
|
||||
Width="700px" Height="600px">
|
||||
</f:Window>
|
||||
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
runat="server" Text="编辑" Hidden="true" Icon="Pencil">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
|
||||
Icon="Delete" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除"
|
||||
Hidden="true">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,430 @@
|
|||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
public partial class QualityProblemNature : PageBase
|
||||
{
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.GetButtonPower();
|
||||
InitTreeMenu();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载树
|
||||
/// <summary>
|
||||
/// 初始化树
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
trObj.Nodes.Clear();
|
||||
trObj.ShowBorder = false;
|
||||
trObj.ShowHeader = false;
|
||||
trObj.EnableIcons = true;
|
||||
trObj.AutoScroll = true;
|
||||
trObj.EnableSingleClickExpand = true;
|
||||
TreeNode rootNode = new TreeNode
|
||||
{
|
||||
Text = "质量问题性质",
|
||||
NodeID = "0",
|
||||
Expanded = true
|
||||
};
|
||||
this.trObj.Nodes.Add(rootNode);
|
||||
BoundTree(rootNode.Nodes, "0");
|
||||
}
|
||||
|
||||
private void BoundTree(TreeNodeCollection nodes, string menuId)
|
||||
{
|
||||
var dt = GetNewTraining();
|
||||
if (dt.Count() > 0)
|
||||
{
|
||||
TreeNode tn = null;
|
||||
foreach (var dr in dt)
|
||||
{
|
||||
tn = new TreeNode
|
||||
{
|
||||
Text = dr.NatureName,
|
||||
NodeID = dr.NatureId,
|
||||
EnableClickEvent = true,
|
||||
ToolTip = dr.NatureName
|
||||
};
|
||||
nodes.Add(tn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到菜单方法
|
||||
/// </summary>
|
||||
/// <param name="parentId"></param>
|
||||
/// <returns></returns>
|
||||
private List<Model.Base_QualityProblemNature> GetNewTraining()
|
||||
{
|
||||
return (from x in Funs.DB.Base_QualityProblemNature orderby x.NatureCode select x).ToList(); ;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 增加、修改、删除质量问题性质类别
|
||||
/// <summary>
|
||||
/// 增加质量问题性质类别
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trObj.SelectedNode != null)
|
||||
{
|
||||
if (this.trObj.SelectedNode.NodeID == "0") //根节点或者非末级节点,可以增加
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("QualityProblemNatureSave.aspx", this.trObj.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("选择的项已是末级!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改质量问题性质类别
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trObj.SelectedNode != null)
|
||||
{
|
||||
if (this.trObj.SelectedNode.NodeID != "0") //非根节点可以编辑
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("QualityProblemNatureSave.aspx?NatureId={0}", this.trObj.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("根节点无法编辑!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除质量问题性质类别
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trObj.SelectedNode != null)
|
||||
{
|
||||
var q = BLL.QualityProblemNatureService.GetNatureById(this.trObj.SelectedNode.NodeID);
|
||||
|
||||
if (q != null)
|
||||
{
|
||||
BLL.QualityProblemNatureService.DeleteNature(this.trObj.SelectedNode.NodeID);
|
||||
InitTreeMenu();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("存在下级菜单或已增加资源数据或者为内置项,不允许删除!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择删除项!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 树点击事件
|
||||
/// <summary>
|
||||
/// 树点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void trObj_NodeCommand(object sender, FineUIPro.TreeCommandEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 下拉触发事件
|
||||
|
||||
/// <summary>
|
||||
/// 适用岗位下拉触发事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drp_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 绑定数据
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (this.trObj.SelectedNode != null && !string.IsNullOrEmpty(this.trObj.SelectedNode.NodeID))
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("SELECT item.NatureItemId,item.NatureId,item.NatureItemCode,item.NatureItemType,item.NatureItemContent,item.NatureItemDep,item.CompileMan, item.CompileDate ");
|
||||
sb.Append("FROM dbo.Base_QualityProblemNatureItem AS item ");
|
||||
sb.Append("WHERE item.NatureId=@NatureId ");
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@NatureId", this.trObj.SelectedNode.NodeID)
|
||||
};
|
||||
if (!string.IsNullOrEmpty(this.txtNatureItemCode.Text.Trim()))
|
||||
{
|
||||
sb.Append("AND NatureItemCode LIKE @NatureItemCode ");
|
||||
listStr.Add(new SqlParameter("@NatureItemCode", "%" + this.txtNatureItemCode.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtNatureItemName.Text.Trim()))
|
||||
{
|
||||
sb.Append("AND NatureItemName LIKE @NatureItemName ");
|
||||
listStr.Add(new SqlParameter("@NatureItemName", "%" + this.txtNatureItemName.Text.Trim() + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(sb.ToString(), parameter);
|
||||
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 弹出窗关闭事件
|
||||
protected void Window1_Close(object sender, EventArgs e)
|
||||
{
|
||||
InitTreeMenu();
|
||||
}
|
||||
|
||||
protected void Window2_Close(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 排序、分页
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 增加、修改、删除明细信息
|
||||
#region 新增明细
|
||||
/// <summary>
|
||||
/// 新增明细
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNewDetail_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trObj.SelectedNode != null)
|
||||
{
|
||||
if (this.trObj.SelectedNode.Nodes.Count == 0)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("QualityProblemNatureItemSave.aspx?NatureId={0}", this.trObj.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择末级节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑明细
|
||||
protected void btnEditDetail_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 右键编辑事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑数据方法
|
||||
/// </summary>
|
||||
private void EditData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string Id = this.trObj.SelectedNode.Nodes.Count == 0 ? this.trObj.SelectedNode.NodeID : string.Empty;
|
||||
string itemId = Grid1.SelectedRowID;
|
||||
//itemId = itemId.Substring(0, itemId.IndexOf("_"));
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("QualityProblemNatureItemSave.aspx?NatureItemId={0}&NatureId={1}", itemId, Id, "编辑 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除明细
|
||||
// 删除数据
|
||||
protected void btnDeleteDetail_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DeleteData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 右键删除事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DeleteData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除方法
|
||||
/// </summary>
|
||||
private void DeleteData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
//rowID = rowID.Substring(0, rowID.IndexOf("_"));
|
||||
|
||||
var getD = BLL.QualityProblemNatureItemService.GetNatureItemById(rowID);
|
||||
if (getD != null)
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, getD.NatureItemCode, getD.NatureItemId, BLL.Const.QualityProblemNatureMenuId, BLL.Const.BtnDelete);
|
||||
BLL.QualityProblemNatureItemService.DeleteNatureItemById(rowID);
|
||||
}
|
||||
}
|
||||
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.QualityProblemNatureMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
this.btnNewDetail.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnEdit.Hidden = false;
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnDelete.Hidden = false;
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 导出
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.ClearContent();
|
||||
string filename = Funs.GetNewFileName();
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("质量问题性质" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
Response.ContentType = "application/excel";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid1.PageSize = Grid1.RecordCount;
|
||||
BindGrid();
|
||||
Response.Write(GetGridTableHtml(Grid1));
|
||||
Response.End();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,251 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
|
||||
|
||||
public partial class QualityProblemNature
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// panelLeftRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelLeftRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDelete;
|
||||
|
||||
/// <summary>
|
||||
/// trObj 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tree trObj;
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar3;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureItemCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureItemCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureItemName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureItemName;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnNewDetail 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNewDetail;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityProblemNatureItemSave.aspx.cs"
|
||||
Inherits="FineUIPro.Web.BaseInfo.QualityProblemNatureItemSave" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>编辑质量问题分类</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtNatureItemCode" runat="server" Label="编号" Required="true"
|
||||
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50" LabelWidth="120px" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtNatureItemType" runat="server" Label="归类" LabelWidth="120px" MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtNatureItemContent" runat="server" Label="定义内容" Required="true" LabelWidth="120px" ShowRedStar="true" MaxLength="500" Height="180px">
|
||||
</f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtNatureItemDep" runat="server" Label="职能部门" LabelWidth="120px" MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCompileMan" runat="server" Label="整理人" Readonly="true" MaxLength="50" LabelWidth="120px">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DatePicker runat="server" Label="整理时间" ID="txtCompileDate" LabelWidth="120px">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Label runat="server" ID="lbTemp">
|
||||
</f:Label>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using Model;
|
||||
using BLL;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
public partial class QualityProblemNatureItemSave : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string NatureItemId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["NatureItemId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["NatureItemId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 主表主键
|
||||
/// </summary>
|
||||
public string NatureId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["NatureId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["NatureId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.GetButtonPower();
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
|
||||
this.NatureItemId = Request.QueryString["NatureItemId"];
|
||||
this.NatureId = Request.QueryString["NatureId"];
|
||||
if (!string.IsNullOrEmpty(this.NatureItemId))
|
||||
{
|
||||
var model = QualityProblemNatureItemService.GetNatureItemById(this.NatureItemId);
|
||||
if (model != null)
|
||||
{
|
||||
this.NatureId = model.NatureId;
|
||||
this.txtNatureItemCode.Text = model.NatureItemCode;
|
||||
this.txtNatureItemType.Text = model.NatureItemType;
|
||||
this.txtNatureItemContent.Text = model.NatureItemContent;
|
||||
this.txtNatureItemDep.Text = model.NatureItemDep;
|
||||
this.txtCompileMan.Text = model.CompileManName;
|
||||
if (model.CompileDate != null)
|
||||
{
|
||||
txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", model.CompileDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtCompileMan.Text = this.CurrUser.UserName;
|
||||
//this.txtNatureItemName.Text = model.NatureName;
|
||||
//this.txtNatureItemCode.Text = SQLHelper.RunProcNewId("SpGetNewCode3", "Base_QualityProblemNatureItem", "NatureItemCode", model.NatureItemCode + "-");
|
||||
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
private void SaveData(bool isClose)
|
||||
{
|
||||
Model.Base_QualityProblemNatureItem newModel = new Base_QualityProblemNatureItem
|
||||
{
|
||||
NatureId = this.NatureId,
|
||||
NatureItemCode = this.txtNatureItemCode.Text.Trim(),
|
||||
NatureItemType = this.txtNatureItemType.Text.Trim(),
|
||||
NatureItemContent = this.txtNatureItemContent.Text.Trim(),
|
||||
NatureItemDep = this.txtNatureItemDep.Text.Trim(),
|
||||
CompileMan = this.CurrUser.UserId,
|
||||
CompileManName = this.CurrUser.UserName,
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim()))
|
||||
{
|
||||
newModel.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.NatureItemId))
|
||||
{
|
||||
newModel.NatureItemId = this.NatureItemId;
|
||||
BLL.QualityProblemNatureItemService.UpdateNatureItem(newModel);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newModel.NatureItemCode, newModel.NatureItemId, BLL.Const.QualityProblemNatureMenuId, BLL.Const.BtnModify);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.NatureItemId = SQLHelper.GetNewID(typeof(Model.Base_QualityProblemNatureItem));
|
||||
newModel.NatureItemId = this.NatureItemId;
|
||||
BLL.QualityProblemNatureItemService.AddNatureItem(newModel);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newModel.NatureItemCode, newModel.NatureItemId, BLL.Const.QualityProblemNatureMenuId, BLL.Const.BtnAdd);
|
||||
}
|
||||
if (isClose)
|
||||
{
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveData(true);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 验证安全问题分类是否存在
|
||||
/// <summary>
|
||||
/// 验证安全问题分类是否存在
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
var q = Funs.DB.Base_QualityProblemNatureItem.FirstOrDefault(x => x.NatureId == this.NatureId && x.NatureItemCode == this.txtNatureItemCode.Text.Trim() && (x.NatureItemId != this.NatureItemId || (this.NatureItemId == null && x.NatureItemId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
ShowNotify("输入的安全问题分类编号已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
//var q2 = Funs.DB.Base_QualityProblemNatureItem.FirstOrDefault(x => x.NatureId == this.NatureId && x.NatureItemName == this.txtNatureItemName.Text.Trim() && (x.NatureItemId != this.NatureItemId || (this.NatureItemId == null && x.NatureItemId != null)));
|
||||
//if (q2 != null)
|
||||
//{
|
||||
// ShowNotify("输入的安全问题分类已存在!", MessageBoxIcon.Warning);
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
if (Request.Params["value"] == "0")
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.QualityProblemNatureMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
|
||||
|
||||
public partial class QualityProblemNatureItemSave
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureItemCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureItemCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureItemType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureItemType;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureItemContent 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtNatureItemContent;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureItemDep 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureItemDep;
|
||||
|
||||
/// <summary>
|
||||
/// txtCompileMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCompileMan;
|
||||
|
||||
/// <summary>
|
||||
/// txtCompileDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtCompileDate;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// lbTemp 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbTemp;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityProblemNatureSave.aspx.cs"
|
||||
Inherits="FineUIPro.Web.BaseInfo.QualityProblemNatureSave" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>编辑质量问题性质</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtNatureCode" runat="server" Label="编号" Required="true"
|
||||
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtNatureName" runat="server" Label="名称" Required="true"
|
||||
ShowRedStar="true" MaxLength="50" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using BLL;
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
public partial class QualityProblemNatureSave : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string NatureId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["NatureId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["NatureId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.GetButtonPower();
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
|
||||
this.NatureId = Request.QueryString["NatureId"];
|
||||
if (!string.IsNullOrEmpty(NatureId))
|
||||
{
|
||||
var q = BLL.QualityProblemNatureService.GetNatureById(NatureId);
|
||||
if (q != null)
|
||||
{
|
||||
this.txtNatureCode.Text = q.NatureCode;
|
||||
this.txtNatureName.Text = q.NatureName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
var obj = Funs.DB.Base_QualityProblemNature.FirstOrDefault(x => x.NatureCode == this.txtNatureCode.Text.Trim() && x.NatureId != this.NatureId);
|
||||
if (obj != null)
|
||||
{
|
||||
ShowNotify("输入的编号已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
obj = Funs.DB.Base_QualityProblemNature.FirstOrDefault(x => x.NatureName == this.txtNatureName.Text.Trim() && x.NatureId != this.NatureId);
|
||||
if (obj != null)
|
||||
{
|
||||
ShowNotify("输入的名称已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Model.Base_QualityProblemNature model = new Model.Base_QualityProblemNature();
|
||||
model.NatureCode = this.txtNatureCode.Text.Trim();
|
||||
model.NatureName = this.txtNatureName.Text.Trim();
|
||||
if (!string.IsNullOrEmpty(this.NatureId))
|
||||
{
|
||||
model.NatureId = this.NatureId;
|
||||
BLL.QualityProblemNatureService.UpdateNature(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.NatureId = SQLHelper.GetNewID(typeof(Model.Base_QualityProblemNature));
|
||||
model.NatureId = this.NatureId;
|
||||
BLL.QualityProblemNatureService.AddNature(model);
|
||||
}
|
||||
// 2. 关闭本窗体,然后刷新父窗体
|
||||
// PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
// 2. 关闭本窗体,然后回发父窗体
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
//PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(trainingId) + ActiveWindow.GetHideReference());
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 验证安全问题性质名称是否存在
|
||||
/// <summary>
|
||||
/// 验证安全问题性质名称是否存在
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
var model = Funs.DB.Base_QualityProblemNature.FirstOrDefault(x => x.NatureName == this.txtNatureName.Text.Trim() && (x.NatureId != this.NatureId || this.NatureId == null));
|
||||
if (model != null)
|
||||
{
|
||||
ShowNotify("输入的名称已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.QualityProblemNatureMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
|
||||
|
||||
public partial class QualityProblemNatureSave
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureName;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
}
|
||||
}
|
||||
|
|
@ -73,31 +73,6 @@
|
|||
<f:RenderField Width="250px" ColumnID="ClassifyItemName" DataField="ClassifyItemName" FieldType="String"
|
||||
HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<%-- <f:TemplateField Width="120px" HeaderText="编号" HeaderTextAlign="Center" TextAlign="Center"
|
||||
SortField="CompanyTrainingItemCode" ColumnID="tfCompanyTrainingItemCode">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbCompanyTrainingItemCode" runat="server" Text='<%# Bind("CompanyTrainingItemCode") %>'
|
||||
ToolTip='<%#Bind("CompanyTrainingItemCode") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField Width="200px" HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left"
|
||||
SortField="CompanyTrainingItemName" ColumnID="tfCompanyTrainingItemName">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbCompanyTrainingItemName" runat="server" Text='<%# Bind("CompanyTrainingItemName") %>'
|
||||
ToolTip='<%#Bind("CompanyTrainingItemName") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField ColumnID="WorkPostNames" DataField="WorkPostNames" SortField="WorkPostNames"
|
||||
Width="300px" FieldType="String" HeaderText="适合岗位" HeaderTextAlign="Center" TextAlign="left">
|
||||
</f:RenderField>
|
||||
<f:TemplateField Width="100px" HeaderText="整理时间" HeaderTextAlign="Center" TextAlign="Center" ColumnID="tfCompileDate"
|
||||
SortField="CompileDate">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbCompileDate" runat="server" Text='<%# Bind("CompileDate","{0:yyyy-MM-dd}") %>'
|
||||
ToolTip='<%#Bind("CompileDate") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:BoundField runat="server" Hidden="true" ColumnID="hdUrl" DataField="AttachUrl"></f:BoundField>--%>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ namespace FineUIPro.Web.BaseInfo
|
|||
/// <returns></returns>
|
||||
private List<Model.Base_SafetyProblemClassify> GetNewTraining()
|
||||
{
|
||||
return (from x in Funs.DB.Base_SafetyProblemClassify orderby x.ClassifyCode select x).ToList(); ;
|
||||
return (from x in Funs.DB.Base_SafetyProblemClassify orderby x.ClassifyCode select x).ToList(); ;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
@ -329,10 +329,10 @@ namespace FineUIPro.Web.BaseInfo
|
|||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
string Id = this.trObj.SelectedNode.Nodes.Count == 0 ? this.trObj.SelectedNode.NodeID : string.Empty;
|
||||
string itemId = Grid1.SelectedRowID;
|
||||
//itemId = itemId.Substring(0, itemId.IndexOf("_"));
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("SafetyProblemClassifyItemSave.aspx?ClassifyItemId={0}", itemId, "编辑 - ")));
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("SafetyProblemClassifyItemSave.aspx?ClassifyItemId={0}&ClassifyId={1}", itemId, Id, "编辑 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
@ -429,113 +429,5 @@ namespace FineUIPro.Web.BaseInfo
|
|||
Response.End();
|
||||
}
|
||||
|
||||
#region 导出方法
|
||||
///// <summary>
|
||||
///// 导出方法
|
||||
///// </summary>
|
||||
///// <param name="grid"></param>
|
||||
///// <returns></returns>
|
||||
//public static string GetGridTableHtml(Grid grid, int count)
|
||||
//{
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
|
||||
// sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
|
||||
// sb.Append("<tr>");
|
||||
// foreach (GridColumn column in grid.Columns)
|
||||
// {
|
||||
// if (column.ColumnIndex < count)
|
||||
// {
|
||||
// sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
||||
// }
|
||||
// }
|
||||
// sb.Append("</tr>");
|
||||
// foreach (GridRow row in grid.Rows)
|
||||
// {
|
||||
// sb.Append("<tr>");
|
||||
// foreach (GridColumn column in grid.Columns)
|
||||
// {
|
||||
// if (column.ColumnIndex < count)
|
||||
// {
|
||||
// string html = row.Values[column.ColumnIndex].ToString();
|
||||
// if (column.ColumnID == "tfNumber" && (row.FindControl("lbNumber") as AspNet.Label) != null)
|
||||
// {
|
||||
// html = (row.FindControl("lbNumber") as AspNet.Label).Text;
|
||||
// }
|
||||
// if (column.ColumnID == "tfCompanyTrainingItemCode" && (row.FindControl("lbCompanyTrainingItemCode") as AspNet.Label) != null)
|
||||
// {
|
||||
// html = (row.FindControl("lbCompanyTrainingItemCode") as AspNet.Label).Text;
|
||||
// }
|
||||
// if (column.ColumnID == "tfCompanyTrainingItemName" && (row.FindControl("lbCompanyTrainingItemName") as AspNet.Label) != null)
|
||||
// {
|
||||
// html = (row.FindControl("lbCompanyTrainingItemName") as AspNet.Label).Text;
|
||||
// }
|
||||
// if (column.ColumnID == "tfCompileMan" && (row.FindControl("lbCompileMan") as AspNet.Label) != null)
|
||||
// {
|
||||
// html = (row.FindControl("lbCompileMan") as AspNet.Label).Text;
|
||||
// }
|
||||
// if (column.ColumnID == "tfCompileDate" && (row.FindControl("lbCompileDate") as AspNet.Label) != null)
|
||||
// {
|
||||
// html = (row.FindControl("lbCompileDate") as AspNet.Label).Text;
|
||||
// }
|
||||
// sb.AppendFormat("<td>{0}</td>", html);
|
||||
// }
|
||||
// }
|
||||
|
||||
// sb.Append("</tr>");
|
||||
// }
|
||||
|
||||
// sb.Append("</table>");
|
||||
|
||||
// return sb.ToString();
|
||||
//}
|
||||
#endregion
|
||||
|
||||
///// <summary>
|
||||
///// 行事件
|
||||
///// </summary>
|
||||
///// <param name="sender"></param>
|
||||
///// <param name="e"></param>
|
||||
//protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
//{
|
||||
// if (e.CommandName == "Attach")
|
||||
// {
|
||||
// string attUrl = this.Grid1.Rows[e.RowIndex].Values[this.Grid1.Columns.Count - 1].ToString();
|
||||
// try
|
||||
// {
|
||||
|
||||
// string url = Funs.RootPath + attUrl;
|
||||
// FileInfo info = new FileInfo(url);
|
||||
// string savedName = Path.GetFileName(url);
|
||||
// if (!info.Exists || string.IsNullOrEmpty(savedName))
|
||||
// {
|
||||
// url = Funs.RootPath + "Images//Null.jpg";
|
||||
// info = new FileInfo(url);
|
||||
// }
|
||||
|
||||
// if (Path.GetExtension(savedName) == ".mp4" || Path.GetExtension(savedName).ToLower() == ".mp4" || Path.GetExtension(savedName) == ".m4v")
|
||||
// {
|
||||
// string mpUrl = HttpUtility.UrlEncode(attUrl.Replace('\\', '/'));
|
||||
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/player.aspx?url={0}", attUrl.Replace('\\', '/'), "播放 - "), "播放视频", 700, 560));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// string fileName = Path.GetFileName(url);
|
||||
// long fileSize = info.Length;
|
||||
// System.Web.HttpContext.Current.Response.Clear();
|
||||
// //System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
|
||||
// System.Web.HttpContext.Current.Response.ContentType = "application/octet-stream";
|
||||
// System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
|
||||
// System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
|
||||
// System.Web.HttpContext.Current.Response.TransmitFile(url, 0, fileSize);
|
||||
// System.Web.HttpContext.Current.Response.Flush();
|
||||
// System.Web.HttpContext.Current.Response.End();
|
||||
// }
|
||||
// }
|
||||
// catch (Exception)
|
||||
// {
|
||||
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtClassifyItemCode" runat="server" Label="编号" Required="true"
|
||||
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50" LabelWidth="120px">
|
||||
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50" LabelWidth="120px" >
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
|
@ -62,46 +62,4 @@
|
|||
</f:Window>
|
||||
</form>
|
||||
</body>
|
||||
<script>
|
||||
<%-- var ddTestTraining = '<%= ddTestTraining.ClientID %>';
|
||||
var treeTestTraining = '<%= treeTestTraining.ClientID %>';--%>
|
||||
|
||||
function onPopPanelShow(event) {
|
||||
var nodes = this.getValue();
|
||||
|
||||
F.noEvent(function () {
|
||||
// 第二个参数true:是否递归调用子节点
|
||||
//F(treeTestTraining).checkNodes(nodes, true);
|
||||
|
||||
// 启用树控件的级联选择时,确保把树控件的选中值全部同步到下拉框
|
||||
syncToDropDownBox();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 将树控件的选中值同步到下拉框
|
||||
function syncToDropDownBox() {
|
||||
var values = [], texts = [];
|
||||
var checkedNodes = F(treeTestTraining).getCheckedNodes(true);
|
||||
$.each(checkedNodes, function (index, node) {
|
||||
debugger;
|
||||
values.push(node.id);
|
||||
texts.push(node.text);
|
||||
});
|
||||
|
||||
F(ddTestTraining).setValue(values, texts);
|
||||
}
|
||||
|
||||
F.ready(function () {
|
||||
|
||||
F(treeTestTraining).on('nodecheck', function (event, nodeId, checked) {
|
||||
// 加个延迟,等待复选框的级联选择完成
|
||||
window.setTimeout(function () {
|
||||
syncToDropDownBox();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ namespace FineUIPro.Web.BaseInfo
|
|||
{
|
||||
this.GetButtonPower();
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
//BoundTree(treeTestTraining.Nodes, "0");
|
||||
//BindEnumrableToDropDownList();
|
||||
|
||||
this.ClassifyItemId = Request.QueryString["ClassifyItemId"];
|
||||
this.ClassifyId = Request.QueryString["ClassifyId"];
|
||||
if (!string.IsNullOrEmpty(this.ClassifyItemId))
|
||||
|
|
@ -69,57 +68,16 @@ namespace FineUIPro.Web.BaseInfo
|
|||
}
|
||||
else
|
||||
{
|
||||
var model = BLL.CompanyTrainingService.GetCompanyTrainingById(this.ClassifyId);
|
||||
if (model != null)
|
||||
{
|
||||
this.txtCompileMan.Text = this.CurrUser.UserName;
|
||||
this.txtClassifyItemName.Text = model.CompanyTrainingName;
|
||||
//this.txtClassifyItemCode.Text = SQLHelper.RunProcNewId("SpGetNewCode3", "Base_SafetyProblemClassifyItem", "ClassifyItemCode", model.ClassifyItemCode + "-");
|
||||
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
}
|
||||
this.txtCompileMan.Text = this.CurrUser.UserName;
|
||||
//this.txtClassifyItemName.Text = model.ClassifyName;
|
||||
//this.txtClassifyItemCode.Text = SQLHelper.RunProcNewId("SpGetNewCode3", "Base_SafetyProblemClassifyItem", "ClassifyItemCode", model.ClassifyItemCode + "-");
|
||||
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
private List<Model.Training_TestTraining> GetNewTraining(string parentId)
|
||||
{
|
||||
return (from x in Funs.DB.Training_TestTraining
|
||||
where x.SupTrainingId == parentId
|
||||
orderby x.TrainingCode
|
||||
select x).ToList();
|
||||
}
|
||||
//private void BoundTree(TreeNodeCollection nodes, string parentId)
|
||||
//{
|
||||
// var dt = GetNewTraining(parentId);
|
||||
// if (dt.Count() > 0)
|
||||
// {
|
||||
// TreeNode tn = null;
|
||||
// foreach (var dr in dt)
|
||||
// {
|
||||
// string name = dr.TrainingName;
|
||||
// if (!string.IsNullOrEmpty(dr.TrainingCode))
|
||||
// {
|
||||
// name = "[" + dr.TrainingCode + "]" + dr.TrainingName;
|
||||
// }
|
||||
// tn = new TreeNode
|
||||
// {
|
||||
|
||||
// Text = name,
|
||||
// NodeID = dr.TrainingId,
|
||||
// EnableClickEvent = true,
|
||||
// ToolTip = dr.TrainingName
|
||||
// };
|
||||
// nodes.Add(tn);
|
||||
// ///是否存在下级节点
|
||||
// var sup = Funs.DB.Training_TestTraining.FirstOrDefault(x => x.SupTrainingId == tn.NodeID);
|
||||
// if (sup != null)
|
||||
// {
|
||||
// BoundTree(tn.Nodes, tn.NodeID);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
|
|
@ -129,6 +87,7 @@ namespace FineUIPro.Web.BaseInfo
|
|||
{
|
||||
Model.Base_SafetyProblemClassifyItem newModel = new Base_SafetyProblemClassifyItem
|
||||
{
|
||||
ClassifyId = this.ClassifyId,
|
||||
ClassifyItemCode = this.txtClassifyItemCode.Text.Trim(),
|
||||
ClassifyItemName = this.txtClassifyItemName.Text.Trim(),
|
||||
CompileMan = this.CurrUser.UserId,
|
||||
|
|
@ -147,7 +106,6 @@ namespace FineUIPro.Web.BaseInfo
|
|||
}
|
||||
else
|
||||
{
|
||||
newModel.ClassifyId = this.ClassifyId;
|
||||
this.ClassifyItemId = SQLHelper.GetNewID(typeof(Model.Base_SafetyProblemClassifyItem));
|
||||
newModel.ClassifyItemId = this.ClassifyItemId;
|
||||
BLL.SafetyProblemClassifyItemService.AddClassifyItem(newModel);
|
||||
|
|
@ -178,37 +136,19 @@ namespace FineUIPro.Web.BaseInfo
|
|||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
var q = Funs.DB.Base_SafetyProblemClassifyItem.FirstOrDefault(x => x.ClassifyId == this.ClassifyId && x.ClassifyItemName == this.txtClassifyItemName.Text.Trim() && (x.ClassifyItemId != this.ClassifyItemId || (this.ClassifyItemId == null && x.ClassifyItemId != null)));
|
||||
var q = Funs.DB.Base_SafetyProblemClassifyItem.FirstOrDefault(x => x.ClassifyId == this.ClassifyId && x.ClassifyItemCode == this.txtClassifyItemCode.Text.Trim() && (x.ClassifyItemId != this.ClassifyItemId || (this.ClassifyItemId == null && x.ClassifyItemId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
ShowNotify("输入的安全问题分类编号已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
var q2 = Funs.DB.Base_SafetyProblemClassifyItem.FirstOrDefault(x => x.ClassifyId == this.ClassifyId && x.ClassifyItemName == this.txtClassifyItemName.Text.Trim() && (x.ClassifyItemId != this.ClassifyItemId || (this.ClassifyItemId == null && x.ClassifyItemId != null)));
|
||||
if (q2 != null)
|
||||
{
|
||||
ShowNotify("输入的安全问题分类已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
//#region 上传附件资源
|
||||
///// <summary>
|
||||
///// 上传附件资源
|
||||
///// </summary>
|
||||
///// <param name="sender"></param>
|
||||
///// <param name="e"></param>
|
||||
//protected void btnUploadResources_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// if (this.btnSave.Hidden)
|
||||
// {
|
||||
// PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CompanyTraining&menuId={1}&type=-1", ClassifyItemId, BLL.Const.SafetyProblemClassifyMenuId)));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (string.IsNullOrEmpty(this.ClassifyItemId))
|
||||
// {
|
||||
// SaveData(false);
|
||||
// }
|
||||
// PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CompanyTraining&menuId={1}", ClassifyItemId, BLL.Const.SafetyProblemClassifyMenuId)));
|
||||
// }
|
||||
//}
|
||||
//#endregion
|
||||
|
||||
#region 按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
|
|
|
|||
|
|
@ -0,0 +1,135 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProblemNature.aspx.cs"
|
||||
Inherits="FineUIPro.Web.BaseInfo.SafetyProblemNature" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>安全问题性质</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
|
||||
EnableCollapse="true" Width="300" Title="安全问题性质" TitleToolTip="安全问题性质" ShowBorder="true"
|
||||
ShowHeader="false" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft">
|
||||
<Items>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:Button ID="btnNew" Icon="Add" runat="server" OnClick="btnNew_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnEdit" Icon="Pencil" runat="server" OnClick="btnEdit_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" Icon="Delete" ConfirmText="确定删除当前数据?" OnClick="btnDelete_Click"
|
||||
runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
<f:Tree ID="trObj" EnableCollapse="true" ShowHeader="true" Title="安全问题性质" MinHeight="400px"
|
||||
OnNodeCommand="trObj_NodeCommand" AutoLeafIdentification="true" runat="server"
|
||||
EnableTextSelection="True">
|
||||
</f:Tree>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
|
||||
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="安全问题性质明细"
|
||||
TitleToolTip="安全问题性质明细" AutoScroll="true">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" Width="850px" ShowBorder="true" ShowHeader="false" EnableCollapse="true" ForceFit="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="NatureItemId" DataIDField="NatureItemId"
|
||||
AllowSorting="true" SortField="NatureItemCode" SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
|
||||
PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
|
||||
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True" EnableColumnLines="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar3" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox ID="txtNatureItemCode" runat="server" Label="编号" EmptyText="输入查询编号"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
|
||||
LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtNatureItemName" runat="server" Label="名称" EmptyText="输入查询名称"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
|
||||
LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnNewDetail" ToolTip="新增" Icon="Add" runat="server" OnClick="btnNewDetail_Click"
|
||||
Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center" />
|
||||
<f:RenderField Width="60px" ColumnID="NatureItemCode" DataField="NatureItemCode" FieldType="String"
|
||||
HeaderText="编号" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="180px" ColumnID="NatureItemType" DataField="NatureItemType" FieldType="String"
|
||||
HeaderText="性质归类" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="250px" ColumnID="NatureItemContent" DataField="NatureItemContent" FieldType="String"
|
||||
ExpandUnusedSpace="true" HeaderText="定义内容" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="160px" ColumnID="NatureItemDep" DataField="NatureItemDep" FieldType="String"
|
||||
HeaderText="职能部门" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</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>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="类别" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
|
||||
Width="700px" Height="600px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="详情" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window2_Close" IsModal="true"
|
||||
Width="700px" Height="600px">
|
||||
</f:Window>
|
||||
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
runat="server" Text="编辑" Hidden="true" Icon="Pencil">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
|
||||
Icon="Delete" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除"
|
||||
Hidden="true">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,430 @@
|
|||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
public partial class SafetyProblemNature : PageBase
|
||||
{
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.GetButtonPower();
|
||||
InitTreeMenu();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载树
|
||||
/// <summary>
|
||||
/// 初始化树
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
trObj.Nodes.Clear();
|
||||
trObj.ShowBorder = false;
|
||||
trObj.ShowHeader = false;
|
||||
trObj.EnableIcons = true;
|
||||
trObj.AutoScroll = true;
|
||||
trObj.EnableSingleClickExpand = true;
|
||||
TreeNode rootNode = new TreeNode
|
||||
{
|
||||
Text = "安全问题性质",
|
||||
NodeID = "0",
|
||||
Expanded = true
|
||||
};
|
||||
this.trObj.Nodes.Add(rootNode);
|
||||
BoundTree(rootNode.Nodes, "0");
|
||||
}
|
||||
|
||||
private void BoundTree(TreeNodeCollection nodes, string menuId)
|
||||
{
|
||||
var dt = GetNewTraining();
|
||||
if (dt.Count() > 0)
|
||||
{
|
||||
TreeNode tn = null;
|
||||
foreach (var dr in dt)
|
||||
{
|
||||
tn = new TreeNode
|
||||
{
|
||||
Text = dr.NatureName,
|
||||
NodeID = dr.NatureId,
|
||||
EnableClickEvent = true,
|
||||
ToolTip = dr.NatureName
|
||||
};
|
||||
nodes.Add(tn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到菜单方法
|
||||
/// </summary>
|
||||
/// <param name="parentId"></param>
|
||||
/// <returns></returns>
|
||||
private List<Model.Base_SafetyProblemNature> GetNewTraining()
|
||||
{
|
||||
return (from x in Funs.DB.Base_SafetyProblemNature orderby x.NatureCode select x).ToList(); ;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 增加、修改、删除安全问题性质类别
|
||||
/// <summary>
|
||||
/// 增加安全问题性质类别
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trObj.SelectedNode != null)
|
||||
{
|
||||
if (this.trObj.SelectedNode.NodeID == "0") //根节点或者非末级节点,可以增加
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyProblemNatureSave.aspx", this.trObj.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("选择的项已是末级!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安全问题性质类别
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trObj.SelectedNode != null)
|
||||
{
|
||||
if (this.trObj.SelectedNode.NodeID != "0") //非根节点可以编辑
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyProblemNatureSave.aspx?NatureId={0}", this.trObj.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("根节点无法编辑!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除安全问题性质类别
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trObj.SelectedNode != null)
|
||||
{
|
||||
var q = BLL.SafetyProblemNatureService.GetNatureById(this.trObj.SelectedNode.NodeID);
|
||||
|
||||
if (q != null)
|
||||
{
|
||||
BLL.SafetyProblemNatureService.DeleteNature(this.trObj.SelectedNode.NodeID);
|
||||
InitTreeMenu();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("存在下级菜单或已增加资源数据或者为内置项,不允许删除!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择删除项!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 树点击事件
|
||||
/// <summary>
|
||||
/// 树点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void trObj_NodeCommand(object sender, FineUIPro.TreeCommandEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 下拉触发事件
|
||||
|
||||
/// <summary>
|
||||
/// 适用岗位下拉触发事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drp_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 绑定数据
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (this.trObj.SelectedNode != null && !string.IsNullOrEmpty(this.trObj.SelectedNode.NodeID))
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("SELECT item.NatureItemId,item.NatureId,item.NatureItemCode,item.NatureItemType,item.NatureItemContent,item.NatureItemDep,item.CompileMan, item.CompileDate ");
|
||||
sb.Append("FROM dbo.Base_SafetyProblemNatureItem AS item ");
|
||||
sb.Append("WHERE item.NatureId=@NatureId ");
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@NatureId", this.trObj.SelectedNode.NodeID)
|
||||
};
|
||||
if (!string.IsNullOrEmpty(this.txtNatureItemCode.Text.Trim()))
|
||||
{
|
||||
sb.Append("AND NatureItemCode LIKE @NatureItemCode ");
|
||||
listStr.Add(new SqlParameter("@NatureItemCode", "%" + this.txtNatureItemCode.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtNatureItemName.Text.Trim()))
|
||||
{
|
||||
sb.Append("AND NatureItemName LIKE @NatureItemName ");
|
||||
listStr.Add(new SqlParameter("@NatureItemName", "%" + this.txtNatureItemName.Text.Trim() + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(sb.ToString(), parameter);
|
||||
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 弹出窗关闭事件
|
||||
protected void Window1_Close(object sender, EventArgs e)
|
||||
{
|
||||
InitTreeMenu();
|
||||
}
|
||||
|
||||
protected void Window2_Close(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 排序、分页
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 增加、修改、删除明细信息
|
||||
#region 新增明细
|
||||
/// <summary>
|
||||
/// 新增明细
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNewDetail_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trObj.SelectedNode != null)
|
||||
{
|
||||
if (this.trObj.SelectedNode.Nodes.Count == 0)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("SafetyProblemNatureItemSave.aspx?NatureId={0}", this.trObj.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择末级节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑明细
|
||||
protected void btnEditDetail_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 右键编辑事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑数据方法
|
||||
/// </summary>
|
||||
private void EditData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string Id = this.trObj.SelectedNode.Nodes.Count == 0 ? this.trObj.SelectedNode.NodeID : string.Empty;
|
||||
string itemId = Grid1.SelectedRowID;
|
||||
//itemId = itemId.Substring(0, itemId.IndexOf("_"));
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("SafetyProblemNatureItemSave.aspx?NatureItemId={0}&NatureId={1}", itemId, Id, "编辑 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除明细
|
||||
// 删除数据
|
||||
protected void btnDeleteDetail_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DeleteData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 右键删除事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DeleteData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除方法
|
||||
/// </summary>
|
||||
private void DeleteData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
//rowID = rowID.Substring(0, rowID.IndexOf("_"));
|
||||
|
||||
var getD = BLL.SafetyProblemNatureItemService.GetNatureItemById(rowID);
|
||||
if (getD != null)
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, getD.NatureItemCode, getD.NatureItemId, BLL.Const.SafetyProblemNatureMenuId, BLL.Const.BtnDelete);
|
||||
BLL.SafetyProblemNatureItemService.DeleteNatureItemById(rowID);
|
||||
}
|
||||
}
|
||||
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SafetyProblemNatureMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
this.btnNewDetail.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnEdit.Hidden = false;
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnDelete.Hidden = false;
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 导出
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.ClearContent();
|
||||
string filename = Funs.GetNewFileName();
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("安全问题性质" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
Response.ContentType = "application/excel";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid1.PageSize = Grid1.RecordCount;
|
||||
BindGrid();
|
||||
Response.Write(GetGridTableHtml(Grid1));
|
||||
Response.End();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,251 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
|
||||
|
||||
public partial class SafetyProblemNature
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// panelLeftRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelLeftRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDelete;
|
||||
|
||||
/// <summary>
|
||||
/// trObj 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tree trObj;
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar3;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureItemCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureItemCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureItemName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureItemName;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnNewDetail 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNewDetail;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProblemNatureItemSave.aspx.cs"
|
||||
Inherits="FineUIPro.Web.BaseInfo.SafetyProblemNatureItemSave" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>编辑安全问题分类</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtNatureItemCode" runat="server" Label="编号" Required="true"
|
||||
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50" LabelWidth="120px" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtNatureItemType" runat="server" Label="归类" LabelWidth="120px" MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtNatureItemContent" runat="server" Label="定义内容" Required="true" LabelWidth="120px" ShowRedStar="true" MaxLength="500" Height="180px">
|
||||
</f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtNatureItemDep" runat="server" Label="职能部门" LabelWidth="120px" MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCompileMan" runat="server" Label="整理人" Readonly="true" MaxLength="50" LabelWidth="120px">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DatePicker runat="server" Label="整理时间" ID="txtCompileDate" LabelWidth="120px">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Label runat="server" ID="lbTemp">
|
||||
</f:Label>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using Model;
|
||||
using BLL;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
public partial class SafetyProblemNatureItemSave : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string NatureItemId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["NatureItemId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["NatureItemId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 主表主键
|
||||
/// </summary>
|
||||
public string NatureId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["NatureId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["NatureId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.GetButtonPower();
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
|
||||
this.NatureItemId = Request.QueryString["NatureItemId"];
|
||||
this.NatureId = Request.QueryString["NatureId"];
|
||||
if (!string.IsNullOrEmpty(this.NatureItemId))
|
||||
{
|
||||
var model = SafetyProblemNatureItemService.GetNatureItemById(this.NatureItemId);
|
||||
if (model != null)
|
||||
{
|
||||
this.NatureId = model.NatureId;
|
||||
this.txtNatureItemCode.Text = model.NatureItemCode;
|
||||
this.txtNatureItemType.Text = model.NatureItemType;
|
||||
this.txtNatureItemContent.Text = model.NatureItemContent;
|
||||
this.txtNatureItemDep.Text = model.NatureItemDep;
|
||||
this.txtCompileMan.Text = model.CompileManName;
|
||||
if (model.CompileDate != null)
|
||||
{
|
||||
txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", model.CompileDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtCompileMan.Text = this.CurrUser.UserName;
|
||||
//this.txtNatureItemName.Text = model.NatureName;
|
||||
//this.txtNatureItemCode.Text = SQLHelper.RunProcNewId("SpGetNewCode3", "Base_SafetyProblemNatureItem", "NatureItemCode", model.NatureItemCode + "-");
|
||||
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
private void SaveData(bool isClose)
|
||||
{
|
||||
Model.Base_SafetyProblemNatureItem newModel = new Base_SafetyProblemNatureItem
|
||||
{
|
||||
NatureId = this.NatureId,
|
||||
NatureItemCode = this.txtNatureItemCode.Text.Trim(),
|
||||
NatureItemType = this.txtNatureItemType.Text.Trim(),
|
||||
NatureItemContent = this.txtNatureItemContent.Text.Trim(),
|
||||
NatureItemDep = this.txtNatureItemDep.Text.Trim(),
|
||||
CompileMan = this.CurrUser.UserId,
|
||||
CompileManName = this.CurrUser.UserName,
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim()))
|
||||
{
|
||||
newModel.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.NatureItemId))
|
||||
{
|
||||
newModel.NatureItemId = this.NatureItemId;
|
||||
BLL.SafetyProblemNatureItemService.UpdateNatureItem(newModel);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newModel.NatureItemCode, newModel.NatureItemId, BLL.Const.SafetyProblemNatureMenuId, BLL.Const.BtnModify);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.NatureItemId = SQLHelper.GetNewID(typeof(Model.Base_SafetyProblemNatureItem));
|
||||
newModel.NatureItemId = this.NatureItemId;
|
||||
BLL.SafetyProblemNatureItemService.AddNatureItem(newModel);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newModel.NatureItemCode, newModel.NatureItemId, BLL.Const.SafetyProblemNatureMenuId, BLL.Const.BtnAdd);
|
||||
}
|
||||
if (isClose)
|
||||
{
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveData(true);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 验证安全问题分类是否存在
|
||||
/// <summary>
|
||||
/// 验证安全问题分类是否存在
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
var q = Funs.DB.Base_SafetyProblemNatureItem.FirstOrDefault(x => x.NatureId == this.NatureId && x.NatureItemCode == this.txtNatureItemCode.Text.Trim() && (x.NatureItemId != this.NatureItemId || (this.NatureItemId == null && x.NatureItemId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
ShowNotify("输入的安全问题分类编号已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
//var q2 = Funs.DB.Base_SafetyProblemNatureItem.FirstOrDefault(x => x.NatureId == this.NatureId && x.NatureItemName == this.txtNatureItemName.Text.Trim() && (x.NatureItemId != this.NatureItemId || (this.NatureItemId == null && x.NatureItemId != null)));
|
||||
//if (q2 != null)
|
||||
//{
|
||||
// ShowNotify("输入的安全问题分类已存在!", MessageBoxIcon.Warning);
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
if (Request.Params["value"] == "0")
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SafetyProblemNatureMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
|
||||
|
||||
public partial class SafetyProblemNatureItemSave
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureItemCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureItemCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureItemType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureItemType;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureItemContent 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtNatureItemContent;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureItemDep 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureItemDep;
|
||||
|
||||
/// <summary>
|
||||
/// txtCompileMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCompileMan;
|
||||
|
||||
/// <summary>
|
||||
/// txtCompileDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtCompileDate;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// lbTemp 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbTemp;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProblemNatureSave.aspx.cs"
|
||||
Inherits="FineUIPro.Web.BaseInfo.SafetyProblemNatureSave" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>编辑安全问题性质</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtNatureCode" runat="server" Label="编号" Required="true"
|
||||
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtNatureName" runat="server" Label="名称" Required="true"
|
||||
ShowRedStar="true" MaxLength="50" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using BLL;
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
public partial class SafetyProblemNatureSave : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string NatureId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["NatureId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["NatureId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.GetButtonPower();
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
|
||||
this.NatureId = Request.QueryString["NatureId"];
|
||||
if (!string.IsNullOrEmpty(NatureId))
|
||||
{
|
||||
var q = BLL.SafetyProblemNatureService.GetNatureById(NatureId);
|
||||
if (q != null)
|
||||
{
|
||||
this.txtNatureCode.Text = q.NatureCode;
|
||||
this.txtNatureName.Text = q.NatureName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
var obj = Funs.DB.Base_SafetyProblemNature.FirstOrDefault(x => x.NatureCode == this.txtNatureCode.Text.Trim() && x.NatureId != this.NatureId);
|
||||
if (obj != null)
|
||||
{
|
||||
ShowNotify("输入的编号已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
obj = Funs.DB.Base_SafetyProblemNature.FirstOrDefault(x => x.NatureName == this.txtNatureName.Text.Trim() && x.NatureId != this.NatureId);
|
||||
if (obj != null)
|
||||
{
|
||||
ShowNotify("输入的名称已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Model.Base_SafetyProblemNature model = new Model.Base_SafetyProblemNature();
|
||||
model.NatureCode = this.txtNatureCode.Text.Trim();
|
||||
model.NatureName = this.txtNatureName.Text.Trim();
|
||||
if (!string.IsNullOrEmpty(this.NatureId))
|
||||
{
|
||||
model.NatureId = this.NatureId;
|
||||
BLL.SafetyProblemNatureService.UpdateNature(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.NatureId = SQLHelper.GetNewID(typeof(Model.Base_SafetyProblemNature));
|
||||
model.NatureId = this.NatureId;
|
||||
BLL.SafetyProblemNatureService.AddNature(model);
|
||||
}
|
||||
// 2. 关闭本窗体,然后刷新父窗体
|
||||
// PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
// 2. 关闭本窗体,然后回发父窗体
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
//PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(trainingId) + ActiveWindow.GetHideReference());
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 验证安全问题性质名称是否存在
|
||||
/// <summary>
|
||||
/// 验证安全问题性质名称是否存在
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
var model = Funs.DB.Base_SafetyProblemNature.FirstOrDefault(x => x.NatureName == this.txtNatureName.Text.Trim() && (x.NatureId != this.NatureId || this.NatureId == null));
|
||||
if (model != null)
|
||||
{
|
||||
ShowNotify("输入的名称已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SafetyProblemNatureMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
|
||||
|
||||
public partial class SafetyProblemNatureSave
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtNatureName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtNatureName;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
}
|
||||
}
|
||||
|
|
@ -244,6 +244,15 @@
|
|||
<Content Include="BaseInfo\CNProfessional.aspx" />
|
||||
<Content Include="BaseInfo\CNProfessionalEdit.aspx" />
|
||||
<Content Include="BaseInfo\CNProfessionalView.aspx" />
|
||||
<Content Include="BaseInfo\QualityProblemNature.aspx" />
|
||||
<Content Include="BaseInfo\QualityProblemNatureItemSave.aspx" />
|
||||
<Content Include="BaseInfo\QualityProblemNatureSave.aspx" />
|
||||
<Content Include="BaseInfo\QualityProblemClassify.aspx" />
|
||||
<Content Include="BaseInfo\QualityProblemClassifyItemSave.aspx" />
|
||||
<Content Include="BaseInfo\QualityProblemClassifySave.aspx" />
|
||||
<Content Include="BaseInfo\SafetyProblemNatureSave.aspx" />
|
||||
<Content Include="BaseInfo\SafetyProblemNature.aspx" />
|
||||
<Content Include="BaseInfo\SafetyProblemNatureItemSave.aspx" />
|
||||
<Content Include="BaseInfo\SafetyProblemClassifyItemSave.aspx" />
|
||||
<Content Include="BaseInfo\SafetyProblemClassifySave.aspx" />
|
||||
<Content Include="BaseInfo\SafetyProblemClassify.aspx" />
|
||||
|
|
@ -7763,6 +7772,69 @@
|
|||
<Compile Include="BaseInfo\CNProfessionalView.aspx.designer.cs">
|
||||
<DependentUpon>CNProfessionalView.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\QualityProblemNature.aspx.cs">
|
||||
<DependentUpon>QualityProblemNature.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\QualityProblemNature.aspx.designer.cs">
|
||||
<DependentUpon>QualityProblemNature.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\QualityProblemNatureItemSave.aspx.cs">
|
||||
<DependentUpon>QualityProblemNatureItemSave.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\QualityProblemNatureItemSave.aspx.designer.cs">
|
||||
<DependentUpon>QualityProblemNatureItemSave.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\QualityProblemNatureSave.aspx.cs">
|
||||
<DependentUpon>QualityProblemNatureSave.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\QualityProblemNatureSave.aspx.designer.cs">
|
||||
<DependentUpon>QualityProblemNatureSave.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\QualityProblemClassify.aspx.cs">
|
||||
<DependentUpon>QualityProblemClassify.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\QualityProblemClassify.aspx.designer.cs">
|
||||
<DependentUpon>QualityProblemClassify.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\QualityProblemClassifyItemSave.aspx.cs">
|
||||
<DependentUpon>QualityProblemClassifyItemSave.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\QualityProblemClassifyItemSave.aspx.designer.cs">
|
||||
<DependentUpon>QualityProblemClassifyItemSave.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\QualityProblemClassifySave.aspx.cs">
|
||||
<DependentUpon>QualityProblemClassifySave.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\QualityProblemClassifySave.aspx.designer.cs">
|
||||
<DependentUpon>QualityProblemClassifySave.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\SafetyProblemNatureSave.aspx.cs">
|
||||
<DependentUpon>SafetyProblemNatureSave.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\SafetyProblemNatureSave.aspx.designer.cs">
|
||||
<DependentUpon>SafetyProblemNatureSave.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\SafetyProblemNature.aspx.cs">
|
||||
<DependentUpon>SafetyProblemNature.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\SafetyProblemNature.aspx.designer.cs">
|
||||
<DependentUpon>SafetyProblemNature.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\SafetyProblemNatureItemSave.aspx.cs">
|
||||
<DependentUpon>SafetyProblemNatureItemSave.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\SafetyProblemNatureItemSave.aspx.designer.cs">
|
||||
<DependentUpon>SafetyProblemNatureItemSave.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\SafetyProblemClassifyItemSave.aspx.cs">
|
||||
<DependentUpon>SafetyProblemClassifyItemSave.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
|
|
|||
|
|
@ -302,10 +302,10 @@ namespace FineUIPro.Web
|
|||
{
|
||||
return "用户名或密码错误,请重新输入";
|
||||
}
|
||||
sysUser.RawPassword = "XJYJ." + idcard.Substring(idcard.Length - 4, 4);
|
||||
sysUser.RawPassword = Const.PasswordPrefixValue + idcard.Substring(idcard.Length - 4, 4);
|
||||
sysUser.Password = Funs.EncryptionPassword(sysUser.RawPassword);
|
||||
Funs.DB.SubmitChanges();
|
||||
return "重置成功,默认密码是:XJYJ+'.'+身份证号码后四位,请登录";
|
||||
return $"重置成功,默认密码是:{Const.PasswordPrefixValue}+身份证号码后四位,请登录";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@
|
|||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<%--<f:RenderField Width="180px" ColumnID="ProjectName" DataField="ProjectName" FieldType="String" HeaderText="项目名称" TextAlign="Center" HeaderTextAlign="Center" Locked="true">
|
||||
</f:RenderField>--%>
|
||||
<f:RenderField Width="180px" ColumnID="UnitProjectName" DataField="UnitProjectName" FieldType="String" HeaderText="单位项目名称" TextAlign="Center" HeaderTextAlign="Center" Locked="true">
|
||||
</f:RenderField>--%><%--单位项目名称--%>
|
||||
<f:RenderField Width="180px" ColumnID="UnitProjectName" DataField="UnitProjectName" FieldType="String" HeaderText="单位名称/部门名称" TextAlign="Center" HeaderTextAlign="Center" Locked="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="180px" ColumnID="WorkPlace" DataField="WorkPlace" SortField="WorkPlace" FieldType="String" HeaderText="活动区域/场所/设备" TextAlign="Left" HeaderTextAlign="Center" Locked="true">
|
||||
</f:RenderField>
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@
|
|||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<%--<f:RenderField Width="180px" ColumnID="ProjectName" DataField="ProjectName" FieldType="String" HeaderText="项目名称" TextAlign="Center" HeaderTextAlign="Center" Locked="true">
|
||||
</f:RenderField>--%>
|
||||
<f:RenderField Width="180px" ColumnID="UnitProjectName" DataField="UnitProjectName" FieldType="String" HeaderText="单位项目名称" TextAlign="Center" HeaderTextAlign="Center" Locked="true">
|
||||
</f:RenderField>--%><%--单位项目名称--%>
|
||||
<f:RenderField Width="180px" ColumnID="UnitProjectName" DataField="UnitProjectName" FieldType="String" HeaderText="单位名称/部门名称" TextAlign="Center" HeaderTextAlign="Center" Locked="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="180px" ColumnID="WorkPlace" DataField="WorkPlace" SortField="WorkPlace" FieldType="String" HeaderText="活动区域/场所/设备" TextAlign="Left" HeaderTextAlign="Center" Locked="true">
|
||||
</f:RenderField>
|
||||
|
|
|
|||
1317
SGGL/Model/Model.cs
1317
SGGL/Model/Model.cs
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue