diff --git a/DataBase/版本日志/SGGLDB_V2026-04-25-xiaj(不符合项基础设置).sql b/DataBase/版本日志/SGGLDB_V2026-04-25-xiaj(不符合项基础设置).sql index 52a30ad4..0bf25f02 100644 --- a/DataBase/版本日志/SGGLDB_V2026-04-25-xiaj(不符合项基础设置).sql +++ b/DataBase/版本日志/SGGLDB_V2026-04-25-xiaj(不符合项基础设置).sql @@ -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 + + + + diff --git a/SGGL/BLL/API/HSSE/APIBonusScoreSelfManagementService.cs b/SGGL/BLL/API/HSSE/APIBonusScoreSelfManagementService.cs index 914144e6..2eb63851 100644 --- a/SGGL/BLL/API/HSSE/APIBonusScoreSelfManagementService.cs +++ b/SGGL/BLL/API/HSSE/APIBonusScoreSelfManagementService.cs @@ -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(); diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 7ca7c572..02e610d7 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -255,7 +255,13 @@ + + + + + + diff --git a/SGGL/BLL/BaseInfo/QualityProblemClassifyItemService.cs b/SGGL/BLL/BaseInfo/QualityProblemClassifyItemService.cs new file mode 100644 index 00000000..f6b5f629 --- /dev/null +++ b/SGGL/BLL/BaseInfo/QualityProblemClassifyItemService.cs @@ -0,0 +1,127 @@ +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + /// + /// 质量问题分类 + /// + public class QualityProblemClassifyItemService + { + + /// + /// 根据主键获取质量问题分类明细信息 + /// + /// + /// + public static Model.Base_QualityProblemClassifyItem GetClassifyItemById(string ItemId) + { + Model.CNPCDB db = Funs.DB; + return db.Base_QualityProblemClassifyItem.FirstOrDefault(e => e.ClassifyItemId == ItemId); + } + + /// + /// 添加质量问题分类明细 + /// + /// + 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(); + } + + /// + /// 修改质量问题分类明细 + /// + /// + 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(); + } + } + + /// + /// 根据主键删除明细信息 + /// + /// + 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(); + } + } + + /// + /// 根据主键删除明细信息 + /// + /// + 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(); + } + } + + + /// + /// 教材库下拉框 + /// + /// 下拉框名字 + /// 职务Id + /// 是否显示请选择 + 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); + } + } + + /// + /// 获取下拉项 + /// + /// + /// + public static List 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; + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/BaseInfo/QualityProblemClassifyService.cs b/SGGL/BLL/BaseInfo/QualityProblemClassifyService.cs new file mode 100644 index 00000000..65b3ecf5 --- /dev/null +++ b/SGGL/BLL/BaseInfo/QualityProblemClassifyService.cs @@ -0,0 +1,105 @@ +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + /// + /// 质量问题分类主表 + /// + public class QualityProblemClassifyService + { + + /// + /// 根据主键获取质量问题分类 + /// + /// + /// + public static Model.Base_QualityProblemClassify GetClassifyById(string Id) + { + var db = Funs.DB; + return db.Base_QualityProblemClassify.FirstOrDefault(e => e.ClassifyId == Id); + } + + /// + /// 添加质量问题分类 + /// + /// + 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(); + } + + /// + /// 修改质量问题分类 + /// + /// + 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(); + } + } + + /// + /// 根据主键删除质量问题分类 + /// + /// + 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(); + } + } + + /// + /// 查询所有质量问题分类 + /// + /// 质量问题分类的集合 + public static List GetClassify() + { + return (from x in Funs.DB.Base_QualityProblemClassify + orderby x.ClassifyCode + select x).ToList(); + } + + /// + /// 类型下拉框(末级) + /// + /// + /// + /// + 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); + } + } + } +} \ No newline at end of file diff --git a/SGGL/BLL/BaseInfo/QualityProblemNatureItemService.cs b/SGGL/BLL/BaseInfo/QualityProblemNatureItemService.cs new file mode 100644 index 00000000..a580ad9c --- /dev/null +++ b/SGGL/BLL/BaseInfo/QualityProblemNatureItemService.cs @@ -0,0 +1,131 @@ +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + /// + /// 质量问题性质 + /// + public class QualityProblemNatureItemService + { + + /// + /// 根据主键获取质量问题性质明细信息 + /// + /// + /// + public static Model.Base_QualityProblemNatureItem GetNatureItemById(string ItemId) + { + Model.CNPCDB db = Funs.DB; + return db.Base_QualityProblemNatureItem.FirstOrDefault(e => e.NatureItemId == ItemId); + } + + /// + /// 添加质量问题性质明细 + /// + /// + 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(); + } + + /// + /// 修改质量问题性质明细 + /// + /// + 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(); + } + } + + /// + /// 根据主键删除明细信息 + /// + /// + 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(); + } + } + + /// + /// 根据主键删除明细信息 + /// + /// + 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(); + } + } + + + /// + /// 教材库下拉框 + /// + /// 下拉框名字 + /// 职务Id + /// 是否显示请选择 + 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); + } + } + + /// + /// 获取下拉项 + /// + /// + /// + public static List 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; + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/BaseInfo/QualityProblemNatureService.cs b/SGGL/BLL/BaseInfo/QualityProblemNatureService.cs new file mode 100644 index 00000000..816b8361 --- /dev/null +++ b/SGGL/BLL/BaseInfo/QualityProblemNatureService.cs @@ -0,0 +1,105 @@ +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + /// + /// 质量问题性质主表 + /// + public class QualityProblemNatureService + { + + /// + /// 根据主键获取质量问题性质 + /// + /// + /// + public static Model.Base_QualityProblemNature GetNatureById(string Id) + { + var db = Funs.DB; + return db.Base_QualityProblemNature.FirstOrDefault(e => e.NatureId == Id); + } + + /// + /// 添加质量问题性质 + /// + /// + 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(); + } + + /// + /// 修改质量问题性质 + /// + /// + 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(); + } + } + + /// + /// 根据主键删除质量问题性质 + /// + /// + 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(); + } + } + + /// + /// 查询所有质量问题性质 + /// + /// 质量问题性质的集合 + public static List GetNature() + { + return (from x in Funs.DB.Base_QualityProblemNature + orderby x.NatureCode + select x).ToList(); + } + + /// + /// 类型下拉框(末级) + /// + /// + /// + /// + 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); + } + } + } +} \ No newline at end of file diff --git a/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs b/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs index 682642d4..c48482b5 100644 --- a/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs +++ b/SGGL/BLL/BaseInfo/SafetyProblemClassifyItemService.cs @@ -62,11 +62,11 @@ namespace BLL /// /// 根据主键删除明细信息 /// - /// - public static void DeleteClassifyItemById(string companyTrainItemId) + /// + 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 } } + /// + /// 根据主键删除明细信息 + /// + /// + 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(); + } + } + /// /// 教材库下拉框 diff --git a/SGGL/BLL/BaseInfo/SafetyProblemClassifyService.cs b/SGGL/BLL/BaseInfo/SafetyProblemClassifyService.cs index 1e7301c8..e5b767d6 100644 --- a/SGGL/BLL/BaseInfo/SafetyProblemClassifyService.cs +++ b/SGGL/BLL/BaseInfo/SafetyProblemClassifyService.cs @@ -73,37 +73,6 @@ namespace BLL } } - ///// - ///// 是否可删除资源节点 - ///// - ///// - ///// true-可以,false-不可以 - //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; - //} - /// /// 查询所有安全问题分类 /// diff --git a/SGGL/BLL/BaseInfo/SafetyProblemNatureItemService.cs b/SGGL/BLL/BaseInfo/SafetyProblemNatureItemService.cs new file mode 100644 index 00000000..f2e42c37 --- /dev/null +++ b/SGGL/BLL/BaseInfo/SafetyProblemNatureItemService.cs @@ -0,0 +1,131 @@ +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + /// + /// 安全问题性质 + /// + public class SafetyProblemNatureItemService + { + + /// + /// 根据主键获取安全问题性质明细信息 + /// + /// + /// + public static Model.Base_SafetyProblemNatureItem GetNatureItemById(string ItemId) + { + Model.CNPCDB db = Funs.DB; + return db.Base_SafetyProblemNatureItem.FirstOrDefault(e => e.NatureItemId == ItemId); + } + + /// + /// 添加安全问题性质明细 + /// + /// + 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(); + } + + /// + /// 修改安全问题性质明细 + /// + /// + 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(); + } + } + + /// + /// 根据主键删除明细信息 + /// + /// + 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(); + } + } + + /// + /// 根据主键删除明细信息 + /// + /// + 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(); + } + } + + + /// + /// 教材库下拉框 + /// + /// 下拉框名字 + /// 职务Id + /// 是否显示请选择 + 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); + } + } + + /// + /// 获取下拉项 + /// + /// + /// + public static List 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; + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/BaseInfo/SafetyProblemNatureService.cs b/SGGL/BLL/BaseInfo/SafetyProblemNatureService.cs new file mode 100644 index 00000000..716c0635 --- /dev/null +++ b/SGGL/BLL/BaseInfo/SafetyProblemNatureService.cs @@ -0,0 +1,105 @@ +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + /// + /// 安全问题性质主表 + /// + public class SafetyProblemNatureService + { + + /// + /// 根据主键获取安全问题性质 + /// + /// + /// + public static Model.Base_SafetyProblemNature GetNatureById(string Id) + { + var db = Funs.DB; + return db.Base_SafetyProblemNature.FirstOrDefault(e => e.NatureId == Id); + } + + /// + /// 添加安全问题性质 + /// + /// + 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(); + } + + /// + /// 修改安全问题性质 + /// + /// + 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(); + } + } + + /// + /// 根据主键删除安全问题性质 + /// + /// + 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(); + } + } + + /// + /// 查询所有安全问题性质 + /// + /// 安全问题性质的集合 + public static List GetNature() + { + return (from x in Funs.DB.Base_SafetyProblemNature + orderby x.NatureCode + select x).ToList(); + } + + /// + /// 类型下拉框(末级) + /// + /// + /// + /// + 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); + } + } + } +} \ No newline at end of file diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 40361a51..146dba2b 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -784,7 +784,11 @@ namespace BLL /// /// 默认用户密码 /// - public const string Password = "XJYJ.1234"; + public const string Password = "XJYJ!@#qwe.1234"; + /// + /// 默认用户密码前缀 + /// + public const string PasswordPrefixValue = "XJYJ!@#qwe."; /// /// 培训类型——入场培训类型ID diff --git a/SGGL/BLL/SysManage/UserService.cs b/SGGL/BLL/SysManage/UserService.cs index 51ed3a89..4bc1253e 100644 --- a/SGGL/BLL/SysManage/UserService.cs +++ b/SGGL/BLL/SysManage/UserService.cs @@ -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) diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassify.aspx b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassify.aspx new file mode 100644 index 00000000..48934079 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassify.aspx @@ -0,0 +1,129 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityProblemClassify.aspx.cs" + Inherits="FineUIPro.Web.BaseInfo.QualityProblemClassify" %> + + + + + + 质量问题分类 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassify.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassify.aspx.cs new file mode 100644 index 00000000..8f4b6fcd --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassify.aspx.cs @@ -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 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.GetButtonPower(); + InitTreeMenu(); + } + } + #endregion + + #region 加载树 + /// + /// 初始化树 + /// + 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); + } + } + } + + /// + /// 得到菜单方法 + /// + /// + /// + private List GetNewTraining() + { + return (from x in Funs.DB.Base_QualityProblemClassify orderby x.ClassifyCode select x).ToList(); ; + } + #endregion + + #region 增加、修改、删除质量问题分类类别 + /// + /// 增加质量问题分类类别 + /// + /// + /// + 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); + } + } + + /// + /// 修改质量问题分类类别 + /// + /// + /// + 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); + } + } + + /// + /// 删除质量问题分类类别 + /// + /// + /// + 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 树点击事件 + /// + /// 树点击事件 + /// + /// + /// + protected void trObj_NodeCommand(object sender, FineUIPro.TreeCommandEventArgs e) + { + BindGrid(); + } + + #endregion + + #region 下拉触发事件 + + /// + /// 适用岗位下拉触发事件 + /// + /// + /// + protected void drp_SelectedIndexChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + + #endregion + + #region 绑定数据 + /// + /// 绑定数据 + /// + 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 listStr = new List + { + 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 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 增加、修改、删除明细信息 + #region 新增明细 + /// + /// 新增明细 + /// + /// + /// + 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(); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + 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(); + } + + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + this.DeleteData(); + } + + /// + /// 删除方法 + /// + 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 按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + 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 + + + /// + /// 导出 + /// + /// + /// + 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(); + } + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassify.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassify.aspx.designer.cs new file mode 100644 index 00000000..1c40d648 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassify.aspx.designer.cs @@ -0,0 +1,251 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class QualityProblemClassify + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEdit; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// trObj 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree trObj; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// txtClassifyItemCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClassifyItemCode; + + /// + /// txtClassifyItemName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClassifyItemName; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNewDetail 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNewDetail; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifyItemSave.aspx b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifyItemSave.aspx new file mode 100644 index 00000000..f5a97284 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifyItemSave.aspx @@ -0,0 +1,65 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityProblemClassifyItemSave.aspx.cs" + Inherits="FineUIPro.Web.BaseInfo.QualityProblemClassifyItemSave" %> + + + + + 编辑质量问题分类 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifyItemSave.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifyItemSave.aspx.cs new file mode 100644 index 00000000..aba9b18f --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifyItemSave.aspx.cs @@ -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 定义变量 + /// + /// 主键 + /// + public string ClassifyItemId + { + get + { + return (string)ViewState["ClassifyItemId"]; + } + set + { + ViewState["ClassifyItemId"] = value; + } + } + + /// + /// 主表主键 + /// + 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 保存 + /// + /// 保存数据 + /// + 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()); + } + } + + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + SaveData(true); + } + #endregion + + #region 验证质量问题分类是否存在 + /// + /// 验证质量问题分类是否存在 + /// + /// + /// + 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 按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + 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 + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifyItemSave.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifyItemSave.aspx.designer.cs new file mode 100644 index 00000000..8f333023 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifyItemSave.aspx.designer.cs @@ -0,0 +1,134 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class QualityProblemClassifyItemSave + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtClassifyItemCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClassifyItemCode; + + /// + /// txtClassifyItemName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClassifyItemName; + + /// + /// txtCompileMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCompileMan; + + /// + /// txtCompileDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCompileDate; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + } +} diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifySave.aspx b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifySave.aspx new file mode 100644 index 00000000..1b73882e --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifySave.aspx @@ -0,0 +1,45 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityProblemClassifySave.aspx.cs" + Inherits="FineUIPro.Web.BaseInfo.QualityProblemClassifySave" %> + + + + + 编辑质量问题分类 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifySave.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifySave.aspx.cs new file mode 100644 index 00000000..b24f47ef --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifySave.aspx.cs @@ -0,0 +1,132 @@ +using System; +using System.Linq; +using BLL; + +namespace FineUIPro.Web.BaseInfo +{ + public partial class QualityProblemClassifySave : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + 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.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 保存 + /// + /// 保存按钮 + /// + /// + /// + 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 验证质量问题分类名称是否存在 + /// + /// 验证质量问题分类名称是否存在 + /// + /// + /// + 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 按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + 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 + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifySave.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifySave.aspx.designer.cs new file mode 100644 index 00000000..84e38743 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemClassifySave.aspx.designer.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class QualityProblemClassifySave + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtClassifyCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClassifyCode; + + /// + /// txtClassifyName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClassifyName; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNature.aspx b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNature.aspx new file mode 100644 index 00000000..0c8415a9 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNature.aspx @@ -0,0 +1,135 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityProblemNature.aspx.cs" + Inherits="FineUIPro.Web.BaseInfo.QualityProblemNature" %> + + + + + + 质量问题性质 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNature.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNature.aspx.cs new file mode 100644 index 00000000..9a9f6c09 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNature.aspx.cs @@ -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 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.GetButtonPower(); + InitTreeMenu(); + } + } + #endregion + + #region 加载树 + /// + /// 初始化树 + /// + 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); + } + } + } + + /// + /// 得到菜单方法 + /// + /// + /// + private List GetNewTraining() + { + return (from x in Funs.DB.Base_QualityProblemNature orderby x.NatureCode select x).ToList(); ; + } + #endregion + + #region 增加、修改、删除质量问题性质类别 + /// + /// 增加质量问题性质类别 + /// + /// + /// + 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); + } + } + + /// + /// 修改质量问题性质类别 + /// + /// + /// + 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); + } + } + + /// + /// 删除质量问题性质类别 + /// + /// + /// + 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 树点击事件 + /// + /// 树点击事件 + /// + /// + /// + protected void trObj_NodeCommand(object sender, FineUIPro.TreeCommandEventArgs e) + { + BindGrid(); + } + + #endregion + + #region 下拉触发事件 + + /// + /// 适用岗位下拉触发事件 + /// + /// + /// + protected void drp_SelectedIndexChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + + #endregion + + #region 绑定数据 + /// + /// 绑定数据 + /// + 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 listStr = new List + { + 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 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 增加、修改、删除明细信息 + #region 新增明细 + /// + /// 新增明细 + /// + /// + /// + 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(); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + 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(); + } + + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + this.DeleteData(); + } + + /// + /// 删除方法 + /// + 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 按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + 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 + + + /// + /// 导出 + /// + /// + /// + 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(); + } + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNature.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNature.aspx.designer.cs new file mode 100644 index 00000000..91df6d48 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNature.aspx.designer.cs @@ -0,0 +1,251 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class QualityProblemNature + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEdit; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// trObj 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree trObj; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// txtNatureItemCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureItemCode; + + /// + /// txtNatureItemName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureItemName; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNewDetail 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNewDetail; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureItemSave.aspx b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureItemSave.aspx new file mode 100644 index 00000000..a8600a73 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureItemSave.aspx @@ -0,0 +1,76 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityProblemNatureItemSave.aspx.cs" + Inherits="FineUIPro.Web.BaseInfo.QualityProblemNatureItemSave" %> + + + + + 编辑质量问题分类 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureItemSave.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureItemSave.aspx.cs new file mode 100644 index 00000000..a563717c --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureItemSave.aspx.cs @@ -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 定义变量 + /// + /// 主键 + /// + public string NatureItemId + { + get + { + return (string)ViewState["NatureItemId"]; + } + set + { + ViewState["NatureItemId"] = value; + } + } + + /// + /// 主表主键 + /// + 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 保存 + /// + /// 保存数据 + /// + 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()); + } + } + + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + SaveData(true); + } + #endregion + + #region 验证安全问题分类是否存在 + /// + /// 验证安全问题分类是否存在 + /// + /// + /// + 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 按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + 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 + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureItemSave.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureItemSave.aspx.designer.cs new file mode 100644 index 00000000..e8691517 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureItemSave.aspx.designer.cs @@ -0,0 +1,152 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class QualityProblemNatureItemSave + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtNatureItemCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureItemCode; + + /// + /// txtNatureItemType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureItemType; + + /// + /// txtNatureItemContent 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtNatureItemContent; + + /// + /// txtNatureItemDep 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureItemDep; + + /// + /// txtCompileMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCompileMan; + + /// + /// txtCompileDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCompileDate; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + } +} diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureSave.aspx b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureSave.aspx new file mode 100644 index 00000000..8eb9ad77 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureSave.aspx @@ -0,0 +1,45 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityProblemNatureSave.aspx.cs" + Inherits="FineUIPro.Web.BaseInfo.QualityProblemNatureSave" %> + + + + + 编辑质量问题性质 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureSave.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureSave.aspx.cs new file mode 100644 index 00000000..0009c9be --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureSave.aspx.cs @@ -0,0 +1,132 @@ +using System; +using System.Linq; +using BLL; + +namespace FineUIPro.Web.BaseInfo +{ + public partial class QualityProblemNatureSave : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + 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.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 保存 + /// + /// 保存按钮 + /// + /// + /// + 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 验证安全问题性质名称是否存在 + /// + /// 验证安全问题性质名称是否存在 + /// + /// + /// + 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 按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + 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 + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureSave.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureSave.aspx.designer.cs new file mode 100644 index 00000000..fb5a26b4 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/QualityProblemNatureSave.aspx.designer.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class QualityProblemNatureSave + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtNatureCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureCode; + + /// + /// txtNatureName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureName; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx index 9014f542..4672fc26 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx @@ -73,31 +73,6 @@ - <%-- - - - - - - - - - - - - - - - - - --%> diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.cs index c99e5009..00a51615 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.cs +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassify.aspx.cs @@ -79,7 +79,7 @@ namespace FineUIPro.Web.BaseInfo /// private List 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 导出方法 - ///// - ///// 导出方法 - ///// - ///// - ///// - //public static string GetGridTableHtml(Grid grid, int count) - //{ - // StringBuilder sb = new StringBuilder(); - // sb.Append(""); - // sb.Append(""); - // sb.Append(""); - // foreach (GridColumn column in grid.Columns) - // { - // if (column.ColumnIndex < count) - // { - // sb.AppendFormat("", column.HeaderText); - // } - // } - // sb.Append(""); - // foreach (GridRow row in grid.Rows) - // { - // sb.Append(""); - // 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("", html); - // } - // } - - // sb.Append(""); - // } - - // sb.Append("
{0}
{0}
"); - - // return sb.ToString(); - //} - #endregion - - ///// - ///// 行事件 - ///// - ///// - ///// - //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) - // { - - // } - // } - //} } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx index 9ea6d47d..25fb420e 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx @@ -16,7 +16,7 @@ + ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50" LabelWidth="120px" > @@ -62,46 +62,4 @@ - diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.cs index 8e425cb1..33587a6c 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.cs +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemClassifyItemSave.aspx.cs @@ -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 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 保存 /// @@ -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 /// 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 上传附件资源 - ///// - ///// 上传附件资源 - ///// - ///// - ///// - //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 按钮权限 /// /// 获取按钮权限 diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNature.aspx b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNature.aspx new file mode 100644 index 00000000..c7ae0edc --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNature.aspx @@ -0,0 +1,135 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProblemNature.aspx.cs" + Inherits="FineUIPro.Web.BaseInfo.SafetyProblemNature" %> + + + + + + 安全问题性质 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNature.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNature.aspx.cs new file mode 100644 index 00000000..f772ca7e --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNature.aspx.cs @@ -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 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.GetButtonPower(); + InitTreeMenu(); + } + } + #endregion + + #region 加载树 + /// + /// 初始化树 + /// + 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); + } + } + } + + /// + /// 得到菜单方法 + /// + /// + /// + private List GetNewTraining() + { + return (from x in Funs.DB.Base_SafetyProblemNature orderby x.NatureCode select x).ToList(); ; + } + #endregion + + #region 增加、修改、删除安全问题性质类别 + /// + /// 增加安全问题性质类别 + /// + /// + /// + 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); + } + } + + /// + /// 修改安全问题性质类别 + /// + /// + /// + 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); + } + } + + /// + /// 删除安全问题性质类别 + /// + /// + /// + 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 树点击事件 + /// + /// 树点击事件 + /// + /// + /// + protected void trObj_NodeCommand(object sender, FineUIPro.TreeCommandEventArgs e) + { + BindGrid(); + } + + #endregion + + #region 下拉触发事件 + + /// + /// 适用岗位下拉触发事件 + /// + /// + /// + protected void drp_SelectedIndexChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + + #endregion + + #region 绑定数据 + /// + /// 绑定数据 + /// + 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 listStr = new List + { + 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 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 增加、修改、删除明细信息 + #region 新增明细 + /// + /// 新增明细 + /// + /// + /// + 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(); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + 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(); + } + + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + this.DeleteData(); + } + + /// + /// 删除方法 + /// + 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 按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + 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 + + + /// + /// 导出 + /// + /// + /// + 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(); + } + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNature.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNature.aspx.designer.cs new file mode 100644 index 00000000..54ec27c6 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNature.aspx.designer.cs @@ -0,0 +1,251 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class SafetyProblemNature + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEdit; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// trObj 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree trObj; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// txtNatureItemCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureItemCode; + + /// + /// txtNatureItemName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureItemName; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNewDetail 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNewDetail; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureItemSave.aspx b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureItemSave.aspx new file mode 100644 index 00000000..89e4faed --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureItemSave.aspx @@ -0,0 +1,76 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProblemNatureItemSave.aspx.cs" + Inherits="FineUIPro.Web.BaseInfo.SafetyProblemNatureItemSave" %> + + + + + 编辑安全问题分类 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureItemSave.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureItemSave.aspx.cs new file mode 100644 index 00000000..4af82caf --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureItemSave.aspx.cs @@ -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 定义变量 + /// + /// 主键 + /// + public string NatureItemId + { + get + { + return (string)ViewState["NatureItemId"]; + } + set + { + ViewState["NatureItemId"] = value; + } + } + + /// + /// 主表主键 + /// + 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 保存 + /// + /// 保存数据 + /// + 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()); + } + } + + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + SaveData(true); + } + #endregion + + #region 验证安全问题分类是否存在 + /// + /// 验证安全问题分类是否存在 + /// + /// + /// + 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 按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + 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 + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureItemSave.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureItemSave.aspx.designer.cs new file mode 100644 index 00000000..c39f2ccc --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureItemSave.aspx.designer.cs @@ -0,0 +1,152 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class SafetyProblemNatureItemSave + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtNatureItemCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureItemCode; + + /// + /// txtNatureItemType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureItemType; + + /// + /// txtNatureItemContent 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtNatureItemContent; + + /// + /// txtNatureItemDep 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureItemDep; + + /// + /// txtCompileMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCompileMan; + + /// + /// txtCompileDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCompileDate; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + } +} diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureSave.aspx b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureSave.aspx new file mode 100644 index 00000000..46f871b5 --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureSave.aspx @@ -0,0 +1,45 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProblemNatureSave.aspx.cs" + Inherits="FineUIPro.Web.BaseInfo.SafetyProblemNatureSave" %> + + + + + 编辑安全问题性质 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureSave.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureSave.aspx.cs new file mode 100644 index 00000000..6946ee2c --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureSave.aspx.cs @@ -0,0 +1,132 @@ +using System; +using System.Linq; +using BLL; + +namespace FineUIPro.Web.BaseInfo +{ + public partial class SafetyProblemNatureSave : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + 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.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 保存 + /// + /// 保存按钮 + /// + /// + /// + 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 验证安全问题性质名称是否存在 + /// + /// 验证安全问题性质名称是否存在 + /// + /// + /// + 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 按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + 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 + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureSave.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureSave.aspx.designer.cs new file mode 100644 index 00000000..db51775d --- /dev/null +++ b/SGGL/FineUIPro.Web/BaseInfo/SafetyProblemNatureSave.aspx.designer.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class SafetyProblemNatureSave + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtNatureCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureCode; + + /// + /// txtNatureName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNatureName; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 0eec5bbe..e4ecfa32 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -244,6 +244,15 @@ + + + + + + + + + @@ -7763,6 +7772,69 @@ CNProfessionalView.aspx + + QualityProblemNature.aspx + ASPXCodeBehind + + + QualityProblemNature.aspx + + + QualityProblemNatureItemSave.aspx + ASPXCodeBehind + + + QualityProblemNatureItemSave.aspx + + + QualityProblemNatureSave.aspx + ASPXCodeBehind + + + QualityProblemNatureSave.aspx + + + QualityProblemClassify.aspx + ASPXCodeBehind + + + QualityProblemClassify.aspx + + + QualityProblemClassifyItemSave.aspx + ASPXCodeBehind + + + QualityProblemClassifyItemSave.aspx + + + QualityProblemClassifySave.aspx + ASPXCodeBehind + + + QualityProblemClassifySave.aspx + + + SafetyProblemNatureSave.aspx + ASPXCodeBehind + + + SafetyProblemNatureSave.aspx + + + SafetyProblemNature.aspx + ASPXCodeBehind + + + SafetyProblemNature.aspx + + + SafetyProblemNatureItemSave.aspx + ASPXCodeBehind + + + SafetyProblemNatureItemSave.aspx + SafetyProblemClassifyItemSave.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/Login.aspx.cs b/SGGL/FineUIPro.Web/Login.aspx.cs index 4279da74..69118c81 100644 --- a/SGGL/FineUIPro.Web/Login.aspx.cs +++ b/SGGL/FineUIPro.Web/Login.aspx.cs @@ -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}+身份证号码后四位,请登录"; } } } diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx index cc473a66..4bdbb07d 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorOccHealthSummary.aspx @@ -94,8 +94,8 @@ <%-- - --%> - + --%><%--单位项目名称--%> + diff --git a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx index b79c220f..27b4f181 100644 --- a/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx +++ b/SGGL/FineUIPro.Web/ReportManage/HazardFactor/HazardFactorSafetySummary.aspx @@ -94,8 +94,8 @@ <%-- - --%> - + --%><%--单位项目名称--%> + diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 1a7d0f94..2392503c 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -218,6 +218,18 @@ namespace Model partial void InsertBase_Qualification(Base_Qualification instance); partial void UpdateBase_Qualification(Base_Qualification instance); partial void DeleteBase_Qualification(Base_Qualification instance); + partial void InsertBase_QualityProblemClassify(Base_QualityProblemClassify instance); + partial void UpdateBase_QualityProblemClassify(Base_QualityProblemClassify instance); + partial void DeleteBase_QualityProblemClassify(Base_QualityProblemClassify instance); + partial void InsertBase_QualityProblemClassifyItem(Base_QualityProblemClassifyItem instance); + partial void UpdateBase_QualityProblemClassifyItem(Base_QualityProblemClassifyItem instance); + partial void DeleteBase_QualityProblemClassifyItem(Base_QualityProblemClassifyItem instance); + partial void InsertBase_QualityProblemNature(Base_QualityProblemNature instance); + partial void UpdateBase_QualityProblemNature(Base_QualityProblemNature instance); + partial void DeleteBase_QualityProblemNature(Base_QualityProblemNature instance); + partial void InsertBase_QualityProblemNatureItem(Base_QualityProblemNatureItem instance); + partial void UpdateBase_QualityProblemNatureItem(Base_QualityProblemNatureItem instance); + partial void DeleteBase_QualityProblemNatureItem(Base_QualityProblemNatureItem instance); partial void InsertBase_QualityQuestionType(Base_QualityQuestionType instance); partial void UpdateBase_QualityQuestionType(Base_QualityQuestionType instance); partial void DeleteBase_QualityQuestionType(Base_QualityQuestionType instance); @@ -239,6 +251,12 @@ namespace Model partial void InsertBase_SafetyProblemClassifyItem(Base_SafetyProblemClassifyItem instance); partial void UpdateBase_SafetyProblemClassifyItem(Base_SafetyProblemClassifyItem instance); partial void DeleteBase_SafetyProblemClassifyItem(Base_SafetyProblemClassifyItem instance); + partial void InsertBase_SafetyProblemNature(Base_SafetyProblemNature instance); + partial void UpdateBase_SafetyProblemNature(Base_SafetyProblemNature instance); + partial void DeleteBase_SafetyProblemNature(Base_SafetyProblemNature instance); + partial void InsertBase_SafetyProblemNatureItem(Base_SafetyProblemNatureItem instance); + partial void UpdateBase_SafetyProblemNatureItem(Base_SafetyProblemNatureItem instance); + partial void DeleteBase_SafetyProblemNatureItem(Base_SafetyProblemNatureItem instance); partial void InsertBase_SecretLevel(Base_SecretLevel instance); partial void UpdateBase_SecretLevel(Base_SecretLevel instance); partial void DeleteBase_SecretLevel(Base_SecretLevel instance); @@ -3256,6 +3274,38 @@ namespace Model } } + public System.Data.Linq.Table Base_QualityProblemClassify + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table Base_QualityProblemClassifyItem + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table Base_QualityProblemNature + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table Base_QualityProblemNatureItem + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table Base_QualityQuestionType { get @@ -3312,6 +3362,22 @@ namespace Model } } + public System.Data.Linq.Table Base_SafetyProblemNature + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table Base_SafetyProblemNatureItem + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table Base_SecretLevel { get @@ -39008,6 +39074,824 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_QualityProblemClassify")] + public partial class Base_QualityProblemClassify : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _ClassifyId; + + private string _ClassifyCode; + + private string _ClassifyName; + + private EntitySet _Base_QualityProblemClassifyItem; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnClassifyIdChanging(string value); + partial void OnClassifyIdChanged(); + partial void OnClassifyCodeChanging(string value); + partial void OnClassifyCodeChanged(); + partial void OnClassifyNameChanging(string value); + partial void OnClassifyNameChanged(); + #endregion + + public Base_QualityProblemClassify() + { + this._Base_QualityProblemClassifyItem = new EntitySet(new Action(this.attach_Base_QualityProblemClassifyItem), new Action(this.detach_Base_QualityProblemClassifyItem)); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string ClassifyId + { + get + { + return this._ClassifyId; + } + set + { + if ((this._ClassifyId != value)) + { + this.OnClassifyIdChanging(value); + this.SendPropertyChanging(); + this._ClassifyId = value; + this.SendPropertyChanged("ClassifyId"); + this.OnClassifyIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string ClassifyCode + { + get + { + return this._ClassifyCode; + } + set + { + if ((this._ClassifyCode != value)) + { + this.OnClassifyCodeChanging(value); + this.SendPropertyChanging(); + this._ClassifyCode = value; + this.SendPropertyChanged("ClassifyCode"); + this.OnClassifyCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)] + public string ClassifyName + { + get + { + return this._ClassifyName; + } + set + { + if ((this._ClassifyName != value)) + { + this.OnClassifyNameChanging(value); + this.SendPropertyChanging(); + this._ClassifyName = value; + this.SendPropertyChanged("ClassifyName"); + this.OnClassifyNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_QualityProblemClassifyItem_Classify", Storage="_Base_QualityProblemClassifyItem", ThisKey="ClassifyId", OtherKey="ClassifyId", DeleteRule="NO ACTION")] + public EntitySet Base_QualityProblemClassifyItem + { + get + { + return this._Base_QualityProblemClassifyItem; + } + set + { + this._Base_QualityProblemClassifyItem.Assign(value); + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + private void attach_Base_QualityProblemClassifyItem(Base_QualityProblemClassifyItem entity) + { + this.SendPropertyChanging(); + entity.Base_QualityProblemClassify = this; + } + + private void detach_Base_QualityProblemClassifyItem(Base_QualityProblemClassifyItem entity) + { + this.SendPropertyChanging(); + entity.Base_QualityProblemClassify = null; + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_QualityProblemClassifyItem")] + public partial class Base_QualityProblemClassifyItem : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _ClassifyItemId; + + private string _ClassifyId; + + private string _ClassifyItemCode; + + private string _ClassifyItemName; + + private string _CompileMan; + + private string _CompileManName; + + private System.Nullable _CompileDate; + + private EntityRef _Base_QualityProblemClassify; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnClassifyItemIdChanging(string value); + partial void OnClassifyItemIdChanged(); + partial void OnClassifyIdChanging(string value); + partial void OnClassifyIdChanged(); + partial void OnClassifyItemCodeChanging(string value); + partial void OnClassifyItemCodeChanged(); + partial void OnClassifyItemNameChanging(string value); + partial void OnClassifyItemNameChanged(); + partial void OnCompileManChanging(string value); + partial void OnCompileManChanged(); + partial void OnCompileManNameChanging(string value); + partial void OnCompileManNameChanged(); + partial void OnCompileDateChanging(System.Nullable value); + partial void OnCompileDateChanged(); + #endregion + + public Base_QualityProblemClassifyItem() + { + this._Base_QualityProblemClassify = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyItemId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string ClassifyItemId + { + get + { + return this._ClassifyItemId; + } + set + { + if ((this._ClassifyItemId != value)) + { + this.OnClassifyItemIdChanging(value); + this.SendPropertyChanging(); + this._ClassifyItemId = value; + this.SendPropertyChanged("ClassifyItemId"); + this.OnClassifyItemIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyId", DbType="NVarChar(50)")] + public string ClassifyId + { + get + { + return this._ClassifyId; + } + set + { + if ((this._ClassifyId != value)) + { + if (this._Base_QualityProblemClassify.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnClassifyIdChanging(value); + this.SendPropertyChanging(); + this._ClassifyId = value; + this.SendPropertyChanged("ClassifyId"); + this.OnClassifyIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyItemCode", DbType="NVarChar(50)")] + public string ClassifyItemCode + { + get + { + return this._ClassifyItemCode; + } + set + { + if ((this._ClassifyItemCode != value)) + { + this.OnClassifyItemCodeChanging(value); + this.SendPropertyChanging(); + this._ClassifyItemCode = value; + this.SendPropertyChanged("ClassifyItemCode"); + this.OnClassifyItemCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ClassifyItemName", DbType="NVarChar(100)")] + public string ClassifyItemName + { + get + { + return this._ClassifyItemName; + } + set + { + if ((this._ClassifyItemName != value)) + { + this.OnClassifyItemNameChanging(value); + this.SendPropertyChanging(); + this._ClassifyItemName = value; + this.SendPropertyChanged("ClassifyItemName"); + this.OnClassifyItemNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileMan", DbType="NVarChar(50)")] + public string CompileMan + { + get + { + return this._CompileMan; + } + set + { + if ((this._CompileMan != value)) + { + this.OnCompileManChanging(value); + this.SendPropertyChanging(); + this._CompileMan = value; + this.SendPropertyChanged("CompileMan"); + this.OnCompileManChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileManName", DbType="NVarChar(50)")] + public string CompileManName + { + get + { + return this._CompileManName; + } + set + { + if ((this._CompileManName != value)) + { + this.OnCompileManNameChanging(value); + this.SendPropertyChanging(); + this._CompileManName = value; + this.SendPropertyChanged("CompileManName"); + this.OnCompileManNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileDate", DbType="DateTime")] + public System.Nullable CompileDate + { + get + { + return this._CompileDate; + } + set + { + if ((this._CompileDate != value)) + { + this.OnCompileDateChanging(value); + this.SendPropertyChanging(); + this._CompileDate = value; + this.SendPropertyChanged("CompileDate"); + this.OnCompileDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_QualityProblemClassifyItem_Classify", Storage="_Base_QualityProblemClassify", ThisKey="ClassifyId", OtherKey="ClassifyId", IsForeignKey=true)] + public Base_QualityProblemClassify Base_QualityProblemClassify + { + get + { + return this._Base_QualityProblemClassify.Entity; + } + set + { + Base_QualityProblemClassify previousValue = this._Base_QualityProblemClassify.Entity; + if (((previousValue != value) + || (this._Base_QualityProblemClassify.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._Base_QualityProblemClassify.Entity = null; + previousValue.Base_QualityProblemClassifyItem.Remove(this); + } + this._Base_QualityProblemClassify.Entity = value; + if ((value != null)) + { + value.Base_QualityProblemClassifyItem.Add(this); + this._ClassifyId = value.ClassifyId; + } + else + { + this._ClassifyId = default(string); + } + this.SendPropertyChanged("Base_QualityProblemClassify"); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_QualityProblemNature")] + public partial class Base_QualityProblemNature : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _NatureId; + + private string _NatureCode; + + private string _NatureName; + + private EntitySet _Base_QualityProblemNatureItem; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnNatureIdChanging(string value); + partial void OnNatureIdChanged(); + partial void OnNatureCodeChanging(string value); + partial void OnNatureCodeChanged(); + partial void OnNatureNameChanging(string value); + partial void OnNatureNameChanged(); + #endregion + + public Base_QualityProblemNature() + { + this._Base_QualityProblemNatureItem = new EntitySet(new Action(this.attach_Base_QualityProblemNatureItem), new Action(this.detach_Base_QualityProblemNatureItem)); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string NatureId + { + get + { + return this._NatureId; + } + set + { + if ((this._NatureId != value)) + { + this.OnNatureIdChanging(value); + this.SendPropertyChanging(); + this._NatureId = value; + this.SendPropertyChanged("NatureId"); + this.OnNatureIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string NatureCode + { + get + { + return this._NatureCode; + } + set + { + if ((this._NatureCode != value)) + { + this.OnNatureCodeChanging(value); + this.SendPropertyChanging(); + this._NatureCode = value; + this.SendPropertyChanged("NatureCode"); + this.OnNatureCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)] + public string NatureName + { + get + { + return this._NatureName; + } + set + { + if ((this._NatureName != value)) + { + this.OnNatureNameChanging(value); + this.SendPropertyChanging(); + this._NatureName = value; + this.SendPropertyChanged("NatureName"); + this.OnNatureNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_QualityProblemNatureItem_Nature", Storage="_Base_QualityProblemNatureItem", ThisKey="NatureId", OtherKey="NatureId", DeleteRule="NO ACTION")] + public EntitySet Base_QualityProblemNatureItem + { + get + { + return this._Base_QualityProblemNatureItem; + } + set + { + this._Base_QualityProblemNatureItem.Assign(value); + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + private void attach_Base_QualityProblemNatureItem(Base_QualityProblemNatureItem entity) + { + this.SendPropertyChanging(); + entity.Base_QualityProblemNature = this; + } + + private void detach_Base_QualityProblemNatureItem(Base_QualityProblemNatureItem entity) + { + this.SendPropertyChanging(); + entity.Base_QualityProblemNature = null; + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_QualityProblemNatureItem")] + public partial class Base_QualityProblemNatureItem : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _NatureItemId; + + private string _NatureId; + + private string _NatureItemCode; + + private string _NatureItemType; + + private string _NatureItemContent; + + private string _NatureItemDep; + + private string _CompileMan; + + private string _CompileManName; + + private System.Nullable _CompileDate; + + private EntityRef _Base_QualityProblemNature; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnNatureItemIdChanging(string value); + partial void OnNatureItemIdChanged(); + partial void OnNatureIdChanging(string value); + partial void OnNatureIdChanged(); + partial void OnNatureItemCodeChanging(string value); + partial void OnNatureItemCodeChanged(); + partial void OnNatureItemTypeChanging(string value); + partial void OnNatureItemTypeChanged(); + partial void OnNatureItemContentChanging(string value); + partial void OnNatureItemContentChanged(); + partial void OnNatureItemDepChanging(string value); + partial void OnNatureItemDepChanged(); + partial void OnCompileManChanging(string value); + partial void OnCompileManChanged(); + partial void OnCompileManNameChanging(string value); + partial void OnCompileManNameChanged(); + partial void OnCompileDateChanging(System.Nullable value); + partial void OnCompileDateChanged(); + #endregion + + public Base_QualityProblemNatureItem() + { + this._Base_QualityProblemNature = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureItemId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string NatureItemId + { + get + { + return this._NatureItemId; + } + set + { + if ((this._NatureItemId != value)) + { + this.OnNatureItemIdChanging(value); + this.SendPropertyChanging(); + this._NatureItemId = value; + this.SendPropertyChanged("NatureItemId"); + this.OnNatureItemIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureId", DbType="NVarChar(50)")] + public string NatureId + { + get + { + return this._NatureId; + } + set + { + if ((this._NatureId != value)) + { + if (this._Base_QualityProblemNature.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnNatureIdChanging(value); + this.SendPropertyChanging(); + this._NatureId = value; + this.SendPropertyChanged("NatureId"); + this.OnNatureIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureItemCode", DbType="NVarChar(50)")] + public string NatureItemCode + { + get + { + return this._NatureItemCode; + } + set + { + if ((this._NatureItemCode != value)) + { + this.OnNatureItemCodeChanging(value); + this.SendPropertyChanging(); + this._NatureItemCode = value; + this.SendPropertyChanged("NatureItemCode"); + this.OnNatureItemCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureItemType", DbType="NVarChar(200)")] + public string NatureItemType + { + get + { + return this._NatureItemType; + } + set + { + if ((this._NatureItemType != value)) + { + this.OnNatureItemTypeChanging(value); + this.SendPropertyChanging(); + this._NatureItemType = value; + this.SendPropertyChanged("NatureItemType"); + this.OnNatureItemTypeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureItemContent", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + public string NatureItemContent + { + get + { + return this._NatureItemContent; + } + set + { + if ((this._NatureItemContent != value)) + { + this.OnNatureItemContentChanging(value); + this.SendPropertyChanging(); + this._NatureItemContent = value; + this.SendPropertyChanged("NatureItemContent"); + this.OnNatureItemContentChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureItemDep", DbType="NVarChar(200)")] + public string NatureItemDep + { + get + { + return this._NatureItemDep; + } + set + { + if ((this._NatureItemDep != value)) + { + this.OnNatureItemDepChanging(value); + this.SendPropertyChanging(); + this._NatureItemDep = value; + this.SendPropertyChanged("NatureItemDep"); + this.OnNatureItemDepChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileMan", DbType="NVarChar(50)")] + public string CompileMan + { + get + { + return this._CompileMan; + } + set + { + if ((this._CompileMan != value)) + { + this.OnCompileManChanging(value); + this.SendPropertyChanging(); + this._CompileMan = value; + this.SendPropertyChanged("CompileMan"); + this.OnCompileManChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileManName", DbType="NVarChar(50)")] + public string CompileManName + { + get + { + return this._CompileManName; + } + set + { + if ((this._CompileManName != value)) + { + this.OnCompileManNameChanging(value); + this.SendPropertyChanging(); + this._CompileManName = value; + this.SendPropertyChanged("CompileManName"); + this.OnCompileManNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileDate", DbType="DateTime")] + public System.Nullable CompileDate + { + get + { + return this._CompileDate; + } + set + { + if ((this._CompileDate != value)) + { + this.OnCompileDateChanging(value); + this.SendPropertyChanging(); + this._CompileDate = value; + this.SendPropertyChanged("CompileDate"); + this.OnCompileDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_QualityProblemNatureItem_Nature", Storage="_Base_QualityProblemNature", ThisKey="NatureId", OtherKey="NatureId", IsForeignKey=true)] + public Base_QualityProblemNature Base_QualityProblemNature + { + get + { + return this._Base_QualityProblemNature.Entity; + } + set + { + Base_QualityProblemNature previousValue = this._Base_QualityProblemNature.Entity; + if (((previousValue != value) + || (this._Base_QualityProblemNature.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._Base_QualityProblemNature.Entity = null; + previousValue.Base_QualityProblemNatureItem.Remove(this); + } + this._Base_QualityProblemNature.Entity = value; + if ((value != null)) + { + value.Base_QualityProblemNatureItem.Add(this); + this._NatureId = value.NatureId; + } + else + { + this._NatureId = default(string); + } + this.SendPropertyChanged("Base_QualityProblemNature"); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_QualityQuestionType")] public partial class Base_QualityQuestionType : INotifyPropertyChanging, INotifyPropertyChanged { @@ -40224,6 +41108,439 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_SafetyProblemNature")] + public partial class Base_SafetyProblemNature : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _NatureId; + + private string _NatureCode; + + private string _NatureName; + + private EntitySet _Base_SafetyProblemNatureItem; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnNatureIdChanging(string value); + partial void OnNatureIdChanged(); + partial void OnNatureCodeChanging(string value); + partial void OnNatureCodeChanged(); + partial void OnNatureNameChanging(string value); + partial void OnNatureNameChanged(); + #endregion + + public Base_SafetyProblemNature() + { + this._Base_SafetyProblemNatureItem = new EntitySet(new Action(this.attach_Base_SafetyProblemNatureItem), new Action(this.detach_Base_SafetyProblemNatureItem)); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string NatureId + { + get + { + return this._NatureId; + } + set + { + if ((this._NatureId != value)) + { + this.OnNatureIdChanging(value); + this.SendPropertyChanging(); + this._NatureId = value; + this.SendPropertyChanged("NatureId"); + this.OnNatureIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureCode", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string NatureCode + { + get + { + return this._NatureCode; + } + set + { + if ((this._NatureCode != value)) + { + this.OnNatureCodeChanging(value); + this.SendPropertyChanging(); + this._NatureCode = value; + this.SendPropertyChanged("NatureCode"); + this.OnNatureCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureName", DbType="NVarChar(100) NOT NULL", CanBeNull=false)] + public string NatureName + { + get + { + return this._NatureName; + } + set + { + if ((this._NatureName != value)) + { + this.OnNatureNameChanging(value); + this.SendPropertyChanging(); + this._NatureName = value; + this.SendPropertyChanged("NatureName"); + this.OnNatureNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_SafetyProblemNatureItem_Nature", Storage="_Base_SafetyProblemNatureItem", ThisKey="NatureId", OtherKey="NatureId", DeleteRule="NO ACTION")] + public EntitySet Base_SafetyProblemNatureItem + { + get + { + return this._Base_SafetyProblemNatureItem; + } + set + { + this._Base_SafetyProblemNatureItem.Assign(value); + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + private void attach_Base_SafetyProblemNatureItem(Base_SafetyProblemNatureItem entity) + { + this.SendPropertyChanging(); + entity.Base_SafetyProblemNature = this; + } + + private void detach_Base_SafetyProblemNatureItem(Base_SafetyProblemNatureItem entity) + { + this.SendPropertyChanging(); + entity.Base_SafetyProblemNature = null; + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_SafetyProblemNatureItem")] + public partial class Base_SafetyProblemNatureItem : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _NatureItemId; + + private string _NatureId; + + private string _NatureItemCode; + + private string _NatureItemType; + + private string _NatureItemContent; + + private string _NatureItemDep; + + private string _CompileMan; + + private string _CompileManName; + + private System.Nullable _CompileDate; + + private EntityRef _Base_SafetyProblemNature; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnNatureItemIdChanging(string value); + partial void OnNatureItemIdChanged(); + partial void OnNatureIdChanging(string value); + partial void OnNatureIdChanged(); + partial void OnNatureItemCodeChanging(string value); + partial void OnNatureItemCodeChanged(); + partial void OnNatureItemTypeChanging(string value); + partial void OnNatureItemTypeChanged(); + partial void OnNatureItemContentChanging(string value); + partial void OnNatureItemContentChanged(); + partial void OnNatureItemDepChanging(string value); + partial void OnNatureItemDepChanged(); + partial void OnCompileManChanging(string value); + partial void OnCompileManChanged(); + partial void OnCompileManNameChanging(string value); + partial void OnCompileManNameChanged(); + partial void OnCompileDateChanging(System.Nullable value); + partial void OnCompileDateChanged(); + #endregion + + public Base_SafetyProblemNatureItem() + { + this._Base_SafetyProblemNature = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureItemId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string NatureItemId + { + get + { + return this._NatureItemId; + } + set + { + if ((this._NatureItemId != value)) + { + this.OnNatureItemIdChanging(value); + this.SendPropertyChanging(); + this._NatureItemId = value; + this.SendPropertyChanged("NatureItemId"); + this.OnNatureItemIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureId", DbType="NVarChar(50)")] + public string NatureId + { + get + { + return this._NatureId; + } + set + { + if ((this._NatureId != value)) + { + if (this._Base_SafetyProblemNature.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnNatureIdChanging(value); + this.SendPropertyChanging(); + this._NatureId = value; + this.SendPropertyChanged("NatureId"); + this.OnNatureIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureItemCode", DbType="NVarChar(50)")] + public string NatureItemCode + { + get + { + return this._NatureItemCode; + } + set + { + if ((this._NatureItemCode != value)) + { + this.OnNatureItemCodeChanging(value); + this.SendPropertyChanging(); + this._NatureItemCode = value; + this.SendPropertyChanged("NatureItemCode"); + this.OnNatureItemCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureItemType", DbType="NVarChar(200)")] + public string NatureItemType + { + get + { + return this._NatureItemType; + } + set + { + if ((this._NatureItemType != value)) + { + this.OnNatureItemTypeChanging(value); + this.SendPropertyChanging(); + this._NatureItemType = value; + this.SendPropertyChanged("NatureItemType"); + this.OnNatureItemTypeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureItemContent", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + public string NatureItemContent + { + get + { + return this._NatureItemContent; + } + set + { + if ((this._NatureItemContent != value)) + { + this.OnNatureItemContentChanging(value); + this.SendPropertyChanging(); + this._NatureItemContent = value; + this.SendPropertyChanged("NatureItemContent"); + this.OnNatureItemContentChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NatureItemDep", DbType="NVarChar(200)")] + public string NatureItemDep + { + get + { + return this._NatureItemDep; + } + set + { + if ((this._NatureItemDep != value)) + { + this.OnNatureItemDepChanging(value); + this.SendPropertyChanging(); + this._NatureItemDep = value; + this.SendPropertyChanged("NatureItemDep"); + this.OnNatureItemDepChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileMan", DbType="NVarChar(50)")] + public string CompileMan + { + get + { + return this._CompileMan; + } + set + { + if ((this._CompileMan != value)) + { + this.OnCompileManChanging(value); + this.SendPropertyChanging(); + this._CompileMan = value; + this.SendPropertyChanged("CompileMan"); + this.OnCompileManChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileManName", DbType="NVarChar(50)")] + public string CompileManName + { + get + { + return this._CompileManName; + } + set + { + if ((this._CompileManName != value)) + { + this.OnCompileManNameChanging(value); + this.SendPropertyChanging(); + this._CompileManName = value; + this.SendPropertyChanged("CompileManName"); + this.OnCompileManNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileDate", DbType="DateTime")] + public System.Nullable CompileDate + { + get + { + return this._CompileDate; + } + set + { + if ((this._CompileDate != value)) + { + this.OnCompileDateChanging(value); + this.SendPropertyChanging(); + this._CompileDate = value; + this.SendPropertyChanged("CompileDate"); + this.OnCompileDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_SafetyProblemNatureItem_Nature", Storage="_Base_SafetyProblemNature", ThisKey="NatureId", OtherKey="NatureId", IsForeignKey=true)] + public Base_SafetyProblemNature Base_SafetyProblemNature + { + get + { + return this._Base_SafetyProblemNature.Entity; + } + set + { + Base_SafetyProblemNature previousValue = this._Base_SafetyProblemNature.Entity; + if (((previousValue != value) + || (this._Base_SafetyProblemNature.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._Base_SafetyProblemNature.Entity = null; + previousValue.Base_SafetyProblemNatureItem.Remove(this); + } + this._Base_SafetyProblemNature.Entity = value; + if ((value != null)) + { + value.Base_SafetyProblemNatureItem.Add(this); + this._NatureId = value.NatureId; + } + else + { + this._NatureId = default(string); + } + this.SendPropertyChanged("Base_SafetyProblemNature"); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_SecretLevel")] public partial class Base_SecretLevel : INotifyPropertyChanging, INotifyPropertyChanged {