diff --git a/DataBase/版本日志/SGGLDB_V2025-02-17-xiaj(岗位培训模块).sql b/DataBase/版本日志/SGGLDB_V2025-02-17-xiaj(岗位培训模块).sql index eca8ff0e..5a313601 100644 --- a/DataBase/版本日志/SGGLDB_V2025-02-17-xiaj(岗位培训模块).sql +++ b/DataBase/版本日志/SGGLDB_V2025-02-17-xiaj(岗位培训模块).sql @@ -1,4 +1,12 @@ +--1˾ѵ̲IJøλ +IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Training_CompanyTrainingItem' AND COLUMN_NAME = 'WorkPostNames') +BEGIN + ALTER TABLE Training_CompanyTrainingItem ADD WorkPostNames nvarchar(max); + ALTER TABLE Training_CompanyTrainingItem ALTER COLUMN WorkPostIds nvarchar(max); +END +GO + --λѵ /*******************************λѵ˵******************************************************************************************/ @@ -27,9 +35,9 @@ BEGIN --λѵ׼ INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsEnd,IsUsed) VALUES('7BCA5AD9-D0FB-4850-A9D1-88364008984D','λѵ׼','HSSE/PostTraining/Standard.aspx',120,'BEA50D7C-60FE-488B-8D7D-255020EEB4C2','Menu_HSSE',1,1) - --λѵɫ - INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsEnd,IsUsed) - VALUES('50F80CAF-08BA-4A16-9EF8-76DF0A8078CF','λѵɫ','HSSE/PostTraining/Role.aspx',130,'BEA50D7C-60FE-488B-8D7D-255020EEB4C2','Menu_HSSE',1,1) + ----λѵɫ + --INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsEnd,IsUsed) + --VALUES('50F80CAF-08BA-4A16-9EF8-76DF0A8078CF','λѵɫ','HSSE/PostTraining/Role.aspx',130,'BEA50D7C-60FE-488B-8D7D-255020EEB4C2','Menu_HSSE',1,1) --λѵʽ INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsEnd,IsUsed) VALUES('919853EB-A8FA-4BE5-9964-70F43E000961','λѵʽ','HSSE/PostTraining/Method.aspx',140,'BEA50D7C-60FE-488B-8D7D-255020EEB4C2','Menu_HSSE',1,1) @@ -90,19 +98,19 @@ BEGIN VALUES('CC75D488-288C-4883-9452-617818AD5A84','7BCA5AD9-D0FB-4850-A9D1-88364008984D','',4) END GO -IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '50F80CAF-08BA-4A16-9EF8-76DF0A8078CF') -BEGIN - --λѵɫ - INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) - VALUES('93D2A0CB-1388-4059-9C28-8DEDCAD56093','50F80CAF-08BA-4A16-9EF8-76DF0A8078CF','',1) - INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) - VALUES('E3A54064-7D8B-49D8-AE32-89EF002A6D0E','50F80CAF-08BA-4A16-9EF8-76DF0A8078CF','޸',2) - INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) - VALUES('BF0EA069-3B5A-4685-92AC-0AD13AF81010','50F80CAF-08BA-4A16-9EF8-76DF0A8078CF','ɾ',3) - INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) - VALUES('7C57B206-FC52-4622-A276-50FA49691532','50F80CAF-08BA-4A16-9EF8-76DF0A8078CF','',4) -END -GO +--IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '50F80CAF-08BA-4A16-9EF8-76DF0A8078CF') +--BEGIN +-- --λѵɫ +-- INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +-- VALUES('93D2A0CB-1388-4059-9C28-8DEDCAD56093','50F80CAF-08BA-4A16-9EF8-76DF0A8078CF','',1) +-- INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +-- VALUES('E3A54064-7D8B-49D8-AE32-89EF002A6D0E','50F80CAF-08BA-4A16-9EF8-76DF0A8078CF','޸',2) +-- INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +-- VALUES('BF0EA069-3B5A-4685-92AC-0AD13AF81010','50F80CAF-08BA-4A16-9EF8-76DF0A8078CF','ɾ',3) +-- INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +-- VALUES('7C57B206-FC52-4622-A276-50FA49691532','50F80CAF-08BA-4A16-9EF8-76DF0A8078CF','',4) +--END +--GO IF NOT EXISTS (SELECT * FROM Sys_ButtonToMenu WHERE MenuId = '919853EB-A8FA-4BE5-9964-70F43E000961') BEGIN --λѵʽ @@ -130,12 +138,13 @@ BEGIN END GO ---1ûѵλId -IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'SitePerson_Person' AND COLUMN_NAME = 'PostTrainingRoleId') -BEGIN - ALTER TABLE SitePerson_Person ADD PostTrainingRoleId nvarchar(50); -END -GO +----1ûѵλId +--IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'SitePerson_Person' AND COLUMN_NAME = 'PostTrainingRoleId') +--BEGIN +-- ALTER TABLE SitePerson_Person ADD PostTrainingRoleId nvarchar(50); +--END +--GO + /*******************************λѵݱ******************************************************************************************/ @@ -158,7 +167,7 @@ CREATE TABLE [dbo].[PostTraining_Record]( [Method] [nvarchar](200) NULL, [Lecturer] [nvarchar](200) NULL, [UnitIds] [nvarchar](max) NULL, - [RoleIds] [nvarchar](max) NULL, + [WorkPostIds] [nvarchar](max) NULL, [PersonNum] [int] NOT NULL, [TrainingTime] [datetime] NOT NULL, [Duration] [decimal](10, 2) NOT NULL, @@ -276,33 +285,34 @@ BEGIN END GO ---λѵɫ -IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'PostTraining_Role') AND type = N'U') -BEGIN +--drop table PostTraining_Role +----λѵɫ +--IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'PostTraining_Role') AND type = N'U') +--BEGIN -CREATE TABLE [dbo].[PostTraining_Role]( - [Id] [nvarchar](50) NOT NULL, - [Code] [nvarchar](50) NULL, - [Name] [nvarchar](200) NULL, - [Remark] [nvarchar](1000) NULL, - [CompileDate] [datetime] NULL, - [CompileMan] [nvarchar](50) NULL, - CONSTRAINT [PK_PostTraining_Role] PRIMARY KEY CLUSTERED -( - [Id] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] -) ON [PRIMARY] -ALTER TABLE [dbo].[PostTraining_Role] WITH CHECK ADD CONSTRAINT [FK_PostTraining_Role_Sys_User] FOREIGN KEY([CompileMan]) -REFERENCES [dbo].[Sys_User] ([UserId]) -ALTER TABLE [dbo].[PostTraining_Role] CHECK CONSTRAINT [FK_PostTraining_Role_Sys_User] -EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role', @level2type=N'COLUMN',@level2name=N'Id' -EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role', @level2type=N'COLUMN',@level2name=N'Code' -EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role', @level2type=N'COLUMN',@level2name=N'Name' -EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role', @level2type=N'COLUMN',@level2name=N'Remark' -EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role', @level2type=N'COLUMN',@level2name=N'CompileMan' -EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role', @level2type=N'COLUMN',@level2name=N'CompileDate' -EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λѵɫ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role' -END +--CREATE TABLE [dbo].[PostTraining_Role]( +-- [Id] [nvarchar](50) NOT NULL, +-- [Code] [nvarchar](50) NULL, +-- [Name] [nvarchar](200) NULL, +-- [Remark] [nvarchar](1000) NULL, +-- [CompileDate] [datetime] NULL, +-- [CompileMan] [nvarchar](50) NULL, +-- CONSTRAINT [PK_PostTraining_Role] PRIMARY KEY CLUSTERED +--( +-- [Id] ASC +--)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +--) ON [PRIMARY] +--ALTER TABLE [dbo].[PostTraining_Role] WITH CHECK ADD CONSTRAINT [FK_PostTraining_Role_Sys_User] FOREIGN KEY([CompileMan]) +--REFERENCES [dbo].[Sys_User] ([UserId]) +--ALTER TABLE [dbo].[PostTraining_Role] CHECK CONSTRAINT [FK_PostTraining_Role_Sys_User] +--EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role', @level2type=N'COLUMN',@level2name=N'Id' +--EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role', @level2type=N'COLUMN',@level2name=N'Code' +--EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role', @level2type=N'COLUMN',@level2name=N'Name' +--EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role', @level2type=N'COLUMN',@level2name=N'Remark' +--EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role', @level2type=N'COLUMN',@level2name=N'CompileMan' +--EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role', @level2type=N'COLUMN',@level2name=N'CompileDate' +--EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λѵɫ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PostTraining_Role' +--END GO @@ -359,7 +369,7 @@ BEGIN CREATE TABLE [dbo].[PostTraining_Standard]( [Id] [nvarchar](50) NOT NULL, [Code] [nvarchar](50) NULL, - [RoleId] [nvarchar](50) NOT NULL, + [WorkPostId] [nvarchar](50) NOT NULL, [CourseId] [nvarchar](50) NOT NULL, [ClassHour] [decimal](10, 2) NOT NULL, [Cycle] [decimal](10, 2) NOT NULL, @@ -374,9 +384,9 @@ CREATE TABLE [dbo].[PostTraining_Standard]( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] -ALTER TABLE [dbo].[PostTraining_Standard] WITH CHECK ADD CONSTRAINT [FK_PostTraining_Standard_PostTraining_Role] FOREIGN KEY([RoleId]) -REFERENCES [dbo].[PostTraining_Role] ([Id]) -ALTER TABLE [dbo].[PostTraining_Standard] CHECK CONSTRAINT [FK_PostTraining_Standard_PostTraining_Role] +ALTER TABLE [dbo].[PostTraining_Standard] WITH CHECK ADD CONSTRAINT [FK_PostTraining_Standard_Base_WorkPost] FOREIGN KEY([WorkPostId]) +REFERENCES [dbo].[FK_PostTraining_Standard_Base_WorkPost] ([WorkPostId]) +ALTER TABLE [dbo].[PostTraining_Standard] CHECK CONSTRAINT [FK_PostTraining_Standard_Base_WorkPost] ALTER TABLE [dbo].[PostTraining_Standard] WITH CHECK ADD CONSTRAINT [FK_PostTraining_Standard_PostTraining_Course] FOREIGN KEY([CourseId]) REFERENCES [dbo].[PostTraining_Course] ([Id]) @@ -507,11 +517,11 @@ SELECT recordDetail.Id AS DetailId, person.UnitId, unit.UnitName, person.PersonName, - pRole.Name AS RoleName + workPost.WorkPostName AS WorkPostName FROM dbo.PostTraining_Record_Detail AS recordDetail LEFT JOIN dbo.SitePerson_Person AS person ON person.PersonId = recordDetail.PersonId LEFT JOIN dbo.Base_Unit AS unit ON unit.UnitId=person.UnitId -LEFT JOIN dbo.PostTraining_Role AS pRole ON pRole.Id=person.PostTrainingRoleId +LEFT JOIN dbo.Base_WorkPost AS workPost ON workPost.WorkPostId=person.WorkPostId GO @@ -529,7 +539,8 @@ SELECT Person.PersonId, Person.Birthday, Person.TeamGroupId, Person.WorkAreaId, - Person.WorkPostId, + Person.WorkPostId, + Post.WorkPostName, Person.InTime, Person.OutTime, Person.OutResult, @@ -551,7 +562,6 @@ SELECT Person.PersonId, WorkAreaCode= STUFF((SELECT ',' + UnitWorkCode FROM dbo.WBS_UnitWork where PATINDEX('%,' + RTRIM(UnitWorkId) + ',%',',' +Person.WorkAreaId + ',')>0 FOR XML PATH('')), 1, 1,''), --WorkArea.UnitWorkName AS WorkAreaName WorkAreaName= STUFF((SELECT ',' + UnitWorkName FROM dbo.WBS_UnitWork where PATINDEX('%,' + RTRIM(UnitWorkId) + ',%',',' +Person.WorkAreaId + ',')>0 FOR XML PATH('')), 1, 1,''), - Post.WorkPostName, Position.PositionName, Title.PostTitleName, Depart.DepartName, @@ -594,9 +604,9 @@ SELECT Person.PersonId, Person.States, sysUser.StarLevelId, StarLevel.StarMark, - StarLevel.LevelValue, - Person.PostTrainingRoleId, - PostRole.Name AS PostTrainingRoleName + StarLevel.LevelValue + --,Person.PostTrainingRoleId, + --PostRole.Name AS PostTrainingRoleName FROM SitePerson_Person AS Person LEFT JOIN Base_Project AS Project ON Project.ProjectId=Person.ProjectId @@ -617,7 +627,7 @@ Left JOIN RealName_Country AS Country ON Country.CountryId = Person.CountryCode Left JOIN RealName_City AS City ON City.provinceCode = Person.ProvinceCode Left JOIN Base_CNProfessional AS CNProfessional ON CNProfessional.CNProfessionalId = Person.MainCNProfessionalId Left JOIN Base_StarLevel AS StarLevel ON sysUser.StarLevelId = StarLevel.StarLevelId -Left JOIN PostTraining_Role AS PostRole ON PostRole.Id = Person.PostTrainingRoleId +--Left JOIN PostTraining_Role AS PostRole ON PostRole.Id = Person.PostTrainingRoleId GO @@ -635,7 +645,6 @@ SELECT Person.PersonName, Person.UnitId, Unit.UnitName, - Post.WorkPostName, WorkAreaName= STUFF((SELECT ',' + UnitWorkName FROM dbo.WBS_UnitWork where PATINDEX('%,' + RTRIM(UnitWorkId) + ',%',',' +Person.WorkAreaId + ',')>0 FOR XML PATH('')), 1, 1,''), TeamGroup.TeamGroupName, Person.InTime, @@ -644,19 +653,20 @@ SELECT Person.IdentityCard, Person.TeamGroupId, Person.WorkPostId, + Post.WorkPostName, Person.IdcardType, Person.PhotoUrl, edu.TrainCount, - PoliticsStatus.dictName AS PoliticsStatusName, - Person.PostTrainingRoleId, - PostRole.Name AS PostTrainingRoleName + PoliticsStatus.dictName AS PoliticsStatusName + --,Person.PostTrainingRoleId, + --PostRole.Name AS PostTrainingRoleName FROM SitePerson_Person AS Person LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = Person.UnitId LEFT JOIN ProjectData_TeamGroup AS TeamGroup ON TeamGroup.TeamGroupId=Person.TeamGroupId LEFT JOIN Base_WorkPost AS Post ON Post.WorkPostId = Person.WorkPostId LEFT JOIN RealName_BasicData AS PoliticsStatus ON PoliticsStatus.dictCode = Person.PoliticsStatus AND PoliticsStatus.DictTypeCode='POLITICAL_LANDSCAPE' LEFT JOIN (select PersonId,count(PersonId)as TrainCount from EduTrain_TrainRecordDetail group by PersonId) as edu on edu.PersonId= Person.PersonId -LEFT JOIN PostTraining_Role AS PostRole ON PostRole.Id = Person.PostTrainingRoleId +--LEFT JOIN PostTraining_Role AS PostRole ON PostRole.Id = Person.PostTrainingRoleId diff --git a/SGGL/BLL/API/APIPersonService.cs b/SGGL/BLL/API/APIPersonService.cs index 6ad72c7a..96394bea 100644 --- a/SGGL/BLL/API/APIPersonService.cs +++ b/SGGL/BLL/API/APIPersonService.cs @@ -468,6 +468,171 @@ namespace BLL #endregion #region 根据培训类型获取项目培训人员信息 + /// + /// 根据培训类型获取项目培训人员信息 + /// + /// 项目ID + /// 培训单位ID + /// 培训岗位ID + /// 培训类型ID + /// + public static List getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId, string InTime, string strParam) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + DateTime inDateTime = DateTime.Now; + if (!string.IsNullOrEmpty(InTime) && !"null".Equals(InTime)) + { + inDateTime = DateTime.Parse(InTime); + } + + List unitIdList = Funs.GetStrListByStr(unitIds, ','); + var getPersons = (from x in db.View_SitePerson_Person + where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.IsUsed == true && (string.IsNullOrEmpty(strParam) || x.PersonName.Contains(strParam)) && (string.IsNullOrEmpty(InTime) || x.InTime < inDateTime) + && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime >= DateTime.Now) + select new Model.PersonItem + { + PersonId = x.PersonId, + CardNo = x.CardNo, + PersonName = x.PersonName, + SexName = x.SexName, + IdentityCard = x.IdentityCard, + Address = x.Address, + ProjectId = x.ProjectId, + ProjectCode = x.ProjectCode, + ProjectName = x.ProjectName, + UnitId = x.UnitId, + UnitCode = x.UnitCode, + UnitName = x.UnitName, + TeamGroupId = x.TeamGroupId, + TeamGroupName = x.TeamGroupName, + WorkPostId = x.WorkPostId, + WorkPostName = x.WorkPostName, + InTime = string.Format("{0:yyyy-MM-dd}", x.InTime), + OutTime = string.Format("{0:yyyy-MM-dd}", x.OutTime), + OutResult = x.OutResult, + Telephone = x.Telephone, + PhotoUrl = x.PhotoUrl, + DepartName = x.DepartName, + }).ToList(); + + + + + if (!string.IsNullOrEmpty(workPostIds)) + { + List workPostIdList = Funs.GetStrListByStr(workPostIds, ','); + getPersons = getPersons.Where(x => workPostIdList.Contains(x.WorkPostId)).ToList(); + } + if (!string.IsNullOrEmpty(trainTypeId) && trainTypeId == Const.SpecialSafeTrainId)//专项安全培训 + { + var ids = db.Base_WorkPost.Where(x => x.PostType == "2").Select(x => x.WorkPostId).ToList(); + getPersons = getPersons.Where(x => ids.Contains(x.WorkPostId)).ToList(); + } + List getTrainPersonList = new List(); + var getTrainType = TrainTypeService.GetTrainTypeById(trainTypeId); + if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat.Value == false)) + { + int score = 80; + var sysTestRule = db.Sys_TestRule.FirstOrDefault(); + if (sysTestRule != null) + { + if (sysTestRule.PassingScore > 0) + { + score = sysTestRule.PassingScore; + } + } + foreach (var item in getPersons) + { + var getTrainPersonIdList3 = (from x in db.Training_TestRecord + join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId + where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.TestManId == item.PersonId + where x.TestScores > score + select x).FirstOrDefault(); + if (getTrainPersonIdList3 != null) + { + continue; + } + var getTrainPersonIdList1 = (from x in db.EduTrain_TrainRecordDetail + join y in db.EduTrain_TrainRecord on x.TrainingId equals y.TrainingId + where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && x.CheckResult == true && x.PersonId == item.PersonId + select x).FirstOrDefault(); + if (getTrainPersonIdList1 == null) + { + var getTrainPersonIdList2 = (from x in db.Training_Task + join y in db.Training_Plan on x.PlanId equals y.PlanId + where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.UserId == item.PersonId + + select x).FirstOrDefault(); + if (getTrainPersonIdList2 == null) + { + getTrainPersonList.Add(item); + } + } + } + return getTrainPersonList; + } + else if (getTrainType != null && getTrainType.IsRepeat.HasValue && getTrainType.IsRepeat.Value == true)//重复的 过滤人员 + { + foreach (var item in getPersons) + { + //int score = 80; + //var sysTestRule = db.Sys_TestRule.FirstOrDefault(); + //if (sysTestRule != null) + //{ + // if (sysTestRule.PassingScore > 0) + // { + // score = sysTestRule.PassingScore; + // } + //} + //var getTrainPersonIdList2 = (from x in db.Training_TestRecord + // join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId + // where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.TestManId == item.PersonId + // where x.TestScores > score + // select x).FirstOrDefault(); + //if (getTrainPersonIdList2 != null) + //{ + // continue; + //} + getTrainPersonList.Add(item); + } + return getTrainPersonList; + } + //else if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat == false))//重复的 过滤人员 + //{ + // int score = 80; + // var sysTestRule = db.Sys_TestRule.FirstOrDefault(); + // if (sysTestRule != null) + // { + // if (sysTestRule.PassingScore > 0) + // { + // score = sysTestRule.PassingScore; + // } + // } + // foreach (var item in getPersons) + // { + + // var getTrainPersonIdList2 = (from x in db.Training_TestRecord + // join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId + // where y.ProjectId == projectId && y.TrainTypeId == trainTypeId && y.States != "3" && x.TestManId == item.PersonId + // where x.TestScores > score + // select x).FirstOrDefault(); + // if (getTrainPersonIdList2 != null) + // { + // continue; + // } + // getTrainPersonList.Add(item); + // } + // return getTrainPersonList; + //} + else + { + return getPersons.ToList(); + } + } + } + + /// /// 根据培训类型获取项目培训人员信息 /// diff --git a/SGGL/BLL/BaseInfo/WorkPostService.cs b/SGGL/BLL/BaseInfo/WorkPostService.cs index 50cf13a4..71956026 100644 --- a/SGGL/BLL/BaseInfo/WorkPostService.cs +++ b/SGGL/BLL/BaseInfo/WorkPostService.cs @@ -51,7 +51,7 @@ namespace BLL /// /// public static void UpdateWorkPost(Model.Base_WorkPost workPost) - { + { Model.SGGLDB db = Funs.DB; Model.Base_WorkPost newWorkPost = db.Base_WorkPost.FirstOrDefault(e => e.WorkPostId == workPost.WorkPostId); if (newWorkPost != null) @@ -260,5 +260,6 @@ namespace BLL return workPostName; } #endregion + } } \ No newline at end of file diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index b89d4158..e3b524eb 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -907,7 +907,7 @@ namespace BLL #region 定义常量 /// - /// 天辰单位id + /// 新疆油建单位id /// public const string UnitId_TCC = "b4f3d912-ca6d-440c-a8d7-bc6a5d5a1f84"; /// @@ -3630,6 +3630,10 @@ namespace BLL /// 岗位培训标准 /// public const string PostTrainingStandardTemplateUrl = "File\\Excel\\DataIn\\岗位培训标准导入模板.xlsx"; + /// + /// 岗位培训人员导入模板 + /// + public const string PostTrainingRecordTemplateUrl = "File\\Excel\\DataIn\\岗位培训人员导入模板.xls"; /// /// 数据导入模版文件原始的虚拟路径 @@ -6327,6 +6331,10 @@ namespace BLL /// 实业数据 /// public const string Project_SYHSEData_SYHSEMenuId = ""; + /// + /// 专项安全培训 id + /// + public static string SpecialSafeTrainId = "0e7fdf78-eaa0-4d00-a60b-490040bbea18"; #endregion /// diff --git a/SGGL/BLL/HSSE/EduTrain/CompanyTrainingItemService.cs b/SGGL/BLL/HSSE/EduTrain/CompanyTrainingItemService.cs index 7b841525..b3d5748a 100644 --- a/SGGL/BLL/HSSE/EduTrain/CompanyTrainingItemService.cs +++ b/SGGL/BLL/HSSE/EduTrain/CompanyTrainingItemService.cs @@ -22,35 +22,39 @@ namespace BLL /// /// 添加公司培训明细 /// - /// - public static void AddCompanyTrainingItem(Model.Training_CompanyTrainingItem companyTrainingItem) + /// + public static void AddCompanyTrainingItem(Model.Training_CompanyTrainingItem model) { - Model.Training_CompanyTrainingItem newCompanyTrainingItem = new Model.Training_CompanyTrainingItem(); - newCompanyTrainingItem.CompanyTrainingItemId = companyTrainingItem.CompanyTrainingItemId; - newCompanyTrainingItem.CompanyTrainingId = companyTrainingItem.CompanyTrainingId; - newCompanyTrainingItem.CompanyTrainingItemCode = companyTrainingItem.CompanyTrainingItemCode; - newCompanyTrainingItem.CompanyTrainingItemName = companyTrainingItem.CompanyTrainingItemName; - newCompanyTrainingItem.AttachUrl = companyTrainingItem.AttachUrl; - newCompanyTrainingItem.CompileMan = companyTrainingItem.CompileMan; - newCompanyTrainingItem.CompileDate = companyTrainingItem.CompileDate; - db.Training_CompanyTrainingItem.InsertOnSubmit(newCompanyTrainingItem); + Model.Training_CompanyTrainingItem newModel = new Model.Training_CompanyTrainingItem(); + newModel.CompanyTrainingItemId = model.CompanyTrainingItemId; + newModel.CompanyTrainingId = model.CompanyTrainingId; + newModel.CompanyTrainingItemCode = model.CompanyTrainingItemCode; + newModel.CompanyTrainingItemName = model.CompanyTrainingItemName; + newModel.AttachUrl = model.AttachUrl; + newModel.CompileMan = model.CompileMan; + newModel.CompileDate = model.CompileDate; + newModel.WorkPostIds = model.WorkPostIds; + newModel.WorkPostNames = model.WorkPostNames; + db.Training_CompanyTrainingItem.InsertOnSubmit(newModel); db.SubmitChanges(); } /// /// 修改公司培训明细 /// - /// - public static void UpdateCompanyTrainingItem(Model.Training_CompanyTrainingItem companyTrainingItem) + /// + public static void UpdateCompanyTrainingItem(Model.Training_CompanyTrainingItem model) { - Model.Training_CompanyTrainingItem newCompanyTrainingItem = db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainingItem.CompanyTrainingItemId); - if (newCompanyTrainingItem != null) + Model.Training_CompanyTrainingItem newModel = db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == model.CompanyTrainingItemId); + if (newModel != null) { - newCompanyTrainingItem.CompanyTrainingItemCode = companyTrainingItem.CompanyTrainingItemCode; - newCompanyTrainingItem.CompanyTrainingItemName = companyTrainingItem.CompanyTrainingItemName; - newCompanyTrainingItem.AttachUrl = companyTrainingItem.AttachUrl; - newCompanyTrainingItem.CompileMan = companyTrainingItem.CompileMan; - newCompanyTrainingItem.CompileDate = companyTrainingItem.CompileDate; + newModel.CompanyTrainingItemCode = model.CompanyTrainingItemCode; + newModel.CompanyTrainingItemName = model.CompanyTrainingItemName; + newModel.AttachUrl = model.AttachUrl; + newModel.CompileMan = model.CompileMan; + newModel.CompileDate = model.CompileDate; + newModel.WorkPostIds = model.WorkPostIds; + newModel.WorkPostNames = model.WorkPostNames; db.SubmitChanges(); } } @@ -61,10 +65,10 @@ namespace BLL /// public static void DeleteCompanyTrainingItemById(string companyTrainItemId) { - Model.Training_CompanyTrainingItem companyTrainingItem = db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainItemId); - if (companyTrainingItem != null) + Model.Training_CompanyTrainingItem model = db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainItemId); + if (model != null) { - db.Training_CompanyTrainingItem.DeleteOnSubmit(companyTrainingItem); + db.Training_CompanyTrainingItem.DeleteOnSubmit(model); db.SubmitChanges(); } } diff --git a/SGGL/BLL/HSSE/PostTraining/PostTrainingRecordService.cs b/SGGL/BLL/HSSE/PostTraining/PostTrainingRecordService.cs index 8c35e28c..9d8ca163 100644 --- a/SGGL/BLL/HSSE/PostTraining/PostTrainingRecordService.cs +++ b/SGGL/BLL/HSSE/PostTraining/PostTrainingRecordService.cs @@ -42,7 +42,8 @@ namespace BLL Method = model.Method, Lecturer = model.Lecturer, UnitIds = model.UnitIds, - RoleIds = model.RoleIds, + //RoleIds = model.RoleIds, + WorkPostIds = model.WorkPostIds, PersonNum = model.PersonNum, TrainingTime = model.TrainingTime, Duration = model.Duration, @@ -74,7 +75,8 @@ namespace BLL newModel.Method = model.Method; newModel.Lecturer = model.Lecturer; newModel.UnitIds = model.UnitIds; - newModel.RoleIds = model.RoleIds; + newModel.WorkPostIds = model.WorkPostIds; + //newModel.RoleIds = model.RoleIds; newModel.PersonNum = model.PersonNum; newModel.TrainingTime = model.TrainingTime; newModel.Duration = model.Duration; diff --git a/SGGL/BLL/HSSE/PostTraining/PostTrainingStandardService.cs b/SGGL/BLL/HSSE/PostTraining/PostTrainingStandardService.cs index 02e5a91f..c87130c4 100644 --- a/SGGL/BLL/HSSE/PostTraining/PostTrainingStandardService.cs +++ b/SGGL/BLL/HSSE/PostTraining/PostTrainingStandardService.cs @@ -32,7 +32,8 @@ namespace BLL { Id = model.Id, Code = model.Code, - RoleId = model.RoleId, + //RoleId = model.RoleId, + WorkPostId = model.WorkPostId, CourseId = model.CourseId, ClassHour = model.ClassHour, Cycle = model.Cycle, @@ -57,7 +58,8 @@ namespace BLL if (newModel != null) { newModel.Code = model.Code; - newModel.RoleId = model.RoleId; + //newModel.RoleId = model.RoleId; + newModel.WorkPostId = model.WorkPostId; newModel.CourseId = model.CourseId; newModel.ClassHour = model.ClassHour; newModel.Cycle = model.Cycle; @@ -102,12 +104,15 @@ namespace BLL var db = Funs.DB; var lst = (from x in db.PostTraining_Standard join y in db.PostTraining_Course on x.CourseId equals y.Id - join z in db.PostTraining_Role on x.RoleId equals z.Id + join z in db.Base_WorkPost on x.WorkPostId equals z.WorkPostId + //join z in db.PostTraining_Role on x.RoleId equals z.Id orderby x.Code select new PostTrainingStandardInfo { - RoleId = x.RoleId, - RoleName = z.Name, + WorkPostId = x.WorkPostId, + WorkPostName = z.WorkPostName, + //RoleId = x.RoleId, + //RoleName = z.RoleName, CourseId = x.CourseId, CourseName = y.Name, CategoryName = y.CategoryName, @@ -155,8 +160,9 @@ namespace BLL var lstStandard = GetStandardInfoList(); //培训课程 var lstCourse = PostTrainingCourseService.GetCourseList(); - //培训角色 - var lstRole = PostTrainingRoleService.GetRoleList(); + ////培训角色 + //var lstRole = PostTrainingRoleService.GetRoleList(); + var lstWorkPost = WorkPostService.GetWorkPostList(); //培训类别 var lstCategory = PostTrainingCategoryService.GetCategoryList(); //培训方式 @@ -186,7 +192,7 @@ namespace BLL if (!string.IsNullOrWhiteSpace(roleName)) { - if (!lstRole.Where(x => x.Name == roleName).Any()) + if (!lstWorkPost.Where(x => x.WorkPostName == roleName).Any()) { Model.ErrorInfo errorInfo = new Model.ErrorInfo(); errorInfo.Row = rowIndex.ToString(); @@ -392,7 +398,8 @@ namespace BLL CompileMan = creatUserId }; newModel.CourseId = lstCourse.Where(x => x.Name == courseName).FirstOrDefault().Id; - newModel.RoleId = lstRole.Where(x => x.Name == roleName).FirstOrDefault().Id; + //newModel.RoleId = lstRole.Where(x => x.Name == roleName).FirstOrDefault().Id; + newModel.WorkPostId = lstWorkPost.Where(x => x.WorkPostName == roleName).FirstOrDefault().WorkPostId; newModel.ClassHour = classHour; newModel.Cycle = cycle; newModel.Method = method; diff --git a/SGGL/BLL/HSSE/SitePerson/PersonService.cs b/SGGL/BLL/HSSE/SitePerson/PersonService.cs index f9ab3cf6..8c2c6477 100644 --- a/SGGL/BLL/HSSE/SitePerson/PersonService.cs +++ b/SGGL/BLL/HSSE/SitePerson/PersonService.cs @@ -344,7 +344,7 @@ namespace BLL TeamGroupId = person.TeamGroupId, WorkAreaId = person.WorkAreaId, WorkPostId = person.WorkPostId, - PostTrainingRoleId = person.PostTrainingRoleId, + //PostTrainingRoleId = person.PostTrainingRoleId, OutTime = person.OutTime, OutResult = person.OutResult, Telephone = person.Telephone, @@ -424,7 +424,7 @@ namespace BLL newPerson.TeamGroupId = person.TeamGroupId; newPerson.WorkAreaId = person.WorkAreaId; newPerson.WorkPostId = person.WorkPostId; - newPerson.PostTrainingRoleId = person.PostTrainingRoleId; + //newPerson.PostTrainingRoleId = person.PostTrainingRoleId; newPerson.InTime = person.InTime; newPerson.OutTime = person.OutTime; newPerson.IsSafetyMonitoring = person.IsSafetyMonitoring; diff --git a/SGGL/BLL/SysManage/DepartService.cs b/SGGL/BLL/SysManage/DepartService.cs index 239a78da..f0e4e08c 100644 --- a/SGGL/BLL/SysManage/DepartService.cs +++ b/SGGL/BLL/SysManage/DepartService.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; namespace BLL { @@ -12,7 +10,7 @@ namespace BLL /// /// 根据主键获取信息 /// - /// + /// /// public static Model.Base_Depart GetDepartById(string departId) { @@ -22,7 +20,7 @@ namespace BLL /// /// 添加 /// - /// + /// public static void AddDepart(Model.Base_Depart depart) { Model.SGGLDB db = Funs.DB; @@ -41,7 +39,7 @@ namespace BLL /// /// 修改 /// - /// + /// public static void UpdateDepart(Model.Base_Depart depart) { Model.SGGLDB db = Funs.DB; @@ -82,7 +80,7 @@ namespace BLL /// /// 根据主键获取信息 /// - /// + /// /// public static string getDepartNameById(string departId) { @@ -113,5 +111,64 @@ namespace BLL } } #endregion + + + #region 根据多部门ID得到岗位名称字符串 + + /// + /// 根据多部门ID得到岗位名称字符串 + /// + /// + /// + public static string getDepartNamesByIds(object departIdsIds) + { + string departName = string.Empty; + if (departIdsIds != null) + { + string[] ids = departIdsIds.ToString().Split(','); + foreach (string id in ids) + { + var q = GetDepartById(id); + if (q != null) + { + departName += q.DepartName + ","; + } + } + if (departName != string.Empty) + { + departName = departName.Substring(0, departName.Length - 1); ; + } + } + + return departName; + } + public static string getDepartNamesByIdsForApi(object departIdsIds) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + string departName = string.Empty; + if (departIdsIds != null) + { + string[] ids = departIdsIds.ToString().Split(','); + foreach (string id in ids) + { + var q = db.Base_Depart.FirstOrDefault(e => e.DepartId == id); + if (q != null) + { + departName += q.DepartName + ","; + } + } + if (departName != string.Empty) + { + departName = departName.Substring(0, departName.Length - 1); ; + } + } + + return departName; + } + } + + #endregion + } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx b/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx index 5a72b200..edcb5849 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx +++ b/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx @@ -14,7 +14,7 @@ @@ -37,10 +37,10 @@ - - @@ -90,9 +90,13 @@ - + + <%-- - + --%> @@ -180,7 +184,7 @@ var btnSaveClientID = '<%= btnSave.ClientID %>'; var formClientID = '<%= SimpleForm1.ClientID %>'; var hfFormIDClientID = '<%= hfFormID.ClientID %>'; - var drpCodeClientID = '<%= drpWorkPostCode.ClientID %>'; + var txtCodeClientID = '<%= txtWorkPostCode.ClientID %>'; var txtNameClientID = '<%= txtWorkPostName.ClientID %>'; var drpPostTypeClientID = '<%= drpPostType.ClientID %>'; var ckbIsHsseClientID = '<%= ckbIsHsse.ClientID %>'; @@ -198,7 +202,7 @@ // 使用当前行数据填充表单字段 F(hfFormIDClientID).setValue(rowId); - F(drpCodeClientID).setValue(rowValue['WorkPostCode']); + F(txtCodeClientID).setValue(rowValue['WorkPostCode']); F(txtNameClientID).setValue(rowValue['WorkPostName']); F(drpPostTypeClientID).setValue(rowValue['PostType']); F(ckbIsHsseClientID).setValue(rowValue['IsHsse']); diff --git a/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx.cs index ea290fdc..b5728dc7 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx.cs +++ b/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx.cs @@ -18,8 +18,8 @@ namespace FineUIPro.Web.BaseInfo ////权限按钮方法 this.GetButtonPower(); Funs.DropDownPageSize(this.ddlPageSize); - //岗位类型 - BasicDataService.InitBasicDataCodeAndNameDropDownList(this.drpWorkPostCode, "LAB_WORK_TYPE", true); + ////岗位类型 + //BasicDataService.InitBasicDataCodeAndNameDropDownList(this.drpWorkPostCode, "LAB_WORK_TYPE", true); BLL.ConstValue.InitConstValueDropDownList(this.drpPostType, ConstValue.Group_PostType, true); if (this.CurrUser != null && this.CurrUser.PageSize.HasValue) { @@ -28,6 +28,8 @@ namespace FineUIPro.Web.BaseInfo gvCNCodes.DataSource = BLL.CNProfessionalService.GetList(); gvCNCodes.DataBind(); this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + ////自动生成编码 + this.txtWorkPostCode.Text = SQLHelper.RunProcNewId("SpGetNewCode3", "dbo.Base_WorkPost", "WorkPostCode", ""); // 绑定表格 BindGrid(); } @@ -45,7 +47,7 @@ namespace FineUIPro.Web.BaseInfo if (!string.IsNullOrEmpty(this.txtKey.Text.Trim())) { - strSql += "where wp.WorkPostName like '%"+this.txtKey.Text.Trim()+"%' "; + strSql += "where wp.WorkPostName like '%" + this.txtKey.Text.Trim() + "%' "; } List listStr = new List(); //strSql += " AND HazardList.ProjectId = @ProjectId"; @@ -108,7 +110,7 @@ namespace FineUIPro.Web.BaseInfo /// protected void btnDelete_Click(object sender, EventArgs e) { - BLL.LogService.AddSys_Log(this.CurrUser, this.drpWorkPostCode.SelectedValue, hfFormID.Text, BLL.Const.WorkPostMenuId, BLL.Const.BtnDelete); + BLL.LogService.AddSys_Log(this.CurrUser, this.txtWorkPostCode.Text.Trim(), hfFormID.Text, BLL.Const.WorkPostMenuId, BLL.Const.BtnDelete); BLL.WorkPostService.DeleteWorkPostById(hfFormID.Text); // 重新绑定表格,并模拟点击[新增按钮] @@ -127,8 +129,8 @@ namespace FineUIPro.Web.BaseInfo Response.Write(GetGridTableHtml(Grid1)); Response.End(); } - - + + /// /// 右键删除事件 /// @@ -170,7 +172,8 @@ namespace FineUIPro.Web.BaseInfo var workPost = BLL.WorkPostService.GetWorkPostById(Id); if (workPost != null) { - this.drpWorkPostCode.SelectedValue = workPost.WorkPostCode; + //this.drpWorkPostCode.SelectedValue = workPost.WorkPostCode; + this.txtWorkPostCode.Text = workPost.WorkPostCode; this.txtWorkPostName.Text = workPost.WorkPostName; if (!string.IsNullOrEmpty(workPost.PostType)) { @@ -198,7 +201,7 @@ namespace FineUIPro.Web.BaseInfo { BindGrid(); } - protected void btnQuery_Click(object sender, EventArgs e) + protected void btnQuery_Click(object sender, EventArgs e) { BindGrid(); } @@ -209,11 +212,11 @@ namespace FineUIPro.Web.BaseInfo /// protected void btnSave_Click(object sender, EventArgs e) { - if (this.drpWorkPostCode.SelectedValue == BLL.Const._Null) - { - ShowNotify("请选择编号!", MessageBoxIcon.Warning); - return; - } + //if (this.drpWorkPostCode.SelectedValue == BLL.Const._Null) + //{ + // ShowNotify("请选择编号!", MessageBoxIcon.Warning); + // return; + //} if (this.drpPostType.SelectedValue == BLL.Const._Null) { ShowNotify("请选择类型!", MessageBoxIcon.Warning); @@ -222,7 +225,8 @@ namespace FineUIPro.Web.BaseInfo string strRowID = hfFormID.Text; Model.Base_WorkPost newWorkPost = new Model.Base_WorkPost { - WorkPostCode = this.drpWorkPostCode.SelectedValue, + //WorkPostCode = this.drpWorkPostCode.SelectedValue, + WorkPostCode = this.txtWorkPostCode.Text.Trim(), WorkPostName = this.txtWorkPostName.Text.Trim(), PostType = this.drpPostType.SelectedValue, IsHsse = Convert.ToBoolean(this.ckbIsHsse.Checked), @@ -289,11 +293,11 @@ namespace FineUIPro.Web.BaseInfo /// protected void TextBox_TextChanged(object sender, EventArgs e) { - //var q = Funs.DB.Base_WorkPost.FirstOrDefault(x => x.WorkPostCode == this.txtWorkPostCode.Text.Trim() && (x.WorkPostId != hfFormID.Text || (hfFormID.Text == null && x.WorkPostId != null))); - //if (q != null) - //{ - // ShowNotify("输入的岗位编号已存在!", MessageBoxIcon.Warning); - //} + var q = Funs.DB.Base_WorkPost.FirstOrDefault(x => x.WorkPostCode == this.txtWorkPostCode.Text.Trim() && (x.WorkPostId != hfFormID.Text || (hfFormID.Text == null && x.WorkPostId != null))); + if (q != null) + { + ShowNotify("输入的岗位编号已存在!", MessageBoxIcon.Warning); + } var q2 = Funs.DB.Base_WorkPost.FirstOrDefault(x => x.WorkPostName == this.txtWorkPostName.Text.Trim() && (x.WorkPostId != hfFormID.Text || (hfFormID.Text == null && x.WorkPostId != null))); if (q2 != null) diff --git a/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx.designer.cs b/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx.designer.cs index 616dd3bd..d1c5807a 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/BaseInfo/WorkPost.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.BaseInfo { - - - public partial class WorkPost { - +namespace FineUIPro.Web.BaseInfo +{ + + + public partial class WorkPost + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar2 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// /// txtKey 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtKey; - + /// /// btnQuery 控件。 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnQuery; - + /// /// btnOut 控件。 /// @@ -83,7 +85,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnOut; - + /// /// Label1 控件。 /// @@ -92,7 +94,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label1; - + /// /// Label4 控件。 /// @@ -101,7 +103,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label4; - + /// /// ToolbarSeparator1 控件。 /// @@ -110,7 +112,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -119,7 +121,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -128,7 +130,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// SimpleForm1 控件。 /// @@ -137,7 +139,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.SimpleForm SimpleForm1; - + /// /// hfFormID 控件。 /// @@ -146,16 +148,16 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.HiddenField hfFormID; - + /// - /// drpWorkPostCode 控件。 + /// txtWorkPostCode 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList drpWorkPostCode; - + protected global::FineUIPro.TextBox txtWorkPostCode; + /// /// txtWorkPostName 控件。 /// @@ -164,7 +166,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtWorkPostName; - + /// /// drpPostType 控件。 /// @@ -173,7 +175,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpPostType; - + /// /// ckbIsHsse 控件。 /// @@ -182,7 +184,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.CheckBox ckbIsHsse; - + /// /// ckbIsCQMS 控件。 /// @@ -191,7 +193,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.CheckBox ckbIsCQMS; - + /// /// txtCNCodes 控件。 /// @@ -200,7 +202,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownBox txtCNCodes; - + /// /// gvCNCodes 控件。 /// @@ -209,7 +211,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid gvCNCodes; - + /// /// txtRemark 控件。 /// @@ -218,7 +220,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextArea txtRemark; - + /// /// lb1 控件。 /// @@ -227,7 +229,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lb1; - + /// /// Label2 控件。 /// @@ -236,7 +238,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label Label2; - + /// /// Label3 控件。 /// @@ -245,7 +247,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label Label3; - + /// /// Toolbar1 控件。 /// @@ -254,7 +256,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// btnNew 控件。 /// @@ -263,7 +265,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnNew; - + /// /// btnDelete 控件。 /// @@ -272,7 +274,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnDelete; - + /// /// ToolbarFill1 控件。 /// @@ -281,7 +283,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// btnSave 控件。 /// @@ -290,7 +292,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnSave; - + /// /// Menu1 控件。 /// @@ -299,7 +301,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuEdit 控件。 /// @@ -308,7 +310,7 @@ namespace FineUIPro.Web.BaseInfo { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuEdit; - + /// /// btnMenuDelete 控件。 /// diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/岗位培训人员导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/岗位培训人员导入模板.xls new file mode 100644 index 00000000..df3c94c1 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataIn/岗位培训人员导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/FileUpload/BehavioralSafetyObservation/2025-02/638748872664319892_111.png b/SGGL/FineUIPro.Web/FileUpload/BehavioralSafetyObservation/2025-02/638748872664319892_111.png deleted file mode 100644 index 91820e72..00000000 Binary files a/SGGL/FineUIPro.Web/FileUpload/BehavioralSafetyObservation/2025-02/638748872664319892_111.png and /dev/null differ diff --git a/SGGL/FineUIPro.Web/FileUpload/CoConstructionActivities/2025-02/638748864252160655_222.png b/SGGL/FineUIPro.Web/FileUpload/CoConstructionActivities/2025-02/638748864252160655_222.png deleted file mode 100644 index 3ae008e9..00000000 Binary files a/SGGL/FineUIPro.Web/FileUpload/CoConstructionActivities/2025-02/638748864252160655_222.png and /dev/null differ diff --git a/SGGL/FineUIPro.Web/FileUpload/Examine/BonusScoreSituation/2025-02/638748932899212069_111.png b/SGGL/FineUIPro.Web/FileUpload/Examine/BonusScoreSituation/2025-02/638748932899212069_111.png deleted file mode 100644 index 91820e72..00000000 Binary files a/SGGL/FineUIPro.Web/FileUpload/Examine/BonusScoreSituation/2025-02/638748932899212069_111.png and /dev/null differ diff --git a/SGGL/FineUIPro.Web/FileUpload/SharingOfSafetyExperience/2025-02/638748699221013912_111.png b/SGGL/FineUIPro.Web/FileUpload/SharingOfSafetyExperience/2025-02/638748699221013912_111.png deleted file mode 100644 index 91820e72..00000000 Binary files a/SGGL/FineUIPro.Web/FileUpload/SharingOfSafetyExperience/2025-02/638748699221013912_111.png and /dev/null differ diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index f6e672aa..203c1caa 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1851,6 +1851,8 @@ + + @@ -1936,6 +1938,7 @@ + @@ -2217,6 +2220,7 @@ + @@ -2416,6 +2420,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -12642,6 +12691,20 @@ TaskNoticeEdit.aspx + + TrainFindWorkPost.aspx + ASPXCodeBehind + + + TrainFindWorkPost.aspx + + + Trainingrecords.aspx + ASPXCodeBehind + + + Trainingrecords.aspx + TrainTestRecordEdit.aspx ASPXCodeBehind @@ -13237,6 +13300,13 @@ OnePersonPerFile.aspx + + StaffHSEInfoArchivesOld.aspx + ASPXCodeBehind + + + StaffHSEInfoArchivesOld.aspx + StaffHSEInfoArchives.aspx ASPXCodeBehind @@ -15204,6 +15274,13 @@ CategoryEdit.aspx + + RecordIn.aspx + ASPXCodeBehind + + + RecordIn.aspx + EquipmentPersonQuality.aspx ASPXCodeBehind @@ -16296,6 +16373,321 @@ PersonDuty.aspx + + AccidentCase.aspx + ASPXCodeBehind + + + AccidentCase.aspx + + + AccidentCaseItemSave.aspx + ASPXCodeBehind + + + AccidentCaseItemSave.aspx + + + AccidentCaseItemSelectCloumn.aspx + ASPXCodeBehind + + + AccidentCaseItemSelectCloumn.aspx + + + AccidentCaseSave.aspx + ASPXCodeBehind + + + AccidentCaseSave.aspx + + + CompanyTraining.aspx + ASPXCodeBehind + + + CompanyTraining.aspx + + + CompanyTrainingItemSave.aspx + ASPXCodeBehind + + + CompanyTrainingItemSave.aspx + + + CompanyTrainingSave.aspx + ASPXCodeBehind + + + CompanyTrainingSave.aspx + + + Plan.aspx + ASPXCodeBehind + + + Plan.aspx + + + PlanEdit.aspx + ASPXCodeBehind + + + PlanEdit.aspx + + + PlanView.aspx + ASPXCodeBehind + + + PlanView.aspx + + + ShowPerson.aspx + ASPXCodeBehind + + + ShowPerson.aspx + + + Task.aspx + ASPXCodeBehind + + + Task.aspx + + + TaskNotice.aspx + ASPXCodeBehind + + + TaskNotice.aspx + + + TaskNoticeEdit.aspx + ASPXCodeBehind + + + TaskNoticeEdit.aspx + + + TaskRecordView.aspx + ASPXCodeBehind + + + TaskRecordView.aspx + + + TaskView.aspx + ASPXCodeBehind + + + TaskView.aspx + + + TestPlan.aspx + ASPXCodeBehind + + + TestPlan.aspx + + + TestPlanView.aspx + ASPXCodeBehind + + + TestPlanView.aspx + + + TestRecord.aspx + ASPXCodeBehind + + + TestRecord.aspx + + + TestRecordItem.aspx + ASPXCodeBehind + + + TestRecordItem.aspx + + + TestRecordPrint.aspx + ASPXCodeBehind + + + TestRecordPrint.aspx + + + TestRecordView.aspx + ASPXCodeBehind + + + TestRecordView.aspx + + + TestStatistics.aspx + ASPXCodeBehind + + + TestStatistics.aspx + + + TestTraining.aspx + ASPXCodeBehind + + + TestTraining.aspx + + + TestTrainingItemIn.aspx + ASPXCodeBehind + + + TestTrainingItemIn.aspx + + + TestTrainingItemSave.aspx + ASPXCodeBehind + + + TestTrainingItemSave.aspx + + + TestTrainingOut.aspx + ASPXCodeBehind + + + TestTrainingOut.aspx + + + TestTrainingSave.aspx + ASPXCodeBehind + + + TestTrainingSave.aspx + + + TestTrainRecord.aspx + ASPXCodeBehind + + + TestTrainRecord.aspx + + + TrainDB.aspx + ASPXCodeBehind + + + TrainDB.aspx + + + TrainFind.aspx + ASPXCodeBehind + + + TrainFind.aspx + + + TrainingItemSave.aspx + ASPXCodeBehind + + + TrainingItemSave.aspx + + + TrainingSave.aspx + ASPXCodeBehind + + + TrainingSave.aspx + + + TrainRecord.aspx + ASPXCodeBehind + + + TrainRecord.aspx + + + TrainRecordEdit.aspx + ASPXCodeBehind + + + TrainRecordEdit.aspx + + + TrainRecordIn.aspx + ASPXCodeBehind + + + TrainRecordIn.aspx + + + TrainRecordView.aspx + ASPXCodeBehind + + + TrainRecordView.aspx + + + TrainTest.aspx + ASPXCodeBehind + + + TrainTest.aspx + + + TrainTestDB.aspx + ASPXCodeBehind + + + TrainTestDB.aspx + + + TrainTestDBEdit.aspx + ASPXCodeBehind + + + TrainTestDBEdit.aspx + + + TrainTestDBSelectCloumn.aspx + ASPXCodeBehind + + + TrainTestDBSelectCloumn.aspx + + + TrainTestItemEdit.aspx + ASPXCodeBehind + + + TrainTestItemEdit.aspx + + + TrainTestRecord.aspx + ASPXCodeBehind + + + TrainTestRecord.aspx + + + TrainTestRecordEdit.aspx + ASPXCodeBehind + + + TrainTestRecordEdit.aspx + + + TrainTestView.aspx + ASPXCodeBehind + + + TrainTestView.aspx + PersonCheck.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/AccidentCase.aspx b/SGGL/FineUIPro.Web/HSSE/EduTrain/AccidentCase.aspx index cc7a5b2f..eecce94c 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/AccidentCase.aspx +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/AccidentCase.aspx @@ -9,134 +9,141 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/CompanyTrainingItemSave.aspx.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/CompanyTrainingItemSave.aspx.cs index 8af4d386..326f3c7c 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/CompanyTrainingItemSave.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/CompanyTrainingItemSave.aspx.cs @@ -2,6 +2,8 @@ using System.Linq; using Model; using BLL; +using System.Collections.Generic; +using Microsoft.Office.Interop.Excel; namespace FineUIPro.Web.HSSE.EduTrain { @@ -46,22 +48,47 @@ namespace FineUIPro.Web.HSSE.EduTrain { this.GetButtonPower(); btnClose.OnClientClick = ActiveWindow.GetHideReference(); - + BoundTree(treeTestTraining.Nodes, "0"); + BindEnumrableToDropDownList(); this.CompanyTrainingItemId = Request.QueryString["CompanyTrainingItemId"]; this.CompanyTrainingId = Request.QueryString["CompanyTrainingId"]; if (!string.IsNullOrEmpty(this.CompanyTrainingItemId)) { - var q = CompanyTrainingItemService.GetCompanyTrainingItemById(this.CompanyTrainingItemId); - if (q != null) + var model = CompanyTrainingItemService.GetCompanyTrainingItemById(this.CompanyTrainingItemId); + if (model != null) { - this.CompanyTrainingId = q.CompanyTrainingId; - txtCompanyTrainingItemCode.Text = q.CompanyTrainingItemCode; - txtCompanyTrainingItemName.Text = q.CompanyTrainingItemName; - txtCompileMan.Text = q.CompileMan; - hdCompileMan.Text = q.CompileMan; - if (q.CompileDate != null) + this.CompanyTrainingId = model.CompanyTrainingId; + txtCompanyTrainingItemCode.Text = model.CompanyTrainingItemCode; + txtCompanyTrainingItemName.Text = model.CompanyTrainingItemName; + txtCompileMan.Text = model.CompileMan; + hdCompileMan.Text = model.CompileMan; + if (!string.IsNullOrEmpty(model.TestTrainingIds)) { - txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", q.CompileDate); + ddTestTraining.Values = model.TestTrainingIds.Split(','); + string text = ""; + var trains = Funs.DB.Training_TestTraining.ToList(); + foreach (var ids in ddTestTraining.Values) + { + var t = trains.FirstOrDefault(x => x.TrainingId == ids); + if (t != null) + { + text += "[" + t.TrainingCode + "]" + t.TrainingName + ","; + } + } + ddTestTraining.Text = text.TrimEnd(new char[] { ',' }); + } + if (!string.IsNullOrEmpty(model.WorkPostIds)) + { + string[] ids1 = model.WorkPostIds.Split(','); + DropDownBox1.Values = ids1; + } + if (model.LearningTime.HasValue) + { + txtLearningTime.Text = (model.LearningTime.Value/60).ToString(); + } + if (model.CompileDate != null) + { + txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", model.CompileDate); } } } @@ -77,39 +104,101 @@ namespace FineUIPro.Web.HSSE.EduTrain txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); } } + + } } - #endregion + private void BindEnumrableToDropDownList() + { + List workPostList = BLL.WorkPostService.GetWorkPostList(); + RadioButtonList1.DataTextField = "WorkPostName"; + RadioButtonList1.DataValueField = "WorkPostId"; + RadioButtonList1.DataSource = workPostList; + RadioButtonList1.DataBind(); + } + + #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 保存 /// /// 保存数据 /// private void SaveData(bool isClose) { - Model.Training_CompanyTrainingItem newCompanyTrainItem = new Training_CompanyTrainingItem + Model.Training_CompanyTrainingItem newModel = new Training_CompanyTrainingItem { CompanyTrainingItemCode = this.txtCompanyTrainingItemCode.Text.Trim(), CompanyTrainingItemName = this.txtCompanyTrainingItemName.Text.Trim(), CompileMan = hdCompileMan.Text.Trim() }; + if (!string.IsNullOrEmpty(DropDownBox1.Text)) + { + newModel.WorkPostIds = String.Join(",", DropDownBox1.Values); + newModel.WorkPostNames = String.Join(",", DropDownBox1.Texts); + } + if (ddTestTraining.Values != null && ddTestTraining.Values.Length > 0) + { + newModel.TestTrainingIds = string.Join(",", ddTestTraining.Values); + } + if (!string.IsNullOrEmpty(txtLearningTime.Text)) + { + newModel.LearningTime = int.Parse(txtLearningTime.Text)*60; + } if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim())) { - newCompanyTrainItem.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim()); + newModel.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim()); } if (!string.IsNullOrEmpty(this.CompanyTrainingItemId)) { - newCompanyTrainItem.CompanyTrainingItemId = this.CompanyTrainingItemId; - BLL.CompanyTrainingItemService.UpdateCompanyTrainingItem(newCompanyTrainItem); - BLL.LogService.AddSys_Log(this.CurrUser, newCompanyTrainItem.CompanyTrainingItemCode, newCompanyTrainItem.CompanyTrainingItemId,BLL.Const.CompanyTrainingMenuId,BLL.Const.BtnModify); + newModel.CompanyTrainingItemId = this.CompanyTrainingItemId; + BLL.CompanyTrainingItemService.UpdateCompanyTrainingItem(newModel); + BLL.LogService.AddSys_Log(this.CurrUser, newModel.CompanyTrainingItemCode, newModel.CompanyTrainingItemId,BLL.Const.CompanyTrainingMenuId,BLL.Const.BtnModify); } else { - newCompanyTrainItem.CompanyTrainingId = this.CompanyTrainingId; + newModel.CompanyTrainingId = this.CompanyTrainingId; this.CompanyTrainingItemId = SQLHelper.GetNewID(typeof(Model.Training_CompanyTrainingItem)); - newCompanyTrainItem.CompanyTrainingItemId = this.CompanyTrainingItemId; - BLL.CompanyTrainingItemService.AddCompanyTrainingItem(newCompanyTrainItem); - BLL.LogService.AddSys_Log(this.CurrUser, newCompanyTrainItem.CompanyTrainingItemCode, newCompanyTrainItem.CompanyTrainingItemId, BLL.Const.CompanyTrainingMenuId, BLL.Const.BtnAdd); + newModel.CompanyTrainingItemId = this.CompanyTrainingItemId; + BLL.CompanyTrainingItemService.AddCompanyTrainingItem(newModel); + BLL.LogService.AddSys_Log(this.CurrUser, newModel.CompanyTrainingItemCode, newModel.CompanyTrainingItemId, BLL.Const.CompanyTrainingMenuId, BLL.Const.BtnAdd); } if (isClose) { diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/CompanyTrainingItemSave.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/CompanyTrainingItemSave.aspx.designer.cs index 676b7c19..2bf6e5a4 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/CompanyTrainingItemSave.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/CompanyTrainingItemSave.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.EduTrain { - - - public partial class CompanyTrainingItemSave { - +namespace FineUIPro.Web.HSSE.EduTrain +{ + + + public partial class CompanyTrainingItemSave + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// SimpleForm1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form SimpleForm1; - + /// /// txtCompanyTrainingItemCode 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtCompanyTrainingItemCode; - + /// /// txtCompanyTrainingItemName 控件。 /// @@ -56,7 +58,70 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtCompanyTrainingItemName; - + + /// + /// DropDownBox1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownBox DropDownBox1; + + /// + /// SimpleForm2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.SimpleForm SimpleForm2; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label1; + + /// + /// RadioButtonList1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBoxList RadioButtonList1; + + /// + /// ddTestTraining 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownBox ddTestTraining; + + /// + /// treeTestTraining 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree treeTestTraining; + + /// + /// txtLearningTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtLearningTime; + /// /// txtCompileMan 控件。 /// @@ -65,7 +130,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtCompileMan; - + /// /// txtCompileDate 控件。 /// @@ -74,7 +139,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtCompileDate; - + /// /// Toolbar1 控件。 /// @@ -83,7 +148,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// lbTemp 控件。 /// @@ -92,7 +157,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lbTemp; - + /// /// btnAttachUrl 控件。 /// @@ -101,7 +166,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnAttachUrl; - + /// /// ToolbarFill1 控件。 /// @@ -110,7 +175,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// btnSave 控件。 /// @@ -119,7 +184,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnSave; - + /// /// btnClose 控件。 /// @@ -128,7 +193,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnClose; - + /// /// hdCompileMan 控件。 /// @@ -137,7 +202,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.HiddenField hdCompileMan; - + /// /// WindowAtt 控件。 /// diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx b/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx index 5224f5fa..4061f97b 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx @@ -33,24 +33,33 @@ + + - - + + + - - - + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx.cs index 06f57523..7371ef13 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx.cs @@ -64,8 +64,9 @@ namespace FineUIPro.Web.HSSE.EduTrain if (trainingPlan != null) { - this.txtPlanName.Text = trainingPlan.PlanName; - this.txtTrainContent.Text = trainingPlan.TrainContent; + this.txtPlanCode.Text = trainingPlan.PlanCode; + this.txtPlanName.Text = trainingPlan.PlanName; + this.txtTrainContent.Text = trainingPlan.TrainContent; this.txtTeachMan.Text = trainingPlan.TeachMan; if (trainingPlan.TeachHour.HasValue) this.txtTeachHour.Text = trainingPlan.TeachHour.Value.ToString("0.##"); @@ -90,7 +91,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { dpCompanyTraining.SelectedValueArray = planItem; } - var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, trainingPlan.UnitIds, trainingPlan.WorkPostId, trainingPlan.TrainTypeId).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList(); + var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, trainingPlan.UnitIds, trainingPlan.WorkPostId,"", trainingPlan.TrainTypeId,"","").OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList(); dpSysUser.DataTextField = "PersonName"; dpSysUser.DataValueField = "PersonId"; dpSysUser.DataSource = getDataList; @@ -102,7 +103,12 @@ namespace FineUIPro.Web.HSSE.EduTrain dpSysUser.SelectedValueArray = userids; } } - } + } + else + { + string code = ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId).ProjectCode + "-"; + txtPlanCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Training_Plan", "PlanCode", this.CurrUser.LoginProjectId, code); + } } } #endregion @@ -259,8 +265,9 @@ namespace FineUIPro.Web.HSSE.EduTrain Model.Training_Plan trainingPlan = new Model.Training_Plan(); trainingPlan.ProjectId = this.CurrUser.LoginProjectId; - trainingPlan.PlanName = this.txtPlanName.Text; - trainingPlan.TrainContent = this.txtTrainContent.Text; + trainingPlan.PlanName = this.txtPlanName.Text; + trainingPlan.PlanCode = this.txtPlanCode.Text; + trainingPlan.TrainContent = this.txtTrainContent.Text; trainingPlan.TeachMan = this.txtTeachMan.Text; trainingPlan.TeachHour =decimal.Parse( this.txtTeachHour.Text); trainingPlan.TrainStartDate = this.dpTrainStartDate.SelectedDate; @@ -280,7 +287,10 @@ namespace FineUIPro.Web.HSSE.EduTrain } if (string.IsNullOrEmpty(PlanId)) { - trainingPlan.PlanCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectTrainingPlanMenuId, CurrUser.LoginProjectId, CurrUser.UnitId); + //string code = ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId).ProjectCode + "-"; + //trainingPlan.PlanCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Training_Plan", "PlanCode", this.CurrUser.LoginProjectId, code); + + //trainingPlan.PlanCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectTrainingPlanMenuId, CurrUser.LoginProjectId, CurrUser.UnitId); trainingPlan.PlanId = SQLHelper.GetNewID(); TrainingPlanService.AddPlan(trainingPlan); CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectTrainingPlanMenuId, trainingPlan.ProjectId, null, trainingPlan.PlanId, trainingPlan.DesignerDate); @@ -431,7 +441,7 @@ namespace FineUIPro.Web.HSSE.EduTrain dpSysUser.Items.Clear(); string unitIds=string.Join(",",dpUnit.SelectedValue); string workPostIds = string.Join(",", dpWorkPost.SelectedValue); - var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, unitIds, workPostIds, drpTrainType.SelectedValue).OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList(); + var getDataList = APIPersonService.getTrainingPersonListByTrainTypeId(this.CurrUser.LoginProjectId, unitIds, workPostIds,"", drpTrainType.SelectedValue,"","").OrderBy(x => x.UnitName).ThenBy(x => x.ProjectName).ToList(); dpSysUser.DataTextField = "PersonName"; dpSysUser.DataValueField = "PersonId"; dpSysUser.DataSource = getDataList; diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx.designer.cs index ea0349dc..cb0a9854 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/PlanEdit.aspx.designer.cs @@ -11,223 +11,232 @@ namespace FineUIPro.Web.HSSE.EduTrain { - public partial class PlanEdit - { + public partial class PlanEdit + { - /// - /// form1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; - /// - /// PageManager1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.PageManager PageManager1; + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; - /// - /// SimpleForm1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Form SimpleForm1; + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; - /// - /// txtPlanName 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtPlanName; + /// + /// txtPlanCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPlanCode; - /// - /// drpTrainType 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList drpTrainType; + /// + /// txtPlanName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPlanName; - /// - /// drpTrainLevel 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList drpTrainLevel; + /// + /// drpTrainType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpTrainType; - /// - /// txtTrainContent 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtTrainContent; + /// + /// drpTrainLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpTrainLevel; - /// - /// dpTrainStartDate 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DatePicker dpTrainStartDate; + /// + /// txtTrainContent 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTrainContent; - /// - /// dpTrainEndDate 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DatePicker dpTrainEndDate; + /// + /// dpTrainStartDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker dpTrainStartDate; - /// - /// txtTeachHour 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.NumberBox txtTeachHour; + /// + /// dpTrainEndDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker dpTrainEndDate; - /// - /// drpCycle 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList drpCycle; + /// + /// txtTeachHour 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtTeachHour; - /// - /// txtTeachMan 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtTeachMan; + /// + /// drpCycle 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCycle; - /// - /// txtTeachAddress 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtTeachAddress; + /// + /// txtTeachMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTeachMan; - /// - /// dpUnit 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList dpUnit; + /// + /// txtTeachAddress 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTeachAddress; - /// - /// dpWorkPost 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList dpWorkPost; + /// + /// dpUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList dpUnit; - /// - /// dpSysUser 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList dpSysUser; + /// + /// dpWorkPost 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList dpWorkPost; - /// - /// dpCompanyTraining 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList dpCompanyTraining; + /// + /// dpSysUser 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList dpSysUser; - /// - /// Toolbar1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Toolbar Toolbar1; + /// + /// dpCompanyTraining 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList dpCompanyTraining; - /// - /// lbTemp 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Label lbTemp; + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; - /// - /// ToolbarFill1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.ToolbarFill ToolbarFill1; + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; - /// - /// btnSave 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnSave; + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; - /// - /// btnSubmit 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnSubmit; + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; - /// - /// btnClose 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnClose; + /// + /// btnSubmit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSubmit; - /// - /// WindowAtt 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Window WindowAtt; - } + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + } } diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/Task.aspx.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/Task.aspx.cs index 4abddc63..211c93c5 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/Task.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/Task.aspx.cs @@ -39,11 +39,11 @@ namespace FineUIPro.Web.HSSE.EduTrain ///
private void BindGrid() { - string strSql = @"SELECT Task.TaskId,Task.PlanId,Task.UserId,Task.TaskDate,(CASE Task.States WHEN '0' THEN '未响应' WHEN '1' THEN '已响应' WHEN '2' THEN '已完成' ELSE '' END) AS States,Plans.PlanName,Person.PersonName" - + @" FROM dbo.Training_Task AS Task " - + @" LEFT JOIN dbo.Training_Plan AS Plans ON Plans.PlanId=Task.PlanId" - + @" LEFT JOIN dbo.SitePerson_Person AS Person ON Person.PersonId = Task.UserId " - + @" WHERE Task.ProjectId='" + this.CurrUser.LoginProjectId + "'"; + string strSql = @"SELECT Task.TaskId,Task.PlanId,Task.UserId,Task.TaskDate,(CASE Task.States WHEN '0' THEN '未响应' WHEN '1' THEN '已响应' WHEN '2' THEN '已完成' ELSE '' END) AS States,Plans.PlanName,Person.PersonName + FROM dbo.Training_Task AS Task + LEFT JOIN dbo.Training_Plan AS Plans ON Plans.PlanId=Task.PlanId + LEFT JOIN dbo.SitePerson_Person AS Person ON Person.PersonId = Task.UserId + WHERE Task.ProjectId='" + this.CurrUser.LoginProjectId + "'"; List listStr = new List(); if (!string.IsNullOrEmpty(this.txtName.Text.Trim())) { diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx b/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx index 71e87765..1eb8a7d2 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx @@ -23,10 +23,10 @@ - - --%> + <%-- + --%> + + + + + + + + + + + + + + <%-- + --%> diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx.cs index 1e1069fc..2394d701 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx.cs @@ -96,39 +96,16 @@ namespace FineUIPro.Web.HSSE.EduTrain /// private void BindGrid() { - var task = BLL.TrainingTaskService.GetTaskById(this.TaskId); - if (task != null) - { - string strSql = @"SELECT PlanItem.PlanItemId,PlanItem.PlanId,PlanItem.TrainingEduId,Training.TrainingCode,Training.TrainingId,Training.TrainingName - ,TrainingItem.TrainingItemId,TrainingItem.TrainingItemCode,TrainingItem.TrainingItemName - FROM Training_PlanItem AS PlanItem - LEFT JOIN Training_TrainingItem AS TrainingItem ON PlanItem.TrainingEduItemId =TrainingItem.TrainingItemId - LEFT JOIN Training_Training AS Training ON TrainingItem.TrainingId =Training.TrainingId - WHERE PlanItem.TrainingEduItemId is not null and PlanItem.PlanId=@PlanId - union all - SELECT PlanItem.PlanItemId,PlanItem.PlanId,PlanItem.TrainingEduId,Training.CompanyTrainingCode,Training.CompanyTrainingId,Training.CompanyTrainingName - ,TrainingItem.CompanyTrainingItemId,TrainingItem.CompanyTrainingItemCode,TrainingItem.CompanyTrainingItemName - FROM Training_PlanItem AS PlanItem - LEFT JOIN Training_CompanyTrainingItem AS TrainingItem ON PlanItem.CompanyTrainingId =TrainingItem.CompanyTrainingId - LEFT JOIN Training_CompanyTraining AS Training ON TrainingItem.CompanyTrainingId =Training.CompanyTrainingId - WHERE PlanItem.CompanyTrainingId is not null and PlanItem.PlanId=@PlanId"; + + string strSql = @"select TrainingItemId,d.TrainingCode,c.TrainingId,d.TrainingName, b.[TrainingItemCode],b.[TrainingItemName],b.LearnTime,b.VideoProgress,b.[AttachUrl], c.TrainingItemCode,c.TrainingItemName from + [dbo].[Training_Task] a + left join [dbo].[Training_TaskItem] b on a.[TaskId]=b.[TaskId] + left join Training_TrainingItem c on b.TrainingItemCode=c.TrainingItemCode + LEFT JOIN Training_Training AS d ON c.TrainingId =d.TrainingId + where b.[TaskId] = @TaskId "; List listStr = new List(); - listStr.Add(new SqlParameter("@PlanId", task.PlanId)); - //var user = BLL.UserService.GetUserByUserId(task.UserId); - //if (user != null && !string.IsNullOrEmpty(user.InstallationId)) - //{ - // List installs = Funs.GetStrListByStr(user.InstallationId, ','); - // if (installs.Count > 0) - // { - // int i = 0; - // foreach (var item in installs) - // { - // strSql += " AND (TrainingEduItem.InstallationIds LIKE @InstallationId" + i.ToString() + " OR TrainingEduItem.InstallationIds IS NULL)"; - // listStr.Add(new SqlParameter("@InstallationId" + i.ToString(), item)); - // i++; - // } - // } - //} + listStr.Add(new SqlParameter("@TaskId", this.TaskId)); + SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); @@ -136,7 +113,7 @@ namespace FineUIPro.Web.HSSE.EduTrain var table = this.GetPagedDataTable(Grid1, tb); Grid1.DataSource = table; Grid1.DataBind(); - } + } #endregion @@ -174,5 +151,30 @@ namespace FineUIPro.Web.HSSE.EduTrain PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TaskRecordView.aspx?TrainingEduItemId={0}", Grid1.SelectedRowID, "编辑 - "))); } #endregion + + #region 格式化字符串 + /// + /// 获取单位名称 + /// + /// + /// + protected string ConvertTime(object time) + { + string hours = "0"; + if (time != null) + { + if (!string.IsNullOrEmpty(time.ToString())) + { + return (Convert.ToInt32(time) / 60).ToString(); + } + else + { + return hours; + } + + } + return hours; + } + #endregion } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx.designer.cs index a2fa80e6..09b138ad 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TaskView.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.EduTrain { - - - public partial class TaskView { - +namespace FineUIPro.Web.HSSE.EduTrain +{ + + + public partial class TaskView + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// SimpleForm1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form SimpleForm1; - + /// /// Grid1 控件。 /// @@ -47,7 +49,25 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + + /// + /// lblLearnTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblLearnTime; + + /// + /// lblVideoProgress 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblVideoProgress; + /// /// ToolbarSeparator1 控件。 /// @@ -56,7 +76,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -65,7 +85,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -74,7 +94,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// Window1 控件。 /// @@ -83,7 +103,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; - + /// /// Menu1 控件。 /// @@ -92,7 +112,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuView 控件。 /// diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx b/SGGL/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx index ae3bd836..dff60583 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx @@ -29,13 +29,13 @@ - + @@ -55,7 +55,7 @@ - + diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx.cs index e7a84a85..e7160e03 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.IO; +using System.Linq; using System.Text; namespace FineUIPro.Web.HSSE.EduTrain { @@ -24,7 +25,24 @@ namespace FineUIPro.Web.HSSE.EduTrain ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); GetButtonPower(); + var sysTestRule = Funs.DB.Sys_TestRule.FirstOrDefault(); + if (sysTestRule != null) + { + if (sysTestRule.PassingScore > 0) + { + this.lbPassScore.Text = "红色表示分数低于" + sysTestRule.PassingScore.ToString() + "分。"; + } + else + { + this.lbPassScore.Text = "红色表示分数低于80分。"; + } + } + else + { + this.lbPassScore.Text = "红色表示分数低于80分。"; + + } ///更新没有结束时间且超时的考试记录 GetDataService.UpdateTestPlanStates(); @@ -56,11 +74,11 @@ namespace FineUIPro.Web.HSSE.EduTrain + @" LEFT JOIN dbo.Training_TestTraining AS Training ON Training.TrainingId = TestRecord.TestType" + @" LEFT JOIN dbo.SitePerson_Person AS Person ON Person.PersonId = TestRecord.TestManId " + @" LEFT JOIN dbo.Base_Unit AS Unit ON Person.UnitId=Unit.UnitId" - + @" WHERE (isFiled IS NULL OR isFiled = 0) and TestRecord.ProjectId = '" + this.CurrUser.LoginProjectId+"'"; + + @" WHERE TestRecord.TestStartTime is not null and (isFiled IS NULL OR isFiled = 0) and TestRecord.ProjectId = '" + this.CurrUser.LoginProjectId+"'"; List listStr = new List(); if (!string.IsNullOrEmpty(this.txtName.Text.Trim())) { - strSql += " AND (Person.PersonName LIKE @name OR TestPlan.PlanName LIKE @name OR Training.TrainingName LIKE @name)"; + strSql += " AND (Person.PersonName LIKE @name OR TestPlan.PlanName LIKE @name OR Training.TrainingName LIKE @name OR Unit.UnitName like @name)"; listStr.Add(new SqlParameter("@name", "%" + this.txtName.Text.Trim() + "%")); } if (!string.IsNullOrEmpty(this.txtMinScores.Text.Trim())) diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx.designer.cs index 5c89180e..4dfae806 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.EduTrain { - - - public partial class TestRecord { - +namespace FineUIPro.Web.HSSE.EduTrain +{ + + + public partial class TestRecord + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar1 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// txtName 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtName; - + /// /// txtMinScores 控件。 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.NumberBox txtMinScores; - + /// /// txtMaxScores 控件。 /// @@ -83,7 +85,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.NumberBox txtMaxScores; - + /// /// IsTemp 控件。 /// @@ -92,7 +94,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.CheckBox IsTemp; - + /// /// txtStartDate 控件。 /// @@ -101,7 +103,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtStartDate; - + /// /// txtEndDate 控件。 /// @@ -110,7 +112,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtEndDate; - + /// /// ckIsNULL 控件。 /// @@ -119,7 +121,16 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.CheckBox ckIsNULL; - + + /// + /// lbPassScore 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbPassScore; + /// /// ToolbarFill1 控件。 /// @@ -128,7 +139,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// btnOut 控件。 /// @@ -137,7 +148,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnOut; - + /// /// labNumber 控件。 /// @@ -146,7 +157,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label labNumber; - + /// /// ToolbarSeparator1 控件。 /// @@ -155,7 +166,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -164,7 +175,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -173,7 +184,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// Window1 控件。 /// @@ -182,7 +193,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; - + /// /// Menu1 控件。 /// @@ -191,7 +202,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuView 控件。 /// @@ -200,7 +211,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuView; - + /// /// btnPrinter 控件。 /// @@ -209,7 +220,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnPrinter; - + /// /// btnMenuDelete 控件。 /// diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TestStatistics.aspx b/SGGL/FineUIPro.Web/HSSE/EduTrain/TestStatistics.aspx index 86df27ad..3c44d643 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TestStatistics.aspx +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TestStatistics.aspx @@ -23,7 +23,10 @@ + + + @@ -50,8 +53,8 @@ - + diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TestStatistics.aspx.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TestStatistics.aspx.cs index 8dde887a..160545a2 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TestStatistics.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TestStatistics.aspx.cs @@ -1,8 +1,10 @@ using BLL; +using Model; using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; +using System.Linq; namespace FineUIPro.Web.HSSE.EduTrain { @@ -20,6 +22,13 @@ namespace FineUIPro.Web.HSSE.EduTrain { Funs.DropDownPageSize(this.ddlPageSize); this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + var sysTestRule = Funs.DB.Sys_TestRule.FirstOrDefault(); + var passingScore = "60"; + if (sysTestRule != null) + { + passingScore = sysTestRule.PassingScore.ToString(); + } + TestQualifyCount.HeaderText = passingScore + "分以上"; // 绑定表格 this.BindGrid(); } @@ -37,6 +46,12 @@ namespace FineUIPro.Web.HSSE.EduTrain /// private void BindGrid() { + var sysTestRule = Funs.DB.Sys_TestRule.FirstOrDefault(); + var passingScore = "60"; + if (sysTestRule != null) + { + passingScore = sysTestRule.PassingScore.ToString(); + } string strSql = @"SELECT PersonId,CardNo,PersonName,person.UnitId,Unit.UnitCode,Unit.UnitName,person.DepartId,Depart.DepartCode,Depart.DepartName" + @",WorkPostName,ISNULL(TestCount,0) AS TestCount,ISNULL(TestQualifyCount,0) AS TestQualifyCount " + @" FROM SitePerson_Person AS person " @@ -45,7 +60,7 @@ namespace FineUIPro.Web.HSSE.EduTrain + @" LEFT JOIN Base_Depart AS Depart ON person.DepartId=Depart.DepartId" + @" LEFT JOIN (SELECT COUNT(TestRecordId) AS TestCount,TestManId FROM Training_TestRecord GROUP BY TestManId) AS TestCount" + @" ON person.PersonId=TestCount.TestManId" - + @" LEFT JOIN (SELECT COUNT(TestRecordId) AS TestQualifyCount,TestManId FROM Training_TestRecord WHERE TestScores>= 60 GROUP BY TestManId) AS TestQualifyCount" + + @" LEFT JOIN (SELECT COUNT(TestRecordId) AS TestQualifyCount,TestManId FROM Training_TestRecord WHERE TestScores>= "+ passingScore + " GROUP BY TestManId) AS TestQualifyCount" + @" ON person.PersonId=TestQualifyCount.TestManId" + @" WHERE PersonId <> '" + BLL.Const.sysglyId + "' and person.projectid='" + this.CurrUser.LoginProjectId + "'"; List listStr = new List(); @@ -54,7 +69,11 @@ namespace FineUIPro.Web.HSSE.EduTrain strSql += " AND (PersonName LIKE @name OR CardNo LIKE @name OR Unit.UnitName LIKE @name OR Depart.DepartName LIKE @name OR WorkPostName LIKE @name)"; listStr.Add(new SqlParameter("@name", "%" + this.txtName.Text.Trim() + "%")); } + if (cbNoPass.Checked) + { + strSql += " AND TestScores < "+ passingScore; + } SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); Grid1.RecordCount = tb.Rows.Count; diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TestStatistics.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TestStatistics.aspx.designer.cs index 14830fea..90a580a7 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TestStatistics.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TestStatistics.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.EduTrain { - - - public partial class TestStatistics { - +namespace FineUIPro.Web.HSSE.EduTrain +{ + + + public partial class TestStatistics + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar1 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// txtName 控件。 /// @@ -65,7 +67,16 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtName; - + + /// + /// cbNoPass 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBox cbNoPass; + /// /// ToolbarFill1 控件。 /// @@ -74,7 +85,16 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + + /// + /// TestQualifyCount 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RenderField TestQualifyCount; + /// /// ToolbarSeparator1 控件。 /// @@ -83,7 +103,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -92,7 +112,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainFindWorkPost.aspx b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainFindWorkPost.aspx new file mode 100644 index 00000000..675051ec --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainFindWorkPost.aspx @@ -0,0 +1,175 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrainFindWorkPost.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.TrainFindWorkPost" %> + +<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %> + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainFindWorkPost.aspx.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainFindWorkPost.aspx.cs new file mode 100644 index 00000000..263d2921 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainFindWorkPost.aspx.cs @@ -0,0 +1,449 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.HSSE.EduTrain +{ + public partial class TrainFindWorkPost : PageBase + { + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + public string UnitId + { + get + { + return (string)ViewState["UnitId"]; + } + set + { + ViewState["UnitId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + this.ucTree.UnitId = this.CurrUser.UnitId; + this.ucTree.ProjectId = this.ProjectId; + + //单位 + BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true); + if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId)) + { + this.drpUnitId.SelectedValue = this.CurrUser.UnitId; + this.drpUnitId.Enabled = false; + } + //培训类型 + BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true); + //培训级别; + //BLL.TrainLevelService.InitTrainLevelDropDownList(this.drpTrainLevel, true); + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + BindGrid(); + InitTreeMenu(); + if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + this.panelLeftRegion.Hidden = true; + // this.Grid1.Columns[0].Hidden = true; + } + } + } + + protected void changeTree(object sender, EventArgs e) + { + this.ProjectId = this.ucTree.ProjectId; + //新增UnitId + this.UnitId = this.ucTree.UnitId; + //判断 当有projectId的时候单位id为空 + if (!string.IsNullOrEmpty(this.ProjectId)) + { + this.UnitId = ""; + } + this.BindGrid(); + } + + /// + /// 加载数据 + /// + private void BindGrid() + { + if (!string.IsNullOrEmpty(this.ProjectId) || !string.IsNullOrEmpty(this.UnitId)) //项目数据 + { + string strSql = @"SELECT NEWID() AS ID, CardNo,PersonName,ProjectId,UnitId,UnitName,WorkPostName,TrainTitle ,TrainStartDate,TrainEndDate,TrainTypeId,TeachHour,TrainTypeName,CheckScore,CheckResult,TeachMan,UnitType,TrainLevelName" + + @",(round(isnull(Durations,0)/60,2)) as Durations,PlanId,PersonId,TaskId" + + @" FROM dbo.View_EduTrain_TrainFind" + + @" WHERE 1=1"; + List listStr = new List(); + if (!string.IsNullOrEmpty(ProjectId)) + { + strSql += " AND ProjectId = @ProjectId"; + listStr.Add(new SqlParameter("@ProjectId", ProjectId)); + } + + if (!string.IsNullOrEmpty(UnitId)) + { + strSql += " AND UnitId = @UnitId"; + listStr.Add(new SqlParameter("@UnitId", UnitId)); + } + if (trWorkPost.SelectedNode!=null) + { + strSql += " AND WorkPostName = @WorkPostName"; + listStr.Add(new SqlParameter("@WorkPostName", trWorkPost.SelectedNode.Text)); + } + var ssss = trWorkPost.SelectedNode; + + + if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim())) + { + strSql += " AND PersonName LIKE @PersonName"; + listStr.Add(new SqlParameter("@PersonName", "%" + this.txtPersonName.Text.Trim() + "%")); + } + if (this.drpUnitId.SelectedValue != BLL.Const._Null) + { + strSql += " AND UnitId = @UnitIds"; + listStr.Add(new SqlParameter("@UnitIds", this.drpUnitId.SelectedValue.Trim())); + } + if (this.drpTrainType.SelectedValue != BLL.Const._Null) + { + strSql += " AND TrainTypeId = @TrainTypeId"; + listStr.Add(new SqlParameter("@TrainTypeId", this.drpTrainType.SelectedValue.Trim())); + } + //if (this.drpTrainLevel.SelectedValue != BLL.Const._Null) + //{ + // strSql += " AND TrainLevelId = @TrainLevel"; + // listStr.Add(new SqlParameter("@TrainLevel", this.drpTrainLevel.SelectedValue)); + //} + + if (!string.IsNullOrEmpty(this.txtTeachMan.Text.Trim())) + { + strSql += " AND TeachMan LIKE @TeachMan"; + listStr.Add(new SqlParameter("@TeachMan", "%" + this.txtTeachMan.Text.Trim() + "%")); + } + + if (this.cbIssue.SelectedValueArray.Length == 1) + { + ///是否通过 + string selectValue = String.Join(", ", this.cbIssue.SelectedValueArray); + if (selectValue == "1") + { + strSql += " AND CheckResult = 1 "; + } + else + { + strSql += " AND (CheckResult = 0 OR CheckResult IS NULL) "; + } + } + + if (!string.IsNullOrEmpty(this.txtDurations.Text.Trim())) + { + strSql += " AND round(isnull(Durations,0)/60,2) = @Durations"; + listStr.Add(new SqlParameter("@Durations", this.txtDurations.Text.Trim())); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + + Grid1.DataSource = table; + Grid1.DataBind(); + } + } + #endregion + + + #region 加载树 + + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.trWorkPost.Nodes.Clear(); + TreeNode rootNode = new TreeNode + { + Text = "培训岗位", + NodeID = "0", + Expanded = true + }; + this.trWorkPost.Nodes.Add(rootNode); + BoundTree(rootNode.Nodes); + } + + /// + /// 加载树 + /// + /// + /// + private void BoundTree(TreeNodeCollection nodes) + { + var postLists = BLL.WorkPostService.GetWorkPostList(); + if (postLists.Count() > 0) + { + + TreeNode tn = null; + foreach (var dr in postLists) + { + tn = new TreeNode(); + tn.Text = dr.WorkPostName; + tn.NodeID = dr.WorkPostId; + tn.EnableClickEvent = true; + tn.ToolTip = dr.WorkPostName; + nodes.Add(tn); + } + } + } + + #endregion + + #region Tree点击事件 + + /// + /// Tree点击事件 + /// + /// + /// + protected void trWorkPost_NodeCommand(object sender, TreeCommandEventArgs e) + { + BindGrid(); + } + + #endregion + + #region 页索引改变事件 + /// + /// 页索引改变事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + BindGrid(); + } + #endregion + + #region 分页选择下拉改变事件 + /// + /// 分页选择下拉改变事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void Text_OnTextChanged(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + + #region 转换字符串 + /// + /// 考核结果 + /// + /// + /// + protected string ConvertCheckResult(object checkResult) + { + if (checkResult != null) + { + if (checkResult.ToString() == "True") + { + return "合格"; + } + else + { + return "不合格"; + } + } + return ""; + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + 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 = 500; + BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + +#pragma warning disable CS0108 // “TrainFind.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。 + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) +#pragma warning restore CS0108 // “TrainFind.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。 + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + sb.AppendFormat("", column.HeaderText); + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("labNumber") as AspNet.Label).Text; + } + if (column.ColumnID == "tfUnitName") + { + html = (row.FindControl("lbUnitName") as AspNet.Label).Text; + } + if (column.ColumnID == "tfWorkPostName") + { + html = (row.FindControl("lbWorkPostName") as AspNet.Label).Text; + } + if (column.ColumnID == "tfTrainTypeName") + { + html = (row.FindControl("lbTrainTypeName") as AspNet.Label).Text; + } + if (column.ColumnID == "tfTrainLevelName") + { + html = (row.FindControl("lbTrainLevelName") as AspNet.Label).Text; + } + if (column.ColumnID == "tfTrainTitle") + { + html = (row.FindControl("lbTrainTitle") as AspNet.Label).Text; + } + if (column.ColumnID == "tfCheckResult") + { + html = (row.FindControl("lbCheckResult") as AspNet.Label).Text; + } + if (column.ColumnID == "tfI") + { + html = "'" + (row.FindControl("lbI") as AspNet.Label).Text; + } + sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}
"); + + return sb.ToString(); + } + #endregion + + #region 获取任务id + protected string getTaskId(object ProjectId, object PersonId, object PlanId) + { + var TaskId = ""; + if (ProjectId != null && PersonId != null && PlanId != null) + { + var model = Funs.DB.Training_Task.FirstOrDefault(x => x.PlanId == PlanId.ToString() && + x.UserId == PersonId.ToString() && x.ProjectId == ProjectId.ToString()); + if (model != null) + { + TaskId = model.TaskId; + } + } + return TaskId; + } + #endregion + + #region 获取总时长 + protected string getSumDurations(object planId) + { + double? sumDurations = 0.0; + if (planId != null) + { + var planItemList = Funs.DB.Training_PlanItem.Where(x => x.PlanId == planId.ToString()).ToList(); + if (planItemList.Count > 0) + { + foreach (var item in planItemList) + { + var CompanyTrainingItemModel = Funs.DB.Training_CompanyTrainingItem.FirstOrDefault(x => x.CompanyTrainingItemId == item.CompanyTrainingItemId); + if (CompanyTrainingItemModel.Durations != null) + { + sumDurations += CompanyTrainingItemModel.Durations; + } + + } + } + } + return sumDurations.ToString(); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainFindWorkPost.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainFindWorkPost.aspx.designer.cs new file mode 100644 index 00000000..5dcf28c8 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainFindWorkPost.aspx.designer.cs @@ -0,0 +1,296 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.EduTrain +{ + + + public partial class TrainFindWorkPost + { + + /// + /// Head1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlHead Head1; + + /// + /// 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; + + /// + /// ContentPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel1; + + /// + /// ucTree 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree; + + /// + /// panel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panel2; + + /// + /// trWorkPost 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree trWorkPost; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// cbIssue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBoxList cbIssue; + + /// + /// txtPersonName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPersonName; + + /// + /// drpUnitId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnitId; + + /// + /// txtTeachMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTeachMan; + + /// + /// drpTrainType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpTrainType; + + /// + /// txtDurations 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtDurations; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// labNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label labNumber; + + /// + /// lbUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbUnitName; + + /// + /// lbWorkPostName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbWorkPostName; + + /// + /// lbTrainTitle 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbTrainTitle; + + /// + /// lbTrainTypeName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbTrainTypeName; + + /// + /// lbCheckResult 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lbCheckResult; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx index 7cc47680..14c32d15 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx @@ -1,5 +1,6 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrainRecord.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.TrainRecord" %> +<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %> @@ -9,113 +10,124 @@
- + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> - - - - - - - - - - - - - - - <%-- + + + + + + + + + + + + + + <%-- --%> - - - <%-- + + <%-- --%> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - /// 培训记录主键 @@ -27,6 +29,29 @@ namespace FineUIPro.Web.HSSE.EduTrain ViewState["TrainingId"] = value; } } + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + public string UnitId + { + get + { + return (string)ViewState["UnitId"]; + } + set + { + ViewState["UnitId"] = value; + } + } #endregion #region 加载页面 @@ -39,6 +64,15 @@ namespace FineUIPro.Web.HSSE.EduTrain { if (!IsPostBack) { + Funs.DropDownPageSize(this.ddlPageSize); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + + this.ucTree.UnitId = this.CurrUser.UnitId; + this.ucTree.ProjectId = this.ProjectId; Funs.DropDownPageSize(this.ddlPageSize); ////权限按钮方法 this.GetButtonPower(); @@ -48,6 +82,11 @@ namespace FineUIPro.Web.HSSE.EduTrain BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true); //培训类型 BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true); + trainType = Request.Params["trainType"]; + if (!string.IsNullOrEmpty(trainType)) + { + this.drpTrainType.Items.FindByText(trainType).Selected = true; + } //培训级别; BLL.TrainLevelService.InitTrainLevelDropDownList(this.drpTrainLevel, true); @@ -58,21 +97,44 @@ namespace FineUIPro.Web.HSSE.EduTrain { this.btnRefresh.Hidden = false; } + if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + this.panelLeftRegion.Hidden = true; + // this.Grid1.Columns[0].Hidden = true; + ////权限按钮方法 + this.GetButtonPower(); + } + } + } + protected void changeTree(object sender, EventArgs e) + { + this.ProjectId = this.ucTree.ProjectId; + //新增UnitId + this.UnitId = this.ucTree.UnitId; + //判断 当有projectId的时候单位id为空 + if (!string.IsNullOrEmpty(this.ProjectId)) + { + this.UnitId = ""; + } + this.BindGrid(); + this.GetButtonPower(); + if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + btnNew.Hidden = true; } } - /// /// 绑定数据 /// private void BindGrid() { - string projectId = this.CurrUser.LoginProjectId; - if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值 + if (string.IsNullOrEmpty(this.ProjectId)) { - projectId = Request.Params["projectId"]; + return; } - if (!string.IsNullOrEmpty(projectId)) + if (!string.IsNullOrEmpty(this.ProjectId) || !string.IsNullOrEmpty(this.UnitId)) //项目数据 { + string strSql = "select TrainRecord.TrainingId" + @",TrainRecord.TrainTitle" + @",TrainType.TrainTypeName,TrainLevel.TrainLevelName" @@ -92,8 +154,25 @@ namespace FineUIPro.Web.HSSE.EduTrain + @" LEFT JOIN Base_TrainLevel AS TrainLevel ON TrainRecord.TrainLevelId=TrainLevel.TrainLevelId " + @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON TrainRecord.TrainingId=CodeRecords.DataId WHERE 1=1 "; List listStr = new List(); - strSql += " AND TrainRecord.ProjectId = @ProjectId"; - listStr.Add(new SqlParameter("@ProjectId", projectId)); + if (!string.IsNullOrEmpty(txtName.Text)) + { + strSql += " AND TrainRecord.TrainTitle LIKE @TrainTitle"; + listStr.Add(new SqlParameter("@TrainTitle", "%" + this.txtName.Text + "%")); + } + + + if (!string.IsNullOrEmpty(this.ProjectId)) + { + strSql += " AND TrainRecord.ProjectId = @ProjectId"; + listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); + } + + if (!string.IsNullOrEmpty(UnitId)) + { + strSql += " AND TrainRecord.UnitId = @UnitId"; + listStr.Add(new SqlParameter("@UnitId", UnitId)); + } + if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值 { strSql += " AND TrainRecord.States = @States"; ///状态为已完成 @@ -119,16 +198,18 @@ namespace FineUIPro.Web.HSSE.EduTrain strSql += " AND TrainRecord.TrainStartDate <= @EndDate "; listStr.Add(new SqlParameter("@EndDate", this.txtEndDate.Text.Trim())); } - if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId)) + if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId)) { strSql += " AND TrainRecord.UnitIds LIKE @UnitId1"; listStr.Add(new SqlParameter("@UnitId1", "%" + this.CurrUser.UnitId + "%")); } if (this.drpUnitId.SelectedValue != BLL.Const._Null) { - strSql += " AND TrainRecord.UnitIds LIKE @UnitId"; - listStr.Add(new SqlParameter("@UnitId", "%" + this.drpUnitId.SelectedValue.Trim() + "%")); + strSql += " AND TrainRecord.UnitIds LIKE @UnitIds"; + listStr.Add(new SqlParameter("@UnitIds", "%" + this.drpUnitId.SelectedValue.Trim() + "%")); } + + SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); Grid1.RecordCount = tb.Rows.Count; @@ -144,12 +225,101 @@ namespace FineUIPro.Web.HSSE.EduTrain } JObject summary = new JObject - { - { "TeachMan", "合计:" }, - { "TrainPersonNum", totalPersonNum } - }; + { + { "TeachMan", "合计:" }, + { "TrainPersonNum", totalPersonNum } + }; Grid1.SummaryData = summary; + + + } + #region 2023-6-27 15:03:28修改废弃代码 + //else //公司级数据 + //{ + + // string strSql = "select TrainRecord.TrainingId" + // + @",TrainRecord.TrainTitle" + // + @",TrainType.TrainTypeName,TrainLevel.TrainLevelName" + // + @",TrainRecord.TrainStartDate" + // + @",TrainRecord.TrainEndDate" + // + @",TrainRecord.TeachHour" + // + @",TrainRecord.TeachMan" + // + @",TrainRecord.TrainPersonNum" + // + @",TrainingCode" + // // + @",CodeRecords.Code AS TrainingCode" + // + @",(CASE WHEN TrainRecord.States = " + BLL.Const.State_0 + " OR TrainRecord.States IS NULL THEN '待['+OperateUser.UserName+']提交' WHEN TrainRecord.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperateUser.UserName+']办理' END) AS FlowOperateName" + // + @",TrainRecord.UnitIds" + // + @" from EduTrain_TrainRecord AS TrainRecord " + // + @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON TrainRecord.TrainingId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1" + // + @" LEFT JOIN Sys_User AS OperateUser ON FlowOperate.OperaterId=OperateUser.UserId " + // + @" LEFT JOIN Base_TrainType AS TrainType ON TrainRecord.TrainTypeId=TrainType.TrainTypeId " + // + @" LEFT JOIN Base_TrainLevel AS TrainLevel ON TrainRecord.TrainLevelId=TrainLevel.TrainLevelId " + // + @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON TrainRecord.TrainingId=CodeRecords.DataId WHERE 1=1 "; + // List listStr = new List(); + + // if (!string.IsNullOrEmpty(ProjectId)) + // { + // strSql += " AND (TrainRecord.ProjectId = '' or TrainRecord.ProjectId is null) "; + // //listStr.Add(new SqlParameter("@ProjectId", ProjectId)); + // } + + + // if (this.drpTrainType.SelectedValue != BLL.Const._Null) + // { + // strSql += " AND TrainRecord.TrainTypeId = @TrainType"; + // listStr.Add(new SqlParameter("@TrainType", this.drpTrainType.SelectedValue)); + // } + // if (this.drpTrainLevel.SelectedValue != BLL.Const._Null) + // { + // strSql += " AND TrainRecord.TrainLevelId = @TrainLevel"; + // listStr.Add(new SqlParameter("@TrainLevel", this.drpTrainLevel.SelectedValue)); + // } + // if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim())) + // { + // strSql += " AND TrainRecord.TrainStartDate >= @StartDate "; + // listStr.Add(new SqlParameter("@StartDate", this.txtStartDate.Text.Trim())); + // } + // if (!string.IsNullOrEmpty(this.txtEndDate.Text.Trim())) + // { + // strSql += " AND TrainRecord.TrainStartDate <= @EndDate "; + // listStr.Add(new SqlParameter("@EndDate", this.txtEndDate.Text.Trim())); + // } + // if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId)) + // { + // strSql += " AND TrainRecord.UnitIds LIKE @UnitId1"; + // listStr.Add(new SqlParameter("@UnitId1", "%" + this.CurrUser.UnitId + "%")); + // } + // strSql += " AND TrainRecord.UnitIds LIKE @UnitId"; + // listStr.Add(new SqlParameter("@UnitId", "%" + this.ucTree.UnitId.Trim() + "%")); + + // SqlParameter[] parameter = listStr.ToArray(); + // DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + // Grid1.RecordCount = tb.Rows.Count; + // //tb = GetFilteredTable(Grid1.FilteredData, tb); + // var table = this.GetPagedDataTable(Grid1, tb); + + // Grid1.DataSource = table; + // Grid1.DataBind(); + // int totalPersonNum = 0; + // for (int i = 0; i < tb.Rows.Count; i++) + // { + // totalPersonNum += Funs.GetNewIntOrZero(tb.Rows[i][8].ToString()); + // } + + // JObject summary = new JObject + // { + // { "TeachMan", "合计:" }, + // { "TrainPersonNum", totalPersonNum } + // }; + + // Grid1.SummaryData = summary; + //} + #endregion + string projectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值 + { + projectId = Request.Params["projectId"]; } } #endregion @@ -186,7 +356,6 @@ namespace FineUIPro.Web.HSSE.EduTrain /// protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) { - this.Grid1.PageSize = Funs.GetNewIntOrZero(this.ddlPageSize.SelectedValue); BindGrid(); } #endregion @@ -199,7 +368,7 @@ namespace FineUIPro.Web.HSSE.EduTrain /// protected void btnNew_Click(object sender, EventArgs e) { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TrainRecordEdit.aspx", "编辑 - "))); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TrainRecordEdit.aspx?trainType={0}", trainType, "编辑 - "))); } #endregion @@ -238,7 +407,7 @@ namespace FineUIPro.Web.HSSE.EduTrain var trainRecord = EduTrain_TrainRecordService.GetTrainingByTrainingId(TrainingId); if (trainRecord != null) { - if (this.btnMenuEdit.Hidden || trainRecord.States == BLL.Const.State_2) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面 + if (this.btnMenuEdit.Hidden) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面 { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TrainRecordView.aspx?TrainingId={0}", TrainingId, "查看 - "))); } @@ -288,6 +457,8 @@ namespace FineUIPro.Web.HSSE.EduTrain } } } + // Project_HSSEData_HSSEService.StatisticalData(this.CurrUser.LoginProjectId, Project_HSSEData_HSSEService.HSSEDateType.EducationAndTraining); + } } @@ -335,11 +506,15 @@ namespace FineUIPro.Web.HSSE.EduTrain /// private void GetButtonPower() { + if (string.IsNullOrEmpty(this.ProjectId)) + { + return; + } if (Request.Params["value"] == "0") { return; } - var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectTrainRecordMenuId); + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectTrainRecordMenuId); if (buttonList.Count() > 0) { if (buttonList.Contains(BLL.Const.BtnAdd)) @@ -506,8 +681,12 @@ namespace FineUIPro.Web.HSSE.EduTrain /// protected void btnRefresh_Click(object sender, EventArgs e) { + if (string.IsNullOrEmpty(this.ProjectId)) + { + return; + } var getTrainRecords = from x in Funs.DB.EduTrain_TrainRecord - where x.ProjectId == this.CurrUser.LoginProjectId && x.PlanId != null + where x.ProjectId == this.ProjectId && x.PlanId != null select x; if (getTrainRecords.Count() > 0) { @@ -515,7 +694,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { var getTrainRecordDetail = Funs.DB.EduTrain_TrainRecordDetail.Where(x => x.TrainingId == itemRecord.TrainingId); if (itemRecord.TrainPersonNum > getTrainRecordDetail.Count()) - { + { var getTrainingTasks = from x in Funs.DB.Training_Task where x.PlanId == itemRecord.PlanId select x; @@ -596,13 +775,13 @@ namespace FineUIPro.Web.HSSE.EduTrain } var getTestPlanStates = from x in Funs.DB.Training_TestPlan - join y in Funs.DB.Training_Plan on x.PlanId equals y.PlanId - where x.States == Const.State_3 && y.States == Const.State_2 - select x; + join y in Funs.DB.Training_Plan on x.PlanId equals y.PlanId + where x.States == Const.State_3 && y.States == Const.State_2 + select x; foreach (var item in getTestPlanStates) { ////TODO 讲培训计划 考试记录 写入到培训记录 - BLL. APITrainRecordService.InsertTrainRecord(item); + BLL.APITrainRecordService.InsertTrainRecord(item); } } } diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx.designer.cs index d5473c48..437c2b0e 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.EduTrain { - - - public partial class TrainRecord { - +namespace FineUIPro.Web.HSSE.EduTrain +{ + + + public partial class TrainRecord + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,43 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// ContentPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel1; + + /// + /// ucTree 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + /// /// Grid1 控件。 /// @@ -47,7 +85,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar2 控件。 /// @@ -56,7 +94,16 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + + /// + /// txtName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtName; + /// /// drpUnitId 控件。 /// @@ -65,7 +112,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpUnitId; - + /// /// drpTrainType 控件。 /// @@ -74,7 +121,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpTrainType; - + /// /// drpTrainLevel 控件。 /// @@ -83,7 +130,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpTrainLevel; - + /// /// txtStartDate 控件。 /// @@ -92,7 +139,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtStartDate; - + /// /// lblTo 控件。 /// @@ -101,7 +148,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lblTo; - + /// /// txtEndDate 控件。 /// @@ -110,7 +157,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtEndDate; - + /// /// ToolbarFill1 控件。 /// @@ -119,7 +166,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// btnNew 控件。 /// @@ -128,7 +175,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnNew; - + /// /// btnOut 控件。 /// @@ -137,7 +184,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnOut; - + /// /// btnRefresh 控件。 /// @@ -146,7 +193,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnRefresh; - + /// /// lblNumber 控件。 /// @@ -155,7 +202,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lblNumber; - + /// /// lblTrainingCode 控件。 /// @@ -164,7 +211,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lblTrainingCode; - + /// /// lblUnitId 控件。 /// @@ -173,7 +220,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lblUnitId; - + /// /// ToolbarSeparator1 控件。 /// @@ -182,7 +229,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -191,7 +238,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -200,7 +247,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// Window1 控件。 /// @@ -209,7 +256,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; - + /// /// Window2 控件。 /// @@ -218,7 +265,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window2; - + /// /// Menu1 控件。 /// @@ -227,7 +274,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuView 控件。 /// @@ -236,7 +283,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuView; - + /// /// btnMenuEdit 控件。 /// @@ -245,7 +292,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuEdit; - + /// /// btnPrint 控件。 /// @@ -254,7 +301,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnPrint; - + /// /// btnMenuDelete 控件。 /// diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecordEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecordEdit.aspx.cs index 3fe17ecc..9dcbce94 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecordEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainRecordEdit.aspx.cs @@ -189,6 +189,11 @@ namespace FineUIPro.Web.HSSE.EduTrain { //培训类型 TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true); + string trainType = Request.Params["trainType"]; + if (!string.IsNullOrWhiteSpace(trainType)) + { + this.drpTrainType.Items.FindByText(trainType).Selected = true; + } //培训级别 TrainLevelService.InitTrainLevelDropDownList(this.drpTrainLevel, true); //培训单位 diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingItemSave.aspx b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingItemSave.aspx index 62cace82..6ce4ed0b 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingItemSave.aspx +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingItemSave.aspx @@ -39,6 +39,11 @@ + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingItemSave.aspx.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingItemSave.aspx.cs index dab35f92..06099377 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingItemSave.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingItemSave.aspx.cs @@ -58,6 +58,10 @@ namespace FineUIPro.Web.HSSE.EduTrain txtTrainingItemName.Text = q.TrainingItemName; txtCompileMan.Text = q.CompileMan; hdCompileMan.Text = q.CompileMan; + if (q.LearningTime.HasValue) + { + txtLearningTime.Text = q.LearningTime.Value.ToString(); + } if (q.CompileDate != null) { txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", q.CompileDate); @@ -95,7 +99,12 @@ namespace FineUIPro.Web.HSSE.EduTrain TrainingItemName = txtTrainingItemName.Text.Trim(), CompileMan = hdCompileMan.Text.Trim(), UnitId = this.CurrUser.UnitId + }; + if (!string.IsNullOrEmpty(this.txtLearningTime.Text)) + { + trainingItem.LearningTime = int.Parse(this.txtLearningTime.Text); + } if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim())) { trainingItem.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim()); diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingItemSave.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingItemSave.aspx.designer.cs index a4598767..ff99091e 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingItemSave.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingItemSave.aspx.designer.cs @@ -7,144 +7,155 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.EduTrain { - - - public partial class TrainingItemSave { - - /// - /// form1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// - /// PageManager1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.PageManager PageManager1; - - /// - /// SimpleForm1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Form SimpleForm1; - - /// - /// txtTrainingItemCode 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtTrainingItemCode; - - /// - /// txtTrainingItemName 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtTrainingItemName; - - /// - /// txtCompileMan 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtCompileMan; - - /// - /// txtCompileDate 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DatePicker txtCompileDate; - - /// - /// Toolbar1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Toolbar Toolbar1; - - /// - /// lbTemp 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Label lbTemp; - - /// - /// btnAttachUrl 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnAttachUrl; - - /// - /// ToolbarFill1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.ToolbarFill ToolbarFill1; - - /// - /// btnSave 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnSave; - - /// - /// btnClose 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnClose; - - /// - /// hdCompileMan 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.HiddenField hdCompileMan; - - /// - /// WindowAtt 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Window WindowAtt; - } +namespace FineUIPro.Web.HSSE.EduTrain +{ + + + public partial class TrainingItemSave + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtTrainingItemCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTrainingItemCode; + + /// + /// txtTrainingItemName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTrainingItemName; + + /// + /// txtCompileMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCompileMan; + + /// + /// txtCompileDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCompileDate; + + /// + /// txtLearningTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtLearningTime; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// lbTemp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbTemp; + + /// + /// btnAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAttachUrl; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// hdCompileMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdCompileMan; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + } } diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingSave.aspx b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingSave.aspx index 50820d14..586a300a 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingSave.aspx +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingSave.aspx @@ -29,7 +29,7 @@ runat="server"> - + diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingSave.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingSave.aspx.designer.cs index fa3dbde0..c49f7f64 100644 --- a/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingSave.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/TrainingSave.aspx.designer.cs @@ -7,90 +7,92 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.EduTrain { - - - public partial class TrainingSave { - - /// - /// form1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// - /// PageManager1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.PageManager PageManager1; - - /// - /// SimpleForm1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Form SimpleForm1; - - /// - /// txtTrainingCode 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtTrainingCode; - - /// - /// txtTrainingName 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtTrainingName; - - /// - /// drpIsEndLever 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList drpIsEndLever; - - /// - /// Toolbar1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Toolbar Toolbar1; - - /// - /// btnSave 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnSave; - - /// - /// btnClose 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnClose; - } +namespace FineUIPro.Web.HSSE.EduTrain +{ + + + public partial class TrainingSave + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtTrainingCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTrainingCode; + + /// + /// txtTrainingName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTrainingName; + + /// + /// drpIsEndLever 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpIsEndLever; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } } diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/Trainingrecords.aspx b/SGGL/FineUIPro.Web/HSSE/EduTrain/Trainingrecords.aspx new file mode 100644 index 00000000..7ba2fda2 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/Trainingrecords.aspx @@ -0,0 +1,137 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Trainingrecords.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.Trainingrecords" %> + + + + + + + 培训记录 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/Trainingrecords.aspx.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/Trainingrecords.aspx.cs new file mode 100644 index 00000000..79b4d9b8 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/Trainingrecords.aspx.cs @@ -0,0 +1,216 @@ +using BLL; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.HSSE.EduTrain +{ + public partial class Trainingrecords : PageBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + BindGrid(); + + } + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + string projectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值 + { + projectId = Request.Params["projectId"]; + } + if (!string.IsNullOrEmpty(projectId)) + { + string strSql = @"select tp.TrainContent,tp.TrainStartDate,u.UnitName,bt.TrainTypeName,btl.TrainLevelName,tp.TeachHour,tp.ProjectId, + f.*,p.PersonName From Training_TaskItem f + left join SitePerson_Person p on f.PersonId = p.PersonId + left join Training_Plan tp on f.PlanId = tp.PlanId + left join Base_TrainType bt on tp.TrainTypeId = bt.TrainTypeId + left join Base_TrainLevel btl on tp.TrainLevelId = btl.TrainLevelId + left join Base_Unit u on p.UnitId = u.UnitId WHERE 1=1 "; + List listStr = new List(); + strSql += " AND tp.ProjectId = @ProjectId"; + listStr.Add(new SqlParameter("@ProjectId", projectId)); + + if (!string.IsNullOrEmpty(txtName.Text.Trim())) + { + strSql += " AND p.PersonName like '%"+ txtName.Text.Trim() + "%'"; + } + if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim())) + { + strSql += " AND tp.TrainStartDate >= @StartDate "; + listStr.Add(new SqlParameter("@StartDate", this.txtStartDate.Text.Trim())); + } + if (!string.IsNullOrEmpty(this.txtEndDate.Text.Trim())) + { + strSql += " AND tp.TrainStartDate <= @EndDate "; + listStr.Add(new SqlParameter("@EndDate", this.txtEndDate.Text.Trim())); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + //tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + + Grid1.DataSource = table; + Grid1.DataBind(); + } + } + + #region 查询事件 + /// + /// 查询事件 + /// + /// + /// + protected void Text_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 页索引改变事件 + /// + /// 页索引改变事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + #endregion + + #region 分页选择下拉改变事件 + /// + /// 分页选择下拉改变事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + 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 = this.Grid1.Rows.Count(); + BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + +#pragma warning disable CS0108 // “TrainRecord.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。 + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) +#pragma warning restore CS0108 // “TrainRecord.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。 + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + sb.AppendFormat("", column.HeaderText); + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("lblNumber") as AspNet.Label).Text; + } + if (column.ColumnID == "tfLearnTime") + { + html = (row.FindControl("lblLearnTime") as AspNet.Label).Text; + } + if (column.ColumnID == "tfVideoProgress") + { + html = (row.FindControl("lblVideoProgress") as AspNet.Label).Text; + } + + //sb.AppendFormat("", html); + sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}{0}
"); + + return sb.ToString(); + } + #endregion + + #region 格式化字符串 + /// + /// 获取单位名称 + /// + /// + /// + protected string ConvertTime(object time) + { + string hours = "0"; + if (time != null) + { + if (!string.IsNullOrEmpty(time.ToString())) + { + return (Convert.ToInt32(time) / 60).ToString(); + } + else { + return hours; + } + + } + return hours; + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/EduTrain/Trainingrecords.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/EduTrain/Trainingrecords.aspx.designer.cs new file mode 100644 index 00000000..96cec61e --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/EduTrain/Trainingrecords.aspx.designer.cs @@ -0,0 +1,179 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.EduTrain +{ + + + public partial class Trainingrecords + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// txtName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtName; + + /// + /// txtStartDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtStartDate; + + /// + /// lblTo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblTo; + + /// + /// txtEndDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtEndDate; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// lblLearnTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblLearnTime; + + /// + /// lblVideoProgress 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblVideoProgress; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/Examine/StaffHSEInfoArchives.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Examine/StaffHSEInfoArchives.aspx.cs index 8ab186f6..eccd773d 100644 --- a/SGGL/FineUIPro.Web/HSSE/Examine/StaffHSEInfoArchives.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/Examine/StaffHSEInfoArchives.aspx.cs @@ -114,6 +114,7 @@ namespace FineUIPro.Web.HSSE.Examine this.txtPersonName.Text = personInfo.PersonName; this.txtIdentityCard.Text = personInfo.IdentityCard; this.txtUnitName.Text = personInfo.UnitName; + //this.txtPostTrainingRoleName.Text = personInfo.PostTrainingRoleName; this.txtWorkPostName.Text = personInfo.WorkPostName; this.txtPoliticsStatusName.Text = personInfo.PoliticsStatusName; } @@ -139,246 +140,7 @@ namespace FineUIPro.Web.HSSE.Examine /// private void BindGrid() { - FineUIPro.BoundField bf; - FineUIPro.RenderField rf; - FineUIPro.TextBox txTextBox; - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "ScoreItems"; - bf.DataField = "ScoreItems"; - bf.HeaderText = "分值项目"; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - bf.Locked = true; - Grid1.Columns.Add(bf); - - #region 基本项(满分80分) - - GroupField p1 = new GroupField(); - p1.HeaderText = "基本项(满分80分)"; - p1.TextAlign = TextAlign.Center; - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "年度培训"; - bf.DataField = "年度培训"; - bf.HeaderText = "年度培训"; - bf.HeaderToolTip = "完成应培训学时基础60分,超出1小时1分;满分80分"; - bf.Width = 80; - //bf.HeaderStyle.CssClass = "multiline-header"; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p1.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "问责或出问题项培训"; - bf.DataField = "问责或出问题项培训"; - bf.HeaderText = "问责/问题项培训"; - bf.HeaderToolTip = "完成应培训学时基础60分,1学时1分;满分20分"; - bf.Width = 150; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p1.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "指标完成情况"; - bf.DataField = "指标完成情况"; - bf.HeaderText = "指标完成情况"; - bf.HeaderToolTip = "《质量、健康安全环保责任书》中目标指标完成情况;全部完成100分"; - bf.Width = 110; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p1.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "岗位HSE职责"; - bf.DataField = "岗位HSE职责"; - bf.HeaderText = "岗位HSE职责"; - bf.HeaderToolTip = "全部履职100分"; - bf.MaxWidth = 150; - bf.MinWidth = 120; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p1.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "个人安全行动计划"; - bf.DataField = "个人安全行动计划"; - bf.HeaderText = "个人安全行动计划"; - bf.HeaderToolTip = "1年4次"; - bf.MaxWidth = 150; - bf.MinWidth = 120; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p1.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "安全经验分享"; - bf.DataField = "安全经验分享"; - bf.HeaderText = "安全经验分享"; - bf.HeaderToolTip = "1月1次,1次10分,满分100"; - bf.MaxWidth = 150; - bf.MinWidth = 120; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p1.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "领导人员参加班组作业风险会分析会"; - bf.DataField = "领导人员参加班组作业风险会分析会"; - bf.HeaderText = "领导人员参加班组作业风险会分析会"; - bf.HeaderToolTip = "1季度1次,1季度25分"; - bf.MaxWidth = 150; - bf.MinWidth = 120; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p1.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "一线党员联系班组党建活动"; - bf.DataField = "一线党员联系班组党建活动"; - bf.HeaderText = "一线党员联系班组党建活动"; - bf.HeaderToolTip = "半年1次,1次50分"; - bf.MaxWidth = 150; - bf.MinWidth = 120; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p1.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "行为安全观察与活动"; - bf.DataField = "行为安全观察与活动"; - bf.HeaderText = "行为安全观察与活动"; - bf.HeaderToolTip = "1年4次"; - bf.MaxWidth = 150; - bf.MinWidth = 120; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p1.Columns.Add(bf); - - Grid1.Columns.Add(p1); - - #endregion - - #region 扣分项(无封顶) - - GroupField p2 = new GroupField(); - p2.HeaderText = "扣分项(无封顶)"; - p2.TextAlign = TextAlign.Center; - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "轻微问题"; - bf.DataField = "轻微问题"; - bf.HeaderText = "轻微问题"; - bf.HeaderToolTip = "1个1分"; - bf.Width = 80; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p2.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "一般问题"; - bf.DataField = "一般问题"; - bf.HeaderText = "一般问题"; - bf.HeaderToolTip = "1个2分"; - bf.Width = 80; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p2.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "较大问题"; - bf.DataField = "较大问题"; - bf.HeaderText = "较大问题"; - bf.HeaderToolTip = "1个3分"; - bf.Width = 80; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p2.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "严重问题"; - bf.DataField = "严重问题"; - bf.HeaderText = "严重问题"; - bf.HeaderToolTip = "1个4分"; - bf.Width = 80; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p2.Columns.Add(bf); - - Grid1.Columns.Add(p2); - - #endregion - - #region 加分项(满分20分) - - GroupField p3 = new GroupField(); - p3.HeaderText = "加分项(满分20分)"; - p3.TextAlign = TextAlign.Center; - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "集团级先进"; - bf.DataField = "集团级先进"; - bf.HeaderText = "集团级先进"; - bf.HeaderToolTip = "1个3分"; - bf.Width = 100; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p3.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "CPECC级先进"; - bf.DataField = "CPECC级先进"; - bf.HeaderText = "CPECC级先进"; - bf.HeaderToolTip = "1个2分"; - bf.Width = 120; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p3.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "公司级先进"; - bf.DataField = "公司级先进"; - bf.HeaderText = "公司级先进"; - bf.HeaderToolTip = "1个1分"; - bf.Width = 100; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p3.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "全员查隐患"; - bf.DataField = "全员查隐患"; - bf.HeaderText = "全员查隐患"; - bf.HeaderToolTip = "100条1分,200条2分...1000条10分满分"; - bf.Width = 100; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p3.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "五星计划"; - bf.DataField = "五星计划"; - bf.HeaderText = "五星计划"; - bf.HeaderToolTip = "2星1分,3星2分,4星3分,5星4分"; - bf.Width = 80; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p3.Columns.Add(bf); - - bf = new FineUIPro.BoundField(); - bf.ColumnID = "安全超市积分"; - bf.DataField = "安全超市积分"; - bf.HeaderText = "安全超市积分"; - bf.HeaderToolTip = "1次1分,满分10分"; - bf.Width = 110; - bf.HeaderTextAlign = TextAlign.Center; - bf.TextAlign = TextAlign.Center; - p3.Columns.Add(bf); - - Grid1.Columns.Add(p3); - - #endregion - + } #endregion diff --git a/SGGL/FineUIPro.Web/HSSE/Examine/StaffHSEInfoArchivesOld.aspx b/SGGL/FineUIPro.Web/HSSE/Examine/StaffHSEInfoArchivesOld.aspx new file mode 100644 index 00000000..5b88dd69 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Examine/StaffHSEInfoArchivesOld.aspx @@ -0,0 +1,147 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StaffHSEInfoArchivesOld.aspx.cs" Inherits="FineUIPro.Web.HSSE.Examine.StaffHSEInfoArchivesOld" %> + + + + + + 员工HSE信息档案 + + + + +
+ <%-- + + + + + + + + + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + + + + + <%-- + + + + + + + + + + + + --%> + + + + + + + <%-- + + + + + + + + + + + + + + + + + + + + --%> + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/Examine/StaffHSEInfoArchivesOld.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Examine/StaffHSEInfoArchivesOld.aspx.cs new file mode 100644 index 00000000..47dd9ec4 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Examine/StaffHSEInfoArchivesOld.aspx.cs @@ -0,0 +1,388 @@ +using BLL; +using System; +using System.Data; +using System.Linq; + +namespace FineUIPro.Web.HSSE.Examine +{ + public partial class StaffHSEInfoArchivesOld : PageBase + { + #region 定义项 + /// + /// 人员主键 + /// + public string PersonId + { + get + { + return (string)ViewState["PersonId"]; + } + set + { + ViewState["PersonId"] = value; + } + } + /// + /// 人员主键 + /// + public string UserId + { + get + { + return (string)ViewState["UserId"]; + } + set + { + ViewState["UserId"] = value; + } + } + + /// + /// 项目id + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + /// + /// 单位id + /// + public string UnitId + { + get + { + return (string)ViewState["UnitId"]; + } + set + { + ViewState["UnitId"] = value; + } + } + /// + /// 人员身份证 + /// + public string IdentityCard + { + get + { + return (string)ViewState["IdentityCard"]; + } + set + { + ViewState["IdentityCard"] = value; + } + } + #endregion + + #region 加载页面 + + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.ProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + + this.PersonId = Request.Params["PersonId"]; + + var lstYesr = BLL.ConstValue.drpConstItemList(ConstValue.Group_0008); + this.drpYear.DataTextField = "ConstText"; + this.drpYear.DataValueField = "ConstValue"; + this.drpYear.DataSource = lstYesr.OrderByDescending(x => x.SortIndex); + this.drpYear.DataBind(); + this.drpYear.SelectedValue = DateTime.Now.Year.ToString(); + + + var personInfo = PersonService.GetPersonInfoById(this.PersonId); + if (personInfo != null) + { + this.txtPersonName.Text = personInfo.PersonName; + this.txtIdentityCard.Text = personInfo.IdentityCard; + this.txtUnitName.Text = personInfo.UnitName; + //this.txtPostTrainingRoleName.Text = personInfo.PostTrainingRoleName; + this.txtWorkPostName.Text = personInfo.WorkPostName; + this.txtPoliticsStatusName.Text = personInfo.PoliticsStatusName; + } + + this.BindGrid(); + } + } + + /// + /// 查询 + /// + /// + /// + protected void btnSearch_Click(object sender, EventArgs e) + { + this.BindGrid(); + } + + public DataTable GridTable = new DataTable(); + + /// + /// 绑定数据 + /// + private void BindGrid() + { + FineUIPro.BoundField bf; + FineUIPro.RenderField rf; + FineUIPro.TextBox txTextBox; + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "ScoreItems"; + bf.DataField = "ScoreItems"; + bf.HeaderText = "分值项目"; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + bf.Locked = true; + Grid1.Columns.Add(bf); + + #region 基本项(满分80分) + + GroupField p1 = new GroupField(); + p1.HeaderText = "基本项(满分80分)"; + p1.TextAlign = TextAlign.Center; + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "年度培训"; + bf.DataField = "年度培训"; + bf.HeaderText = "年度培训"; + bf.HeaderToolTip = "完成应培训学时基础60分,超出1小时1分;满分80分"; + bf.Width = 80; + //bf.HeaderStyle.CssClass = "multiline-header"; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p1.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "问责或出问题项培训"; + bf.DataField = "问责或出问题项培训"; + bf.HeaderText = "问责/问题项培训"; + bf.HeaderToolTip = "完成应培训学时基础60分,1学时1分;满分20分"; + bf.Width = 150; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p1.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "指标完成情况"; + bf.DataField = "指标完成情况"; + bf.HeaderText = "指标完成情况"; + bf.HeaderToolTip = "《质量、健康安全环保责任书》中目标指标完成情况;全部完成100分"; + bf.Width = 110; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p1.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "岗位HSE职责"; + bf.DataField = "岗位HSE职责"; + bf.HeaderText = "岗位HSE职责"; + bf.HeaderToolTip = "全部履职100分"; + bf.MaxWidth = 150; + bf.MinWidth = 120; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p1.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "个人安全行动计划"; + bf.DataField = "个人安全行动计划"; + bf.HeaderText = "个人安全行动计划"; + bf.HeaderToolTip = "1年4次"; + bf.MaxWidth = 150; + bf.MinWidth = 120; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p1.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "安全经验分享"; + bf.DataField = "安全经验分享"; + bf.HeaderText = "安全经验分享"; + bf.HeaderToolTip = "1月1次,1次10分,满分100"; + bf.MaxWidth = 150; + bf.MinWidth = 120; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p1.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "领导人员参加班组作业风险会分析会"; + bf.DataField = "领导人员参加班组作业风险会分析会"; + bf.HeaderText = "领导人员参加班组作业风险会分析会"; + bf.HeaderToolTip = "1季度1次,1季度25分"; + bf.MaxWidth = 150; + bf.MinWidth = 120; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p1.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "一线党员联系班组党建活动"; + bf.DataField = "一线党员联系班组党建活动"; + bf.HeaderText = "一线党员联系班组党建活动"; + bf.HeaderToolTip = "半年1次,1次50分"; + bf.MaxWidth = 150; + bf.MinWidth = 120; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p1.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "行为安全观察与活动"; + bf.DataField = "行为安全观察与活动"; + bf.HeaderText = "行为安全观察与活动"; + bf.HeaderToolTip = "1年4次"; + bf.MaxWidth = 150; + bf.MinWidth = 120; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p1.Columns.Add(bf); + + Grid1.Columns.Add(p1); + + #endregion + + #region 扣分项(无封顶) + + GroupField p2 = new GroupField(); + p2.HeaderText = "扣分项(无封顶)"; + p2.TextAlign = TextAlign.Center; + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "轻微问题"; + bf.DataField = "轻微问题"; + bf.HeaderText = "轻微问题"; + bf.HeaderToolTip = "1个1分"; + bf.Width = 80; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p2.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "一般问题"; + bf.DataField = "一般问题"; + bf.HeaderText = "一般问题"; + bf.HeaderToolTip = "1个2分"; + bf.Width = 80; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p2.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "较大问题"; + bf.DataField = "较大问题"; + bf.HeaderText = "较大问题"; + bf.HeaderToolTip = "1个3分"; + bf.Width = 80; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p2.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "严重问题"; + bf.DataField = "严重问题"; + bf.HeaderText = "严重问题"; + bf.HeaderToolTip = "1个4分"; + bf.Width = 80; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p2.Columns.Add(bf); + + Grid1.Columns.Add(p2); + + #endregion + + #region 加分项(满分20分) + + GroupField p3 = new GroupField(); + p3.HeaderText = "加分项(满分20分)"; + p3.TextAlign = TextAlign.Center; + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "集团级先进"; + bf.DataField = "集团级先进"; + bf.HeaderText = "集团级先进"; + bf.HeaderToolTip = "1个3分"; + bf.Width = 100; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p3.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "CPECC级先进"; + bf.DataField = "CPECC级先进"; + bf.HeaderText = "CPECC级先进"; + bf.HeaderToolTip = "1个2分"; + bf.Width = 120; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p3.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "公司级先进"; + bf.DataField = "公司级先进"; + bf.HeaderText = "公司级先进"; + bf.HeaderToolTip = "1个1分"; + bf.Width = 100; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p3.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "全员查隐患"; + bf.DataField = "全员查隐患"; + bf.HeaderText = "全员查隐患"; + bf.HeaderToolTip = "100条1分,200条2分...1000条10分满分"; + bf.Width = 100; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p3.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "五星计划"; + bf.DataField = "五星计划"; + bf.HeaderText = "五星计划"; + bf.HeaderToolTip = "2星1分,3星2分,4星3分,5星4分"; + bf.Width = 80; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p3.Columns.Add(bf); + + bf = new FineUIPro.BoundField(); + bf.ColumnID = "安全超市积分"; + bf.DataField = "安全超市积分"; + bf.HeaderText = "安全超市积分"; + bf.HeaderToolTip = "1次1分,满分10分"; + bf.Width = 110; + bf.HeaderTextAlign = TextAlign.Center; + bf.TextAlign = TextAlign.Center; + p3.Columns.Add(bf); + + Grid1.Columns.Add(p3); + + #endregion + + } + + #endregion + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/Examine/StaffHSEInfoArchivesOld.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/Examine/StaffHSEInfoArchivesOld.aspx.designer.cs new file mode 100644 index 00000000..4ff11a39 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/Examine/StaffHSEInfoArchivesOld.aspx.designer.cs @@ -0,0 +1,161 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.Examine +{ + + + public partial class StaffHSEInfoArchivesOld + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel5; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpYear; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// Panel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel2; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtPersonName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPersonName; + + /// + /// txtIdentityCard 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtIdentityCard; + + /// + /// txtUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtUnitName; + + /// + /// txtWorkPostName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWorkPostName; + + /// + /// txtPoliticsStatusName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPoliticsStatusName; + + /// + /// Panel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel3; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationAdd.aspx b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationAdd.aspx index f2cae2bc..9d249dc3 100644 --- a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationAdd.aspx +++ b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationAdd.aspx @@ -37,8 +37,10 @@ + - + + diff --git a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx index 0de08ca7..91a921b8 100644 --- a/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx +++ b/SGGL/FineUIPro.Web/HSSE/HiddenInspection/HiddenRectificationList.aspx @@ -59,23 +59,24 @@ - - - + +
- + - - - - - + + + + + + + @@ -112,7 +113,7 @@ - + diff --git a/SGGL/FineUIPro.Web/HSSE/PostTraining/Record.aspx b/SGGL/FineUIPro.Web/HSSE/PostTraining/Record.aspx index ff3c8f73..57e0ab92 100644 --- a/SGGL/FineUIPro.Web/HSSE/PostTraining/Record.aspx +++ b/SGGL/FineUIPro.Web/HSSE/PostTraining/Record.aspx @@ -33,24 +33,19 @@ AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="180px" LabelWidth="60px" LabelAlign="right"> - - <%-- + - + + + - - --%> - <%-- - --%> - <%-- - --%> <%-- @@ -75,14 +70,26 @@ SortField="Code" FieldType="String" HeaderText="编号" HeaderTextAlign="Center" EnableLock="true" Locked="true" TextAlign="Center"> - - - + --%> + + + + + + + + + + @@ -91,6 +98,18 @@ SortField="CourseName" FieldType="String" HeaderText="培训课程" HeaderTextAlign="Center" EnableLock="true" Locked="true" TextAlign="Left"> + + + + + + <%-- @@ -99,10 +118,6 @@ SortField="Cycle" FieldType="Double" HeaderText="培训周期(年/次)" HeaderTextAlign="Center" TextAlign="Center"> - - diff --git a/SGGL/FineUIPro.Web/HSSE/PostTraining/Record.aspx.cs b/SGGL/FineUIPro.Web/HSSE/PostTraining/Record.aspx.cs index 93041d73..39e08805 100644 --- a/SGGL/FineUIPro.Web/HSSE/PostTraining/Record.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/PostTraining/Record.aspx.cs @@ -63,28 +63,39 @@ namespace FineUIPro.Web.HSSE.PostTraining /// private void InitDropDownList() { + //单位 + BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true); ////获取适用岗位下拉框 //PostTrainingRoleService.InitPostTrainingRoleDropDownList(this.drpRole, true); - ////获取培训类别下拉框 - //PostTrainingCategoryService.InitPostTrainingCategoryDropDownList(this.drpCategory, true); - ////获取培训方式下拉框 - //PostTrainingMethodService.InitPostTrainingMethodDropDownList(this.drpMethod, null, true); + //获取培训类别下拉框 + PostTrainingCategoryService.InitPostTrainingCategoryDropDownList(this.drpCategory, true); + //获取培训方式下拉框 + PostTrainingMethodService.InitPostTrainingMethodDropDownList(this.drpMethod, null, true); ////获取培训师资下拉框 //PostTrainingTeachersService.InitPostTrainingTeachersDropDownList(this.drpTeachers, null, true); ////获取培训效果下拉框 //PostTrainingRecordService.InitPostTrainingOutcomeDropDownList(this.drpOutcome, true); } + /// + /// 培训类别下拉加载 + /// + /// + /// + protected void drpCategory_SelectedIndexChanged(object sender, EventArgs e) + { + //培训课程 + PostTrainingCourseService.InitPostTrainingCourseDropDownList(this.drpCourse, this.drpCategory.SelectedValue, true); + this.BindGrid(); + } + /// /// 绑定数据 /// private void BindGrid() { - string strSql = @"SELECT Record.*,Person.PersonName,Role.Name AS RoleName - FROM PostTraining_Record_Detail AS Detail - LEFT JOIN PostTraining_Record AS Record ON Record.Id=Detail.RecordId - LEFT JOIN SitePerson_Person AS Person ON Person.PersonId=Detail.PersonId - LEFT JOIN PostTraining_Role AS Role ON Role.Id=Person.PostTrainingRoleId + string strSql = @"SELECT Record.* ,SUser.UserName AS CompileManName + FROM PostTraining_Record AS Record LEFT JOIN Sys_User AS SUser ON SUser.UserId=Record.CompileMan WHERE 1=1 "; List listStr = new List(); @@ -93,26 +104,31 @@ namespace FineUIPro.Web.HSSE.PostTraining strSql += " AND Record.Code LIKE @Code"; listStr.Add(new SqlParameter("@Code", "%" + this.txtCode.Text.Trim() + "%")); } - if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim())) + if (!string.IsNullOrEmpty(this.txtName.Text.Trim())) { - strSql += " AND Person.PersonName LIKE @PersonName"; - listStr.Add(new SqlParameter("@PersonName", "%" + this.txtPersonName.Text.Trim() + "%")); + strSql += " AND Record.Name LIKE @Name"; + listStr.Add(new SqlParameter("@Name", "%" + this.txtName.Text.Trim() + "%")); } //if (this.drpRole.SelectedValue != BLL.Const._Null) //{ // strSql += " AND Record.RoleId = @RoleId"; // listStr.Add(new SqlParameter("@RoleId", this.drpRole.SelectedValue)); //} - //if (this.drpCategory.SelectedValue != BLL.Const._Null) - //{ - // strSql += " AND Course.CategoryId = @CategoryId"; - // listStr.Add(new SqlParameter("@CategoryId", this.drpCategory.SelectedValue)); - //} - //if (this.drpMethod.SelectedValue != BLL.Const._Null) - //{ - // strSql += " AND Record.Method = @Method"; - // listStr.Add(new SqlParameter("@Method", this.drpMethod.SelectedValue)); - //} + if (this.drpCategory.SelectedValue != BLL.Const._Null) + { + strSql += " AND Record.CategoryId = @CategoryId"; + listStr.Add(new SqlParameter("@CategoryId", this.drpCategory.SelectedValue)); + } + if (this.drpCourse.SelectedValue != null && this.drpCourse.SelectedValue != BLL.Const._Null) + { + strSql += " AND Record.CourseId = @CourseId"; + listStr.Add(new SqlParameter("@CourseId", this.drpCourse.SelectedValue)); + } + if (this.drpMethod.SelectedValue != BLL.Const._Null) + { + strSql += " AND Record.Method = @Method"; + listStr.Add(new SqlParameter("@Method", this.drpMethod.SelectedValue)); + } //if (this.drpTeachers.SelectedValue != BLL.Const._Null) //{ // strSql += " AND Record.Teachers = @Teachers"; @@ -168,6 +184,71 @@ namespace FineUIPro.Web.HSSE.PostTraining this.BindGrid(); } #endregion + + #region 格式化字符串 + + /// + /// 获取单位名称 + /// + /// + /// + protected string ConvertUnitName(object unitIds) + { + string unitName = string.Empty; + if (unitIds != null) + { + List infos = unitIds.ToString().Split(',').ToList(); + if (infos.Count() > 0) + { + foreach (var item in infos) + { + Model.Base_Unit unit = BLL.UnitService.GetUnitByUnitId(item); + if (unit != null) + { + unitName += unit.UnitName + ","; + } + } + if (!string.IsNullOrEmpty(unitName)) + { + unitName = unitName.Substring(0, unitName.LastIndexOf(",")); + } + } + } + return unitName; + } + + /// + /// 获取适用岗位名称 + /// + /// + /// + protected string ConvertRoleName(object roleIds) + { + string roleName = string.Empty; + if (roleIds != null) + { + List infos = roleIds.ToString().Split(',').ToList(); + if (infos.Count() > 0) + { + foreach (var item in infos) + { + Model.PostTraining_Role role = BLL.PostTrainingRoleService.GetRoleById(item); + if (role != null) + { + roleName += role.Name + ","; + } + } + if (!string.IsNullOrEmpty(roleName)) + { + roleName = roleName.Substring(0, roleName.LastIndexOf(",")); + } + } + } + return roleName; + } + + #endregion + #endregion #region 查询 diff --git a/SGGL/FineUIPro.Web/HSSE/PostTraining/Record.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/PostTraining/Record.aspx.designer.cs index 97396b2a..e69037c3 100644 --- a/SGGL/FineUIPro.Web/HSSE/PostTraining/Record.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/PostTraining/Record.aspx.designer.cs @@ -69,13 +69,49 @@ namespace FineUIPro.Web.HSSE.PostTraining protected global::FineUIPro.TextBox txtCode; /// - /// txtPersonName 控件。 + /// txtName 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.TextBox txtPersonName; + protected global::FineUIPro.TextBox txtName; + + /// + /// drpUnitId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnitId; + + /// + /// drpCategory 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCategory; + + /// + /// drpCourse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCourse; + + /// + /// drpMethod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpMethod; /// /// ToolbarFill1 控件。 @@ -104,6 +140,24 @@ namespace FineUIPro.Web.HSSE.PostTraining /// protected global::System.Web.UI.WebControls.Label lblNumber; + /// + /// lblUnitId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblUnitId; + + /// + /// lblRoleId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblRoleId; + /// /// ToolbarSeparator1 控件。 /// diff --git a/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordEdit.aspx b/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordEdit.aspx index 29a21dd6..62076fff 100644 --- a/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordEdit.aspx +++ b/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordEdit.aspx @@ -67,14 +67,16 @@ - + - + +<%-- + --%> @@ -98,9 +100,9 @@ - <%-- - --%> + diff --git a/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordEdit.aspx.cs index 6130dfed..772a17c7 100644 --- a/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordEdit.aspx.cs @@ -69,7 +69,25 @@ namespace FineUIPro.Web.HSSE.PostTraining if (model != null) { this.txtCode.Text = model.Code; + this.txtName.Text = model.Name; + this.txtContent.Text = model.Content; this.txtRemark.Text = model.Remark; + this.txtPersonNum.Text = model.PersonNum.ToString(); + this.txtLocation.Text = model.Location; + this.txtDuration.Text = model.Duration.ToString(); + this.txtLecturer.Text = model.Lecturer; + if (!string.IsNullOrEmpty(model.UnitIds)) + { + this.drpUnits.SelectedValueArray = model.UnitIds.Split(','); + } + if (!string.IsNullOrEmpty(model.WorkPostIds)) + { + this.drpWorkPost.SelectedValueArray = model.WorkPostIds.Split(','); + } + if (model.TrainingTime != null) + { + this.txtTrainingTime.Text = string.Format("{0:yyyy-MM-dd}", model.TrainingTime); + } if (!string.IsNullOrWhiteSpace(model.CourseId)) { var course = BLL.PostTrainingCourseService.GetCourseById(model.CourseId); @@ -88,7 +106,10 @@ namespace FineUIPro.Web.HSSE.PostTraining { ////自动生成编码 this.txtCode.Text = SQLHelper.RunProcNewId("SpGetNewCode5", "dbo.PostTraining_Record", "Code", ""); + this.txtLecturer.Text = this.CurrUser.UserName; + this.txtTrainingTime.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); } + this.Grid1DataBind(); } } @@ -99,8 +120,10 @@ namespace FineUIPro.Web.HSSE.PostTraining { //培训单位 UnitService.InitUnitDropDownList(this.drpUnits, this.ProjectId, false); - //获取适用岗位下拉框 - PostTrainingRoleService.InitPostTrainingRoleDropDownList(this.drpRole, false); + //所属岗位 + WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); + ////获取适用岗位下拉框 + //PostTrainingRoleService.InitPostTrainingRoleDropDownList(this.drpRole, false); //获取培训类别下拉框 PostTrainingCategoryService.InitPostTrainingCategoryDropDownList(this.drpCategory, false); //获取培训方式下拉框 @@ -127,36 +150,10 @@ namespace FineUIPro.Web.HSSE.PostTraining { recordDetails = (from x in Funs.DB.View_PostTraining_RecordDetail where x.RecordId == this.Id - orderby x.UnitName, x.RoleName, x.PersonName + orderby x.UnitName, x.WorkPostName, x.PersonName select x).ToList(); Grid1.DataSource = recordDetails; Grid1.DataBind(); - //for (int i = 0; i < Grid1.Rows.Count; i++) - //{ - // bool isRed = true; - // string trainDetailId = Grid1.Rows[i].DataKeys[0].ToString(); - // var getAtt = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == trainDetailId); - // if (getAtt != null) - // { - // isRed = false; - // } - // if (isRed) - // { - // var getRecordDetail = recordDetails.FirstOrDefault(x => x.DetailId == trainDetailId); - // if (getRecordDetail != null && !string.IsNullOrEmpty(this.TestPlanId)) ////未参加过培训的人员 - // { - // var getTestRecord = Funs.DB.Training_TestRecord.FirstOrDefault(x => x.TestManId == getRecordDetail.PersonId && x.TestPlanId == this.TestPlanId); - // if (getTestRecord != null) - // { - // isRed = false; - // } - // } - // } - // if (isRed) - // { - // Grid1.Rows[i].RowCssClass = "Red"; - // } - //} } #endregion @@ -174,16 +171,16 @@ namespace FineUIPro.Web.HSSE.PostTraining this.SaveData(BLL.Const.BtnSave); } //培训岗位 - string roleIds = string.Empty; - foreach (var item in this.drpRole.SelectedValueArray) + string workPostIds = string.Empty; + foreach (var item in this.drpWorkPost.SelectedValueArray) { - roleIds += item + ","; + workPostIds += item + ","; } - if (!string.IsNullOrEmpty(roleIds)) + if (!string.IsNullOrEmpty(workPostIds)) { - roleIds = roleIds.Substring(0, roleIds.LastIndexOf(",")); + workPostIds = workPostIds.Substring(0, workPostIds.LastIndexOf(",")); } - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SelectPerson.aspx?RecordId={0}&RoleIds={1}", this.Id, roleIds, "编辑 - "))); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SelectPerson.aspx?RecordId={0}&WorkPostIds={1}", this.Id, workPostIds, "编辑 - "))); } #endregion @@ -277,18 +274,18 @@ namespace FineUIPro.Web.HSSE.PostTraining } //培训岗位 - string roleIds = string.Empty; - foreach (var item in this.drpRole.SelectedValueArray) + string workPostIds = string.Empty; + foreach (var item in this.drpWorkPost.SelectedValueArray) { - roleIds += item + ","; + workPostIds += item + ","; } - if (!string.IsNullOrEmpty(roleIds)) + if (!string.IsNullOrEmpty(workPostIds)) { - roleIds = roleIds.Substring(0, roleIds.LastIndexOf(",")); + workPostIds = workPostIds.Substring(0, workPostIds.LastIndexOf(",")); } newModel.UnitIds = unitIds; - newModel.RoleIds = roleIds; + newModel.WorkPostIds = workPostIds; if (!string.IsNullOrEmpty(this.Id)) { newModel.Id = this.Id; @@ -326,6 +323,33 @@ namespace FineUIPro.Web.HSSE.PostTraining } #endregion + #region 导入 + /// + /// 导入按钮 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + if (this.drpCategory.SelectedValue == BLL.Const._Null) + { + ShowNotify("请选择培训类别!", MessageBoxIcon.Warning); + return; + } + if (this.drpCourse.SelectedValue == BLL.Const._Null) + { + ShowNotify("请选择培训课程!", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(this.Id)) + { + this.SaveData(BLL.Const.BtnSave); + } + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RecordIn.aspx?RecordId={0}", this.Id, "导入 - "), "导入", 900, 560)); + } + #endregion + #region 附件上传 /// /// 上传附件 diff --git a/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordEdit.aspx.designer.cs index f86f1863..2d359452 100644 --- a/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordEdit.aspx.designer.cs @@ -150,13 +150,13 @@ namespace FineUIPro.Web.HSSE.PostTraining protected global::FineUIPro.FormRow trRole; /// - /// drpRole 控件。 + /// drpWorkPost 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList drpRole; + protected global::FineUIPro.DropDownList drpWorkPost; /// /// txtContent 控件。 @@ -194,6 +194,15 @@ namespace FineUIPro.Web.HSSE.PostTraining /// protected global::FineUIPro.Toolbar Toolbar2; + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + /// /// btnSelect 控件。 /// diff --git a/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordIn.aspx b/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordIn.aspx new file mode 100644 index 00000000..6452369d --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordIn.aspx @@ -0,0 +1,100 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RecordIn.aspx.cs" Inherits="FineUIPro.Web.HSSE.PostTraining.RecordIn" %> + + + + + + 导入 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordIn.aspx.cs b/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordIn.aspx.cs new file mode 100644 index 00000000..fbaf6a67 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordIn.aspx.cs @@ -0,0 +1,360 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.OleDb; +using System.IO; +using System.Linq; +namespace FineUIPro.Web.HSSE.PostTraining +{ + + public partial class RecordIn : PageBase + { + #region 定义变量 + /// + /// 上传预设的虚拟路径 + /// + private string initPath = Const.ExcelUrl; + + /// + /// 导入集合 + /// + public static List viewRecordDetails = new List(); + + /// + /// 错误集合 + /// + public static string errorInfos = string.Empty; + + /// + /// 主键 + /// + public string RecordId + { + get + { + return (string)ViewState["RecordId"]; + } + set + { + ViewState["RecordId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.btnClose.OnClientClick = ActiveWindow.GetHidePostBackReference(); + this.hdFileName.Text = string.Empty; + this.hdCheckResult.Text = string.Empty; + this.RecordId = Request.Params["RecordId"]; + if (viewRecordDetails != null) + { + viewRecordDetails.Clear(); + } + errorInfos = string.Empty; + } + } + #endregion + + #region 数据导入 + /// + /// 数据导入 + /// + /// + /// + protected void btnAudit_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(this.RecordId)) + { + Alert.ShowInTop("先保存培训,再导入!", MessageBoxIcon.Warning); + return; + } + try + { + if (this.fuAttachUrl.HasFile == false) + { + Alert.ShowInTop("请您选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls") + { + Alert.ShowInTop("只可以选择Excel文件!", MessageBoxIcon.Warning); + return; + } + if (viewRecordDetails != null) + { + viewRecordDetails.Clear(); + } + if (!string.IsNullOrEmpty(errorInfos)) + { + errorInfos = string.Empty; + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + initPath; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + + this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls; + string filePath = initFullPath + this.hdFileName.Text; + this.fuAttachUrl.PostedFile.SaveAs(filePath); + ImportXlsToData(rootPath + initPath + this.hdFileName.Text); + } + catch (Exception ex) + { + ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning); + } + } + + #region 读Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData(string fileName) + { + try + { + viewRecordDetails.Clear(); + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL(ds.Tables[0]); + } + catch (Exception ex) + { + throw ex; + } + } + #endregion + + #region 将Dataset的数据导入数据库 + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集行数 + /// + private bool AddDatasetToSQL(DataTable pds) + { + string results = string.Empty; + int ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + var record = BLL.PostTrainingRecordService.GetRecordById(this.RecordId); + if (record != null) + { + var units = from x in Funs.DB.Base_Unit select x; + var persons = from x in Funs.DB.SitePerson_Person where x.ProjectId == record.ProjectId select x; + for (int i = 0; i < ir; i++) + { + string result = string.Empty; + string col0 = pds.Rows[i][0].ToString().Trim(); + string col1 = pds.Rows[i][1].ToString().Trim(); + //string col2 = pds.Rows[i][2].ToString().Trim(); + //string col3 = pds.Rows[i][3].ToString().Trim(); + if (!string.IsNullOrEmpty(col0) || !string.IsNullOrEmpty(col1) ) + { + if (string.IsNullOrEmpty(col0) || string.IsNullOrEmpty(col1)) + { + result += "第" + (i + 2).ToString() + "行," + "导入项" + "," + "此项为必填项!" + "|"; + } + else + { + Model.View_PostTraining_RecordDetail newViewRecordDetail = new Model.View_PostTraining_RecordDetail + { + DetailId = SQLHelper.GetNewID(typeof(Model.View_PostTraining_RecordDetail)), + RecordId = record.Id, + UnitName = col0, + PersonName = col1, + //CheckResult = false, + //CheckScore=Funs.GetNewDecimal(col3), + }; + + //if (col2 == "合格") + //{ + // newViewRecordDetail.CheckResult = true; + //} + var unit = units.FirstOrDefault(x => x.UnitName == col0); + if (unit != null) + { + newViewRecordDetail.UnitId = unit.UnitId; + var person = persons.FirstOrDefault(x => x.PersonName == col1 && x.UnitId == unit.UnitId); + if (person != null) + { + newViewRecordDetail.PersonId = person.PersonId; + } + else + { + result += "第" + (i + 2).ToString() + "行," + "在现场人员信息中不存在!" + "|"; + } + } + else + { + result += "第" + (i + 2).ToString() + "行," + "在单位信息中不存在!" + "|"; + } + + + ///判断是否已存在 + var addItem = Funs.DB.PostTraining_Record_Detail.FirstOrDefault(x => x.Id == newViewRecordDetail.DetailId && x.PersonId == newViewRecordDetail.PersonId); + if (addItem == null) + { + if (string.IsNullOrEmpty(result)) + { + Model.PostTraining_Record_Detail newRecordDetail = new Model.PostTraining_Record_Detail + { + Id = newViewRecordDetail.DetailId, + RecordId = newViewRecordDetail.RecordId, + PersonId = newViewRecordDetail.PersonId, + }; + + BLL.PostTrainingRecordDetailService.AddRecordDetail(newRecordDetail); + ///加入 + viewRecordDetails.Add(newViewRecordDetail); + } + } + else + { + result += "第" + (i + 2).ToString() + "行," + "导入数据重复" + "|"; + } + + + if (!string.IsNullOrEmpty(result)) + { + results += result; + } + } + } + } + if (viewRecordDetails.Count > 0) + { + viewRecordDetails = viewRecordDetails.Distinct().ToList(); + this.Grid1.Hidden = false; + this.Grid1.DataSource = viewRecordDetails; + this.Grid1.DataBind(); + } + + if (!string.IsNullOrEmpty(results)) + { + viewRecordDetails.Clear(); + results = "数据导入完成,未成功数据:" + results.Substring(0, results.LastIndexOf("|")); + errorInfos = results; + Alert.ShowInParent(results, MessageBoxIcon.Warning); + } + else + { + errorInfos = string.Empty; + ShowNotify("导入成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + } + else + { + Alert.ShowInTop("培训数据为空!", MessageBoxIcon.Warning); + } + } + else + { + Alert.ShowInTop("导入数据为空!", MessageBoxIcon.Warning); + } + + BLL.UploadFileService.DeleteFile(Funs.RootPath, initPath + this.hdFileName.Text); + return true; + } + #endregion + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭导入弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + if (Session["trainRecordDetails"] != null) + { + viewRecordDetails = Session["trainRecordDetails"] as List; + } + if (viewRecordDetails.Count > 0) + { + this.Grid1.Hidden = false; + this.Grid1.DataSource = viewRecordDetails; + this.Grid1.DataBind(); + } + } + + #endregion + + #region 下载模板 + /// + /// 下载模板按钮 + /// + /// + /// + protected void btnDownLoad_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); + } + + /// + /// 下载导入模板 + /// + /// + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirm_OK") + { + string rootPath = Server.MapPath("~/"); + string filePath = Const.PostTrainingRecordTemplateUrl; + string uploadfilepath = rootPath + filePath; + string fileName = Path.GetFileName(filePath); + FileInfo info = new FileInfo(uploadfilepath); + long fileSize = info.Length; + Response.ClearContent(); + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.ContentType = "excel/plain"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.AddHeader("Content-Length", fileSize.ToString().Trim()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.End(); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordIn.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordIn.aspx.designer.cs new file mode 100644 index 00000000..412c998a --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/PostTraining/RecordIn.aspx.designer.cs @@ -0,0 +1,143 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.PostTraining +{ + + + public partial class RecordIn + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// btnAudit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit; + + /// + /// btnDownLoad 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDownLoad; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// fuAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload fuAttachUrl; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + + /// + /// hdFileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdFileName; + + /// + /// hdCheckResult 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdCheckResult; + + /// + /// lblBottom 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblBottom; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/PostTraining/StandardEdit.aspx b/SGGL/FineUIPro.Web/HSSE/PostTraining/StandardEdit.aspx index e93563d6..3dfa891d 100644 --- a/SGGL/FineUIPro.Web/HSSE/PostTraining/StandardEdit.aspx +++ b/SGGL/FineUIPro.Web/HSSE/PostTraining/StandardEdit.aspx @@ -20,7 +20,9 @@ - + <%-- + --%> + diff --git a/SGGL/FineUIPro.Web/HSSE/PostTraining/StandardEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/PostTraining/StandardEdit.aspx.cs index 763d089a..f76464ff 100644 --- a/SGGL/FineUIPro.Web/HSSE/PostTraining/StandardEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/PostTraining/StandardEdit.aspx.cs @@ -60,9 +60,13 @@ namespace FineUIPro.Web.HSSE.PostTraining this.txtClassHour.Text = model.ClassHour.ToString(); this.txtCycle.Text = model.Cycle.ToString(); this.txtRemark.Text = model.Remark; - if (!string.IsNullOrWhiteSpace(model.RoleId)) + //if (!string.IsNullOrWhiteSpace(model.RoleId)) + //{ + // this.drpRole.SelectedValue = model.RoleId; + //} + if (!string.IsNullOrWhiteSpace(model.WorkPostId)) { - this.drpRole.SelectedValue = model.RoleId; + this.drpWorkPost.SelectedValue = model.WorkPostId; } if (!string.IsNullOrWhiteSpace(model.CourseId)) { @@ -100,8 +104,10 @@ namespace FineUIPro.Web.HSSE.PostTraining ///
private void InitDropDownList() { - //获取适用岗位下拉框 - PostTrainingRoleService.InitPostTrainingRoleDropDownList(this.drpRole, false); + //所属岗位 + WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); + ////获取适用岗位下拉框 + //PostTrainingRoleService.InitPostTrainingRoleDropDownList(this.drpRole, false); //获取培训类别下拉框 PostTrainingCategoryService.InitPostTrainingCategoryDropDownList(this.drpCategory, false); //获取培训方式下拉框 @@ -151,7 +157,8 @@ namespace FineUIPro.Web.HSSE.PostTraining CompileDate = DateTime.Now, CompileMan = this.CurrUser.UserId }; - newModel.RoleId = this.drpRole.SelectedValue; + newModel.WorkPostId = this.drpWorkPost.SelectedValue; + //newModel.RoleId = this.drpRole.SelectedValue; newModel.CourseId = this.drpCourse.SelectedValue; newModel.ClassHour = decimal.Parse(this.txtClassHour.Text.Trim()); newModel.Cycle = decimal.Parse(this.txtCycle.Text.Trim()); diff --git a/SGGL/FineUIPro.Web/HSSE/PostTraining/StandardEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/PostTraining/StandardEdit.aspx.designer.cs index 59d59f52..9ddd60a3 100644 --- a/SGGL/FineUIPro.Web/HSSE/PostTraining/StandardEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/PostTraining/StandardEdit.aspx.designer.cs @@ -51,13 +51,13 @@ namespace FineUIPro.Web.HSSE.PostTraining protected global::FineUIPro.TextBox txtCode; /// - /// drpRole 控件。 + /// drpWorkPost 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList drpRole; + protected global::FineUIPro.DropDownList drpWorkPost; /// /// drpCategory 控件。 diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx index 2840727a..53b5032e 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx @@ -58,9 +58,9 @@ - - + --%> @@ -116,9 +116,9 @@ - - + --%> <%-- --%> diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs index 995df8bf..c263b8db 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.cs @@ -65,7 +65,7 @@ namespace FineUIPro.Web.HSSE.SitePerson this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的  行数据吗?", Grid1.GetSelectedCountReference()); this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); BLL.WorkPostService.InitWorkPostDropDownList(this.drpPost, true); - PostTrainingRoleService.InitPostTrainingRoleDropDownList(this.drpRole, true); + //PostTrainingRoleService.InitPostTrainingRoleDropDownList(this.drpRole, true); this.InitTreeMenu();//加载树 } } @@ -294,21 +294,21 @@ namespace FineUIPro.Web.HSSE.SitePerson strSql += ")"; } - if (this.drpRole.SelectedItemArray.Count() > 1 || (this.drpRole.SelectedValue != BLL.Const._Null && this.drpRole.SelectedItemArray.Count() == 1)) - { - strSql += " AND (1=2 "; - int i = 0; - foreach (var item in this.drpRole.SelectedValueArray) - { - if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null) - { - strSql += " OR PostTrainingRoleId = @PostTrainingRoleId" + i.ToString(); - listStr.Add(new SqlParameter("@PostTrainingRoleId" + i.ToString(), item)); - } - i++; - } - strSql += ")"; - } + //if (this.drpRole.SelectedItemArray.Count() > 1 || (this.drpRole.SelectedValue != BLL.Const._Null && this.drpRole.SelectedItemArray.Count() == 1)) + //{ + // strSql += " AND (1=2 "; + // int i = 0; + // foreach (var item in this.drpRole.SelectedValueArray) + // { + // if (!string.IsNullOrEmpty(item) && item != BLL.Const._Null) + // { + // strSql += " OR PostTrainingRoleId = @PostTrainingRoleId" + i.ToString(); + // listStr.Add(new SqlParameter("@PostTrainingRoleId" + i.ToString(), item)); + // } + // i++; + // } + // strSql += ")"; + //} if (this.ckTrain.Checked) { diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs index bc9164c2..213f0926 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs @@ -131,15 +131,6 @@ namespace FineUIPro.Web.HSSE.SitePerson /// protected global::FineUIPro.DropDownList drpPost; - /// - /// drpRole 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList drpRole; - /// /// drpTreamGroup 控件。 /// diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx index 37ad4825..730d6e06 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx @@ -144,8 +144,8 @@ - - + <%-- + --%> diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs index 90165ab4..bca114a8 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs @@ -113,10 +113,10 @@ namespace FineUIPro.Web.HSSE.SitePerson { this.drpPost.SelectedValue = person.WorkPostId; } - if (!string.IsNullOrEmpty(person.PostTrainingRoleId)) - { - this.drpRole.SelectedValue = person.PostTrainingRoleId; - } + //if (!string.IsNullOrEmpty(person.PostTrainingRoleId)) + //{ + // this.drpRole.SelectedValue = person.PostTrainingRoleId; + //} if (!string.IsNullOrEmpty(person.PositionId)) { this.drpPosition.SelectedValue = person.PositionId; @@ -270,8 +270,8 @@ namespace FineUIPro.Web.HSSE.SitePerson gvWorkArea.DataBind();//单位工程 //所属岗位 WorkPostService.InitWorkPostDropDownList(this.drpPost, true); - //培训岗位 - PostTrainingRoleService.InitPostTrainingRoleDropDownList(this.drpRole, true); + ////培训岗位 + //PostTrainingRoleService.InitPostTrainingRoleDropDownList(this.drpRole, true); PositionService.InitPositionDropDownList(this.drpPosition, true); PostTitleService.InitPostTitleDropDownList(this.drpTitle, true); TeamGroupService.InitTeamGroupProjectUnitDropDownList(this.drpTeamGroup, this.ProjectId, this.UnitId, true); @@ -333,11 +333,11 @@ namespace FineUIPro.Web.HSSE.SitePerson ShowNotify("请选择所属岗位!", MessageBoxIcon.Warning); return; } - if (this.drpRole.SelectedValue == BLL.Const._Null) - { - ShowNotify("请选择培训岗位!", MessageBoxIcon.Warning); - return; - } + //if (this.drpRole.SelectedValue == BLL.Const._Null) + //{ + // ShowNotify("请选择培训岗位!", MessageBoxIcon.Warning); + // return; + //} if (string.IsNullOrEmpty(this.txtInTime.Text)) { ShowNotify("入场时间不能为空!", MessageBoxIcon.Warning); @@ -398,10 +398,10 @@ namespace FineUIPro.Web.HSSE.SitePerson { person.WorkPostId = this.drpPost.SelectedValue; } - if (this.drpRole.SelectedValue != BLL.Const._Null) - { - person.PostTrainingRoleId = this.drpRole.SelectedValue; - } + //if (this.drpRole.SelectedValue != BLL.Const._Null) + //{ + // person.PostTrainingRoleId = this.drpRole.SelectedValue; + //} if (this.drpPosition.SelectedValue != BLL.Const._Null) { person.PositionId = this.drpPosition.SelectedValue; diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.designer.cs index a9808df1..79820032 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.designer.cs @@ -401,15 +401,6 @@ namespace FineUIPro.Web.HSSE.SitePerson /// protected global::FineUIPro.RadioButtonList rblIsUsed; - /// - /// drpRole 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList drpRole; - /// /// Panel5 控件。 /// diff --git a/SGGL/FineUIPro.Web/Person/EduTrain/Plan.aspx.cs b/SGGL/FineUIPro.Web/Person/EduTrain/Plan.aspx.cs index bab37f0f..55e69dd8 100644 --- a/SGGL/FineUIPro.Web/Person/EduTrain/Plan.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/EduTrain/Plan.aspx.cs @@ -64,7 +64,7 @@ namespace FineUIPro.Web.Person.EduTrain Users.UserName AS DesignerName,WorkPostNames" + @" FROM dbo.Training_Plan AS Plans " + @" LEFT JOIN Sys_User AS Users ON Users.UserId = Plans.DesignerId " - + @" WHERE (Plans.ProjectId is null or Plans.ProjectId='') "; + + @" WHERE Plans.ProjectId is null "; List listStr = new List(); if (!string.IsNullOrEmpty(this.txtName.Text.Trim())) @@ -239,7 +239,7 @@ namespace FineUIPro.Web.Person.EduTrain string name = string.Empty; if (workPostIds != null) { - name = BLL.WorkPostService.getDepartNamesByIds(workPostIds); + name = BLL.DepartService.getDepartNamesByIds(workPostIds); } return name; diff --git a/SGGL/FineUIPro.Web/Person/EduTrain/TestRecord.aspx b/SGGL/FineUIPro.Web/Person/EduTrain/TestRecord.aspx index 70caf7f9..8b723602 100644 --- a/SGGL/FineUIPro.Web/Person/EduTrain/TestRecord.aspx +++ b/SGGL/FineUIPro.Web/Person/EduTrain/TestRecord.aspx @@ -123,7 +123,7 @@ - <%-- listStr = new List(); if (!string.IsNullOrEmpty(this.txtName.Text.Trim())) { diff --git a/SGGL/FineUIPro.Web/Person/EduTrain/TestRecordPrint.aspx.cs b/SGGL/FineUIPro.Web/Person/EduTrain/TestRecordPrint.aspx.cs index 2f0e1bd9..23e25bfb 100644 --- a/SGGL/FineUIPro.Web/Person/EduTrain/TestRecordPrint.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/EduTrain/TestRecordPrint.aspx.cs @@ -47,7 +47,7 @@ namespace FineUIPro.Web.Person.EduTrain { if (!IsPostBack) { - this.lbTitleName.Text = UnitService.GetUnitNameByUnitId(CommonService.GetThisUnitId()) + ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId); + this.lbTitleName.Text = UnitService.GetUnitNameByUnitId(Const.UnitId_TCC) + ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId); this.lbTestType.Text = "培训试题"; this.TestRecordId = Request.Params["TestRecordId"]; this.Type = Request.Params["Type"]; @@ -63,7 +63,7 @@ namespace FineUIPro.Web.Person.EduTrain { personInfo += "项目:" + ProjectService.GetProjectNameByProjectId(testRecord.ProjectId) + " "; } - else if (testRecord.UnitId == CommonService.GetThisUnitId()) + else if (testRecord.UnitId == Const.UnitId_TCC) { personInfo += "部门:" + DepartService.getDepartNameById(testRecord.DepartId) + " "; } diff --git a/SGGL/FineUIPro.Web/Person/EduTrain/TrainTestRecordEdit.aspx.cs b/SGGL/FineUIPro.Web/Person/EduTrain/TrainTestRecordEdit.aspx.cs index 938e7055..12ec6349 100644 --- a/SGGL/FineUIPro.Web/Person/EduTrain/TrainTestRecordEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/EduTrain/TrainTestRecordEdit.aspx.cs @@ -1,5 +1,4 @@ - -using BLL; +using BLL; using System; using System.Collections; using System.Collections.Generic; diff --git a/SGGL/Model/HSSE/PostTraining/PostTrainingStandardInfo.cs b/SGGL/Model/HSSE/PostTraining/PostTrainingStandardInfo.cs index afd00adf..d38b4444 100644 --- a/SGGL/Model/HSSE/PostTraining/PostTrainingStandardInfo.cs +++ b/SGGL/Model/HSSE/PostTraining/PostTrainingStandardInfo.cs @@ -7,8 +7,10 @@ namespace Model /// /// 适用岗位角色 /// - public string RoleName { get; set; } - public string RoleId { get; set; } + public string WorkPostName { get; set; } + public string WorkPostId { get; set; } + //public string RoleName { get; set; } + //public string RoleId { get; set; } /// /// 培训类别 /// diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index d36f11cb..5f41a259 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -288987,7 +288987,7 @@ namespace Model private string _UnitIds; - private string _RoleIds; + private string _WorkPostIds; private int _PersonNum; @@ -289041,8 +289041,8 @@ namespace Model partial void OnLecturerChanged(); partial void OnUnitIdsChanging(string value); partial void OnUnitIdsChanged(); - partial void OnRoleIdsChanging(string value); - partial void OnRoleIdsChanged(); + partial void OnWorkPostIdsChanging(string value); + partial void OnWorkPostIdsChanged(); partial void OnPersonNumChanging(int value); partial void OnPersonNumChanged(); partial void OnTrainingTimeChanging(System.DateTime value); @@ -289339,22 +289339,22 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RoleIds", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] - public string RoleIds + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPostIds", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + public string WorkPostIds { get { - return this._RoleIds; + return this._WorkPostIds; } set { - if ((this._RoleIds != value)) + if ((this._WorkPostIds != value)) { - this.OnRoleIdsChanging(value); + this.OnWorkPostIdsChanging(value); this.SendPropertyChanging(); - this._RoleIds = value; - this.SendPropertyChanged("RoleIds"); - this.OnRoleIdsChanged(); + this._WorkPostIds = value; + this.SendPropertyChanged("WorkPostIds"); + this.OnWorkPostIdsChanged(); } } } @@ -289836,8 +289836,6 @@ namespace Model private EntityRef _Sys_User; - private EntitySet _PostTraining_Standard; - #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -289859,7 +289857,6 @@ namespace Model public PostTraining_Role() { this._Sys_User = default(EntityRef); - this._PostTraining_Standard = new EntitySet(new Action(this.attach_PostTraining_Standard), new Action(this.detach_PostTraining_Standard)); OnCreated(); } @@ -290021,19 +290018,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_PostTraining_Standard_PostTraining_Role", Storage="_PostTraining_Standard", ThisKey="Id", OtherKey="RoleId", DeleteRule="NO ACTION")] - public EntitySet PostTraining_Standard - { - get - { - return this._PostTraining_Standard; - } - set - { - this._PostTraining_Standard.Assign(value); - } - } - public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -290053,18 +290037,6 @@ namespace Model this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } - - private void attach_PostTraining_Standard(PostTraining_Standard entity) - { - this.SendPropertyChanging(); - entity.PostTraining_Role = this; - } - - private void detach_PostTraining_Standard(PostTraining_Standard entity) - { - this.SendPropertyChanging(); - entity.PostTraining_Role = null; - } } [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.PostTraining_Standard")] @@ -290077,7 +290049,7 @@ namespace Model private string _Code; - private string _RoleId; + private string _WorkPostId; private string _CourseId; @@ -290099,8 +290071,6 @@ namespace Model private EntityRef _PostTraining_Course; - private EntityRef _PostTraining_Role; - private EntityRef _Sys_User; #region 可扩展性方法定义 @@ -290111,8 +290081,8 @@ namespace Model partial void OnIdChanged(); partial void OnCodeChanging(string value); partial void OnCodeChanged(); - partial void OnRoleIdChanging(string value); - partial void OnRoleIdChanged(); + partial void OnWorkPostIdChanging(string value); + partial void OnWorkPostIdChanged(); partial void OnCourseIdChanging(string value); partial void OnCourseIdChanged(); partial void OnClassHourChanging(decimal value); @@ -290136,7 +290106,6 @@ namespace Model public PostTraining_Standard() { this._PostTraining_Course = default(EntityRef); - this._PostTraining_Role = default(EntityRef); this._Sys_User = default(EntityRef); OnCreated(); } @@ -290181,26 +290150,22 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RoleId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] - public string RoleId + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPostId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string WorkPostId { get { - return this._RoleId; + return this._WorkPostId; } set { - if ((this._RoleId != value)) + if ((this._WorkPostId != value)) { - if (this._PostTraining_Role.HasLoadedOrAssignedValue) - { - throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); - } - this.OnRoleIdChanging(value); + this.OnWorkPostIdChanging(value); this.SendPropertyChanging(); - this._RoleId = value; - this.SendPropertyChanged("RoleId"); - this.OnRoleIdChanged(); + this._WorkPostId = value; + this.SendPropertyChanged("WorkPostId"); + this.OnWorkPostIdChanged(); } } } @@ -290427,40 +290392,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_PostTraining_Standard_PostTraining_Role", Storage="_PostTraining_Role", ThisKey="RoleId", OtherKey="Id", IsForeignKey=true)] - public PostTraining_Role PostTraining_Role - { - get - { - return this._PostTraining_Role.Entity; - } - set - { - PostTraining_Role previousValue = this._PostTraining_Role.Entity; - if (((previousValue != value) - || (this._PostTraining_Role.HasLoadedOrAssignedValue == false))) - { - this.SendPropertyChanging(); - if ((previousValue != null)) - { - this._PostTraining_Role.Entity = null; - previousValue.PostTraining_Standard.Remove(this); - } - this._PostTraining_Role.Entity = value; - if ((value != null)) - { - value.PostTraining_Standard.Add(this); - this._RoleId = value.Id; - } - else - { - this._RoleId = default(string); - } - this.SendPropertyChanged("PostTraining_Role"); - } - } - } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_PostTraining_Standard_Sys_User", Storage="_Sys_User", ThisKey="CompileMan", OtherKey="UserId", IsForeignKey=true)] public Sys_User Sys_User { @@ -344940,8 +344871,6 @@ namespace Model private string _States; - private string _PostTrainingRoleId; - private EntitySet _Accident_AccidentPersonRecord; private EntitySet _Accident_AccidentReportOtherItem; @@ -345128,8 +345057,6 @@ namespace Model partial void OnBlackReasonChanged(); partial void OnStatesChanging(string value); partial void OnStatesChanged(); - partial void OnPostTrainingRoleIdChanging(string value); - partial void OnPostTrainingRoleIdChanged(); #endregion public SitePerson_Person() @@ -346495,26 +346422,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PostTrainingRoleId", DbType="NVarChar(50)")] - public string PostTrainingRoleId - { - get - { - return this._PostTrainingRoleId; - } - set - { - if ((this._PostTrainingRoleId != value)) - { - this.OnPostTrainingRoleIdChanging(value); - this.SendPropertyChanging(); - this._PostTrainingRoleId = value; - this.SendPropertyChanged("PostTrainingRoleId"); - this.OnPostTrainingRoleIdChanged(); - } - } - } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Accident_AccidentPersonRecord_SitePerson_Person", Storage="_Accident_AccidentPersonRecord", ThisKey="PersonId", OtherKey="PersonId", DeleteRule="NO ACTION")] public EntitySet Accident_AccidentPersonRecord { @@ -401163,6 +401070,10 @@ namespace Model private string _TestTrainingIds; + private System.Nullable _Durations; + + private string _WorkPostNames; + private EntitySet _Person_TrainingTask; private EntityRef _Training_CompanyTraining; @@ -401191,6 +401102,10 @@ namespace Model partial void OnLearningTimeChanged(); partial void OnTestTrainingIdsChanging(string value); partial void OnTestTrainingIdsChanged(); + partial void OnDurationsChanging(System.Nullable value); + partial void OnDurationsChanged(); + partial void OnWorkPostNamesChanging(string value); + partial void OnWorkPostNamesChanged(); #endregion public Training_CompanyTrainingItem() @@ -401404,6 +401319,46 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Durations", DbType="Float")] + public System.Nullable Durations + { + get + { + return this._Durations; + } + set + { + if ((this._Durations != value)) + { + this.OnDurationsChanging(value); + this.SendPropertyChanging(); + this._Durations = value; + this.SendPropertyChanged("Durations"); + this.OnDurationsChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPostNames", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + public string WorkPostNames + { + get + { + return this._WorkPostNames; + } + set + { + if ((this._WorkPostNames != value)) + { + this.OnWorkPostNamesChanging(value); + this.SendPropertyChanging(); + this._WorkPostNames = value; + this.SendPropertyChanged("WorkPostNames"); + this.OnWorkPostNamesChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Person_TrainingTask_Training_CompanyTrainingItem", Storage="_Person_TrainingTask", ThisKey="CompanyTrainingItemId", OtherKey="CompanyTrainingItemId", DeleteRule="NO ACTION")] public EntitySet Person_TrainingTask { @@ -453008,7 +452963,7 @@ namespace Model private string _PersonName; - private string _RoleName; + private string _WorkPostName; public View_PostTraining_RecordDetail() { @@ -453110,18 +453065,18 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RoleName", DbType="NVarChar(200)")] - public string RoleName + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPostName", DbType="NVarChar(100)")] + public string WorkPostName { get { - return this._RoleName; + return this._WorkPostName; } set { - if ((this._RoleName != value)) + if ((this._WorkPostName != value)) { - this._RoleName = value; + this._WorkPostName = value; } } } @@ -457036,6 +456991,8 @@ namespace Model private string _WorkPostId; + private string _WorkPostName; + private System.Nullable _InTime; private System.Nullable _OutTime; @@ -457074,8 +457031,6 @@ namespace Model private string _WorkAreaName; - private string _WorkPostName; - private string _PositionName; private string _PostTitleName; @@ -457162,10 +457117,6 @@ namespace Model private System.Nullable _LevelValue; - private string _PostTrainingRoleId; - - private string _PostTrainingRoleName; - public View_SitePerson_Person() { } @@ -457378,6 +457329,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPostName", DbType="NVarChar(100)")] + public string WorkPostName + { + get + { + return this._WorkPostName; + } + set + { + if ((this._WorkPostName != value)) + { + this._WorkPostName = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InTime", DbType="DateTime")] public System.Nullable InTime { @@ -457682,22 +457649,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPostName", DbType="NVarChar(100)")] - public string WorkPostName - { - get - { - return this._WorkPostName; - } - set - { - if ((this._WorkPostName != value)) - { - this._WorkPostName = value; - } - } - } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PositionName", DbType="NVarChar(50)")] public string PositionName { @@ -458385,38 +458336,6 @@ namespace Model } } } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PostTrainingRoleId", DbType="NVarChar(50)")] - public string PostTrainingRoleId - { - get - { - return this._PostTrainingRoleId; - } - set - { - if ((this._PostTrainingRoleId != value)) - { - this._PostTrainingRoleId = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PostTrainingRoleName", DbType="NVarChar(200)")] - public string PostTrainingRoleName - { - get - { - return this._PostTrainingRoleName; - } - set - { - if ((this._PostTrainingRoleName != value)) - { - this._PostTrainingRoleName = value; - } - } - } } [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_SitePerson_PersonList")] @@ -458443,8 +458362,6 @@ namespace Model private string _UnitName; - private string _WorkPostName; - private string _WorkAreaName; private string _TeamGroupName; @@ -458461,6 +458378,8 @@ namespace Model private string _WorkPostId; + private string _WorkPostName; + private string _IdcardType; private string _PhotoUrl; @@ -458469,10 +458388,6 @@ namespace Model private string _PoliticsStatusName; - private string _PostTrainingRoleId; - - private string _PostTrainingRoleName; - public View_SitePerson_PersonList() { } @@ -458637,22 +458552,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPostName", DbType="NVarChar(100)")] - public string WorkPostName - { - get - { - return this._WorkPostName; - } - set - { - if ((this._WorkPostName != value)) - { - this._WorkPostName = value; - } - } - } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaName", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] public string WorkAreaName { @@ -458781,6 +458680,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPostName", DbType="NVarChar(100)")] + public string WorkPostName + { + get + { + return this._WorkPostName; + } + set + { + if ((this._WorkPostName != value)) + { + this._WorkPostName = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IdcardType", DbType="NVarChar(50)")] public string IdcardType { @@ -458844,38 +458759,6 @@ namespace Model } } } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PostTrainingRoleId", DbType="NVarChar(50)")] - public string PostTrainingRoleId - { - get - { - return this._PostTrainingRoleId; - } - set - { - if ((this._PostTrainingRoleId != value)) - { - this._PostTrainingRoleId = value; - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PostTrainingRoleName", DbType="NVarChar(200)")] - public string PostTrainingRoleName - { - get - { - return this._PostTrainingRoleName; - } - set - { - if ((this._PostTrainingRoleName != value)) - { - this._PostTrainingRoleName = value; - } - } - } } [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_Solution_LargerHazardListItem")]