| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  | using FineUIPro; | 
					
						
							| 
									
										
										
										
											2024-05-23 09:41:47 +08:00
										 |  |  |  | using Model; | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace BLL | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public static class BOSHENGService | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         public static Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 获取单位列表 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 记录数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public static int unitcount | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get; | 
					
						
							|  |  |  |  |             set; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 定义变量 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							| 
									
										
										
										
											2024-05-23 09:41:47 +08:00
										 |  |  |  |         private static IQueryable<Model.Bo_Sheng_Unit> getUnits = from x in db.Bo_Sheng_Unit | 
					
						
							| 
									
										
										
										
											2023-07-29 15:25:17 +08:00
										 |  |  |  |                                                                   where (x.DeleteTag == "False" || x.DeleteTag == null) | 
					
						
							| 
									
										
										
										
											2023-07-24 17:02:32 +08:00
										 |  |  |  |                                                                   select x; | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取分页列表 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="PageIndex">页码</param> | 
					
						
							|  |  |  |  |         /// <param name="PageSize">每页数量</param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public static IEnumerable getUnitListData(string projectId, string departName, string departCode, Grid Grid1) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             IQueryable<Model.Bo_Sheng_Unit> getDataList = getUnits.Where(x => x.ProjectId == projectId); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(departName)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.DepartName.Contains(departName)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(departCode)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.DepartCode.Contains(departCode)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             unitcount = getDataList.Count(); | 
					
						
							|  |  |  |  |             if (unitcount == 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return null; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); | 
					
						
							|  |  |  |  |             return from x in getDataList | 
					
						
							|  |  |  |  |                    select new | 
					
						
							|  |  |  |  |                    { | 
					
						
							|  |  |  |  |                        x.ID, | 
					
						
							|  |  |  |  |                        x.ProjectId, | 
					
						
							|  |  |  |  |                        x.ParentID, | 
					
						
							|  |  |  |  |                        x.DepartCode, | 
					
						
							|  |  |  |  |                        x.ParentCode, | 
					
						
							|  |  |  |  |                        x.DepartName, | 
					
						
							|  |  |  |  |                        x.DepartType, | 
					
						
							|  |  |  |  |                        x.DepartShortName, | 
					
						
							|  |  |  |  |                        x.DepartOrder, | 
					
						
							|  |  |  |  |                        x.State, | 
					
						
							|  |  |  |  |                        x.DepartSir, | 
					
						
							|  |  |  |  |                        x.IsEpiboly, | 
					
						
							|  |  |  |  |                        x.Phone, | 
					
						
							|  |  |  |  |                        x.Charge, | 
					
						
							|  |  |  |  |                        x.Remark, | 
					
						
							|  |  |  |  |                        x.OwnerDeptID, | 
					
						
							|  |  |  |  |                        x.CreateDate, | 
					
						
							|  |  |  |  |                        x.CreateUser, | 
					
						
							|  |  |  |  |                        x.OperDate, | 
					
						
							|  |  |  |  |                        x.OperUser, | 
					
						
							|  |  |  |  |                    }; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 获取人员列表 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 记录数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public static int personcount | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get; | 
					
						
							|  |  |  |  |             set; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 定义变量 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							| 
									
										
										
										
											2023-07-24 17:02:32 +08:00
										 |  |  |  |         private static IQueryable<Model.Bo_Sheng_Person> getPersons = from x in db.Bo_Sheng_Person | 
					
						
							| 
									
										
										
										
											2023-07-29 15:25:17 +08:00
										 |  |  |  |                                                                       where (x.DeleteTag == "False" || x.DeleteTag == null) | 
					
						
							| 
									
										
										
										
											2023-07-24 17:02:32 +08:00
										 |  |  |  |                                                                       select x; | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取分页列表 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="PageIndex">页码</param> | 
					
						
							|  |  |  |  |         /// <param name="PageSize">每页数量</param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public static IEnumerable getPersonListData(string projectId, string departName, string name, string identifyID, Grid Grid1) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             IQueryable<Model.Bo_Sheng_Person> getDataList = getPersons.Where(x => x.ProjectId == projectId); | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(departName)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.DepartName.Contains(departName)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(name)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.Name.Contains(name)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(identifyID)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.IdentifyID == identifyID); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             personcount = getDataList.Count(); | 
					
						
							|  |  |  |  |             if (personcount == 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return null; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             getDataList = SortConditionHelper.SortingAndPaging(getDataList.OrderBy(x => x.DepartName), Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); | 
					
						
							|  |  |  |  |             return from x in getDataList | 
					
						
							|  |  |  |  |                    select new | 
					
						
							|  |  |  |  |                    { | 
					
						
							|  |  |  |  |                        x.ID, | 
					
						
							|  |  |  |  |                        x.ProjectId, | 
					
						
							|  |  |  |  |                        x.CreateDate, | 
					
						
							|  |  |  |  |                        x.CreateUser, | 
					
						
							|  |  |  |  |                        x.OperDate, | 
					
						
							|  |  |  |  |                        x.OperUser, | 
					
						
							|  |  |  |  |                        x.DeleteUser, | 
					
						
							|  |  |  |  |                        x.DeleteDate, | 
					
						
							|  |  |  |  |                        x.DeleteTag, | 
					
						
							|  |  |  |  |                        x.Name, | 
					
						
							|  |  |  |  |                        x.Sex, | 
					
						
							|  |  |  |  |                        SexName = x.Sex == "2" ? "女" : "男", | 
					
						
							|  |  |  |  |                        x.BirthDay, | 
					
						
							|  |  |  |  |                        x.Address, | 
					
						
							|  |  |  |  |                        x.Nation, | 
					
						
							|  |  |  |  |                        x.IdentifyID, | 
					
						
							|  |  |  |  |                        x.Kind, | 
					
						
							|  |  |  |  |                        x.Photo, | 
					
						
							|  |  |  |  |                        x.Police, | 
					
						
							|  |  |  |  |                        x.ValidPeriodStart, | 
					
						
							|  |  |  |  |                        x.ValidPeriodEnd, | 
					
						
							|  |  |  |  |                        x.Education, | 
					
						
							|  |  |  |  |                        x.Native, | 
					
						
							|  |  |  |  |                        x.Telephone, | 
					
						
							|  |  |  |  |                        x.MaritalStatus, | 
					
						
							|  |  |  |  |                        x.BloodGroup, | 
					
						
							|  |  |  |  |                        x.RegisteredType, | 
					
						
							|  |  |  |  |                        x.Age, | 
					
						
							|  |  |  |  |                        x.JobNumber, | 
					
						
							|  |  |  |  |                        x.CardContent, | 
					
						
							|  |  |  |  |                        x.ContactTel, | 
					
						
							|  |  |  |  |                        x.SecondContacts, | 
					
						
							|  |  |  |  |                        x.SecondContactsTel, | 
					
						
							|  |  |  |  |                        x.NewAddress, | 
					
						
							|  |  |  |  |                        x.HealthCondition, | 
					
						
							|  |  |  |  |                        x.HealthFile, | 
					
						
							|  |  |  |  |                        x.BuildArea, | 
					
						
							|  |  |  |  |                        x.TraPrincipal, | 
					
						
							|  |  |  |  |                        x.RegisterDate, | 
					
						
							|  |  |  |  |                        x.CategoryType, | 
					
						
							|  |  |  |  |                        x.Station, | 
					
						
							|  |  |  |  |                        x.Category, | 
					
						
							|  |  |  |  |                        x.CategoryLevel, | 
					
						
							|  |  |  |  |                        x.EntranceDate, | 
					
						
							|  |  |  |  |                        x.IsOut, | 
					
						
							|  |  |  |  |                        IsOutName = x.IsOut == "1" ? "是" : "否", | 
					
						
							|  |  |  |  |                        x.LeaveDate, | 
					
						
							|  |  |  |  |                        x.IsBlackList, | 
					
						
							| 
									
										
										
										
											2024-05-23 09:41:47 +08:00
										 |  |  |  |                        IsBlackListName = x.IsBlackList == "1" ? "是" : "否", | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  |                        x.AgreementId, | 
					
						
							|  |  |  |  |                        x.HasInsurance, | 
					
						
							|  |  |  |  |                        x.DeviceNumber, | 
					
						
							|  |  |  |  |                        x.IsActive, | 
					
						
							|  |  |  |  |                        x.DepartId, | 
					
						
							|  |  |  |  |                        x.DepartName, | 
					
						
							|  |  |  |  |                        x.OwnerDepartId, | 
					
						
							|  |  |  |  |                        x.UploadTime, | 
					
						
							|  |  |  |  |                    }; | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2024-05-23 09:41:47 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 获取培训记录列表 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 记录数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public static int traincount | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get; | 
					
						
							|  |  |  |  |             set; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 定义变量 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							| 
									
										
										
										
											2023-07-24 17:02:32 +08:00
										 |  |  |  |         private static IQueryable<Model.Bo_Sheng_Train> getTrains = from x in db.Bo_Sheng_Train | 
					
						
							| 
									
										
										
										
											2023-07-24 17:08:09 +08:00
										 |  |  |  |                                                                     where (x.DeleteTag == "False" || x.DeleteTag == null) | 
					
						
							| 
									
										
										
										
											2023-07-24 17:02:32 +08:00
										 |  |  |  |                                                                     select x; | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取分页列表 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="PageIndex">页码</param> | 
					
						
							|  |  |  |  |         /// <param name="PageSize">每页数量</param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public static IEnumerable getTrainListData(string projectId, string trainType, string recordName, Grid Grid1) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             IQueryable<Model.Bo_Sheng_Train> getDataList = getTrains.Where(x => x.ProjectId == projectId); | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(trainType)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.TrainType.Contains(trainType)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(recordName)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.RecordName.Contains(recordName)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             traincount = getDataList.Count(); | 
					
						
							|  |  |  |  |             if (traincount == 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return null; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); | 
					
						
							|  |  |  |  |             return from x in getDataList | 
					
						
							|  |  |  |  |                    select new | 
					
						
							|  |  |  |  |                    { | 
					
						
							|  |  |  |  |                        x.ID, | 
					
						
							|  |  |  |  |                        x.ProjectId, | 
					
						
							|  |  |  |  |                        x.DeleteUser, | 
					
						
							|  |  |  |  |                        x.DeleteDate, | 
					
						
							|  |  |  |  |                        x.DeleteTag, | 
					
						
							|  |  |  |  |                        x.RecordName, | 
					
						
							|  |  |  |  |                        x.TrainType, | 
					
						
							|  |  |  |  |                        x.PaperMode, | 
					
						
							| 
									
										
										
										
											2024-05-23 09:41:47 +08:00
										 |  |  |  |                        PaperModeName = x.PaperMode == "0" ? "使用原卷" : "重新出卷", | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  |                        x.TrainMode, | 
					
						
							|  |  |  |  |                        x.TrainPrincipal, | 
					
						
							|  |  |  |  |                        x.TrainStartDate, | 
					
						
							|  |  |  |  |                        x.TrainEndDate, | 
					
						
							|  |  |  |  |                        x.TrainContent, | 
					
						
							|  |  |  |  |                        x.TrainDescript, | 
					
						
							|  |  |  |  |                        x.TrainPeriod, | 
					
						
							|  |  |  |  |                        x.PersonCount, | 
					
						
							|  |  |  |  |                        x.PassedCount, | 
					
						
							|  |  |  |  |                        x.CoverImg, | 
					
						
							|  |  |  |  |                        x.DemandID, | 
					
						
							|  |  |  |  |                        x.CourseCount, | 
					
						
							|  |  |  |  |                        x.CourseDuration, | 
					
						
							|  |  |  |  |                        x.Source, | 
					
						
							|  |  |  |  |                        SourceName = x.Source == "0" ? "项目" : "课程", | 
					
						
							|  |  |  |  |                        x.Description, | 
					
						
							|  |  |  |  |                        x.DeviceNo, | 
					
						
							|  |  |  |  |                        x.OwnerDepartId, | 
					
						
							|  |  |  |  |                        x.UploadTime, | 
					
						
							|  |  |  |  |                        x.OwnerDeptName, | 
					
						
							|  |  |  |  |                        x.TrainDepart, | 
					
						
							|  |  |  |  |                        x.CreateDate, | 
					
						
							|  |  |  |  |                        x.CreateUser, | 
					
						
							|  |  |  |  |                        x.OperDate, | 
					
						
							|  |  |  |  |                        x.OperUser, | 
					
						
							|  |  |  |  |                    }; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 获取培训人员列表 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 记录数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public static int trainPersoncount | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get; | 
					
						
							|  |  |  |  |             set; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 定义变量 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							| 
									
										
										
										
											2023-07-24 17:02:32 +08:00
										 |  |  |  |         private static IQueryable<Model.Bo_Sheng_TrainPerson> getTrainPersons = from x in db.Bo_Sheng_TrainPerson | 
					
						
							| 
									
										
										
										
											2023-07-24 17:08:09 +08:00
										 |  |  |  |                                                                                 where (x.DeleteTag == "False" || x.DeleteTag == null) | 
					
						
							| 
									
										
										
										
											2023-07-24 17:02:32 +08:00
										 |  |  |  |                                                                                 select x; | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取分页列表 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="PageIndex">页码</param> | 
					
						
							|  |  |  |  |         /// <param name="PageSize">每页数量</param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2024-05-23 09:41:47 +08:00
										 |  |  |  |         public static IEnumerable getTrainPersonListData(string projectId, string departName, string name, string identifyID, Grid Grid1) | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  |         { | 
					
						
							|  |  |  |  |             IQueryable<Model.Bo_Sheng_TrainPerson> getDataList = getTrainPersons.Where(x => x.ProjectId == projectId); | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(departName)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.DepartName.Contains(departName)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(name)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.EmpName.Contains(name)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(identifyID)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.IdentifyId.Contains(identifyID)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             trainPersoncount = getDataList.Count(); | 
					
						
							|  |  |  |  |             if (trainPersoncount == 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return null; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); | 
					
						
							|  |  |  |  |             return from x in getDataList | 
					
						
							|  |  |  |  |                    select new | 
					
						
							|  |  |  |  |                    { | 
					
						
							|  |  |  |  |                        x.ID, | 
					
						
							|  |  |  |  |                        x.ProjectId, | 
					
						
							|  |  |  |  |                        x.DeleteUser, | 
					
						
							|  |  |  |  |                        x.DeleteDate, | 
					
						
							|  |  |  |  |                        x.DeleteTag, | 
					
						
							|  |  |  |  |                        x.EmpName, | 
					
						
							|  |  |  |  |                        x.IdentifyId, | 
					
						
							|  |  |  |  |                        x.Photo, | 
					
						
							|  |  |  |  |                        x.Station, | 
					
						
							|  |  |  |  |                        x.Category, | 
					
						
							|  |  |  |  |                        x.CategoryName, | 
					
						
							|  |  |  |  |                        x.RecordId, | 
					
						
							|  |  |  |  |                        x.SignName, | 
					
						
							|  |  |  |  |                        x.DepartId, | 
					
						
							|  |  |  |  |                        x.DepartName, | 
					
						
							|  |  |  |  |                        x.SignInDate, | 
					
						
							|  |  |  |  |                        x.SignInType, | 
					
						
							|  |  |  |  |                        x.TrainPeriod, | 
					
						
							|  |  |  |  |                        x.State, | 
					
						
							| 
									
										
										
										
											2024-05-23 09:41:47 +08:00
										 |  |  |  |                        StateName = x.State == "0" ? "正常" : "补签", | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  |                        x.TotalScore, | 
					
						
							|  |  |  |  |                        x.PassScore, | 
					
						
							|  |  |  |  |                        x.Score, | 
					
						
							|  |  |  |  |                        x.IsPass, | 
					
						
							|  |  |  |  |                        IsPassName = x.IsPass == "0" ? "否" : "是", | 
					
						
							|  |  |  |  |                        x.GroupNo, | 
					
						
							|  |  |  |  |                        x.ExamNo, | 
					
						
							|  |  |  |  |                        x.ExamCount, | 
					
						
							|  |  |  |  |                        x.DeviceNo, | 
					
						
							|  |  |  |  |                        x.OwnerDepartId, | 
					
						
							|  |  |  |  |                        x.UploadTime, | 
					
						
							|  |  |  |  |                        x.Answers, | 
					
						
							|  |  |  |  |                        x.CreateDate, | 
					
						
							|  |  |  |  |                        x.CreateUser, | 
					
						
							|  |  |  |  |                        x.OperDate, | 
					
						
							|  |  |  |  |                        x.OperUser, | 
					
						
							|  |  |  |  |                    }; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 获取试卷列表 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 记录数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public static int examcount | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get; | 
					
						
							|  |  |  |  |             set; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 定义变量 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							| 
									
										
										
										
											2024-05-23 09:41:47 +08:00
										 |  |  |  |         private static IQueryable<Model.Bo_Sheng_Exam> getExams = from x in db.Bo_Sheng_Exam | 
					
						
							|  |  |  |  |                                                                   where (x.DeleteTag == "False" || x.DeleteTag == null) | 
					
						
							| 
									
										
										
										
											2023-07-24 17:02:32 +08:00
										 |  |  |  |                                                                   select x; | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取分页列表 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="PageIndex">页码</param> | 
					
						
							|  |  |  |  |         /// <param name="PageSize">每页数量</param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2024-05-23 09:41:47 +08:00
										 |  |  |  |         public static IEnumerable getExamListData(string projectId, string qsnCode, string qsnContent, Grid Grid1) | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  |         { | 
					
						
							|  |  |  |  |             IQueryable<Model.Bo_Sheng_Exam> getDataList = getExams.Where(x => x.ProjectId == projectId); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(qsnCode)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.QsnCode == qsnCode); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(qsnContent)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.QsnContent.Contains(qsnContent)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             examcount = getDataList.Count(); | 
					
						
							|  |  |  |  |             if (examcount == 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return null; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); | 
					
						
							|  |  |  |  |             return from x in getDataList | 
					
						
							|  |  |  |  |                    select new | 
					
						
							|  |  |  |  |                    { | 
					
						
							|  |  |  |  |                        x.ID, | 
					
						
							|  |  |  |  |                        x.ProjectId, | 
					
						
							|  |  |  |  |                        x.RecordId, | 
					
						
							|  |  |  |  |                        x.ExamNo, | 
					
						
							|  |  |  |  |                        x.GroupNo, | 
					
						
							|  |  |  |  |                        x.CourseID, | 
					
						
							|  |  |  |  |                        x.COrder, | 
					
						
							|  |  |  |  |                        x.QsnCode, | 
					
						
							|  |  |  |  |                        x.QsnId, | 
					
						
							|  |  |  |  |                        x.QsnContent, | 
					
						
							|  |  |  |  |                        x.QsnFileName, | 
					
						
							|  |  |  |  |                        x.QsnAnswer, | 
					
						
							|  |  |  |  |                        x.QsnCategory, | 
					
						
							| 
									
										
										
										
											2024-05-23 09:41:47 +08:00
										 |  |  |  |                        QsnCategoryName = x.QsnCategory == "3" ? "图片题" : (x.QsnCategory == "2" ? "多媒体题" : "文字题"), | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  |                        x.QsnKind, | 
					
						
							|  |  |  |  |                        QsnKindName = x.QsnKind == "3" ? "判断" : (x.QsnCategory == "2" ? "多选" : "单选"), | 
					
						
							|  |  |  |  |                        x.QsnImportant, | 
					
						
							|  |  |  |  |                        QsnImportantName = x.QsnImportant == "2" ? "困难" : (x.QsnCategory == "1" ? "一般" : "容易"), | 
					
						
							|  |  |  |  |                        x.Description, | 
					
						
							|  |  |  |  |                        x.Analysis, | 
					
						
							|  |  |  |  |                        x.UploadTime, | 
					
						
							|  |  |  |  |                    }; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 获取人员培训记录列表 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 记录数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public static int personTrainRecordcount | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get; | 
					
						
							|  |  |  |  |             set; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 定义变量 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							| 
									
										
										
										
											2024-05-23 09:41:47 +08:00
										 |  |  |  |         private static IQueryable<Model.Bo_Sheng_PersonTrainRecord> getPersonTrainRecords = from x in db.Bo_Sheng_PersonTrainRecord | 
					
						
							|  |  |  |  |                                                                                             where (x.DeleteTag == "False" || x.DeleteTag == null) | 
					
						
							| 
									
										
										
										
											2023-07-24 17:02:32 +08:00
										 |  |  |  |                                                                                             select x; | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取分页列表 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="PageIndex">页码</param> | 
					
						
							|  |  |  |  |         /// <param name="PageSize">每页数量</param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public static IEnumerable getPersonTrainRecordListData(string projectId, string departName, string name, string identifyID, Grid Grid1) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             IQueryable<Model.Bo_Sheng_PersonTrainRecord> getDataList = getPersonTrainRecords.Where(x => x.ProjectId == projectId); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(name)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.EmpName.Contains(name)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(departName)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.DepartName.Contains(departName)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(identifyID)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 getDataList = getDataList.Where(x => x.IdentifyId.Contains(identifyID)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             personTrainRecordcount = getDataList.Count(); | 
					
						
							|  |  |  |  |             if (personTrainRecordcount == 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return null; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); | 
					
						
							|  |  |  |  |             return from x in getDataList | 
					
						
							|  |  |  |  |                    select new | 
					
						
							|  |  |  |  |                    { | 
					
						
							|  |  |  |  |                        x.ID, | 
					
						
							|  |  |  |  |                        x.ProjectId, | 
					
						
							|  |  |  |  |                        x.EmpName, | 
					
						
							|  |  |  |  |                        x.IdentifyId, | 
					
						
							|  |  |  |  |                        x.CategoryName, | 
					
						
							|  |  |  |  |                        x.RecordId, | 
					
						
							|  |  |  |  |                        x.DepartId, | 
					
						
							|  |  |  |  |                        x.DepartName, | 
					
						
							|  |  |  |  |                        x.TrainPeriod, | 
					
						
							|  |  |  |  |                        x.TotalScore, | 
					
						
							|  |  |  |  |                        x.PassScore, | 
					
						
							|  |  |  |  |                        x.Score, | 
					
						
							|  |  |  |  |                        x.IsPass, | 
					
						
							|  |  |  |  |                        IsPassName = x.IsPass == "0" ? "否" : "是", | 
					
						
							|  |  |  |  |                        x.GroupNo, | 
					
						
							|  |  |  |  |                        x.ExamNo, | 
					
						
							|  |  |  |  |                        x.ExamCount, | 
					
						
							|  |  |  |  |                        x.DeviceNo, | 
					
						
							|  |  |  |  |                        x.OwnerDepartId, | 
					
						
							|  |  |  |  |                        x.Answers, | 
					
						
							|  |  |  |  |                        x.RecordName, | 
					
						
							|  |  |  |  |                        x.TrainType, | 
					
						
							|  |  |  |  |                        x.PaperMode, | 
					
						
							|  |  |  |  |                        PaperModeName = x.PaperMode == "0" ? "使用原卷" : "重新出卷", | 
					
						
							|  |  |  |  |                        x.TrainMode, | 
					
						
							|  |  |  |  |                        x.TrainPrincipal, | 
					
						
							|  |  |  |  |                        x.TrainStartDate, | 
					
						
							|  |  |  |  |                        x.TrainEndDate, | 
					
						
							|  |  |  |  |                        x.TrainContent, | 
					
						
							|  |  |  |  |                        x.TrainDescript, | 
					
						
							|  |  |  |  |                    }; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							| 
									
										
										
										
											2024-05-23 09:41:47 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 根据主键获取博晟人员信息 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="id"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public static Model.Bo_Sheng_Person GetBoPersonById(string id) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             return Funs.DB.Bo_Sheng_Person.FirstOrDefault(e => e.ID == id); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 修改博晟人员信息 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="person"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public static void UpdateBoPerson(Bo_Sheng_Person person) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Model.Bo_Sheng_Person newPerson = Funs.DB.Bo_Sheng_Person.FirstOrDefault(e => e.ID == person.ID); | 
					
						
							|  |  |  |  |             if (newPerson != null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 newPerson.Name = person.Name; | 
					
						
							|  |  |  |  |                 newPerson.DepartName = person.DepartName; | 
					
						
							|  |  |  |  |                 newPerson.IdentifyID = person.IdentifyID; | 
					
						
							|  |  |  |  |                 newPerson.Sex = person.Sex; | 
					
						
							|  |  |  |  |                 newPerson.BirthDay = person.BirthDay; | 
					
						
							|  |  |  |  |                 newPerson.Station = person.Station; | 
					
						
							|  |  |  |  |                 newPerson.Address = person.Address; | 
					
						
							|  |  |  |  |                 newPerson.Police = person.Police; | 
					
						
							|  |  |  |  |                 newPerson.ValidPeriodStart = person.ValidPeriodStart; | 
					
						
							|  |  |  |  |                 newPerson.ValidPeriodEnd = person.ValidPeriodEnd; | 
					
						
							|  |  |  |  |                 newPerson.Telephone = person.Telephone; | 
					
						
							|  |  |  |  |                 newPerson.JobNumber = person.JobNumber; | 
					
						
							|  |  |  |  |                 newPerson.NewAddress = person.NewAddress; | 
					
						
							|  |  |  |  |                 newPerson.RegisterDate = person.RegisterDate; | 
					
						
							|  |  |  |  |                 newPerson.CategoryLevel = person.CategoryLevel; | 
					
						
							|  |  |  |  |                 newPerson.EntranceDate = person.EntranceDate; | 
					
						
							|  |  |  |  |                 newPerson.LeaveDate = person.LeaveDate; | 
					
						
							|  |  |  |  |                 newPerson.IsOut = person.IsOut; | 
					
						
							|  |  |  |  |                 newPerson.IsBlackList = person.IsBlackList; | 
					
						
							|  |  |  |  |                 newPerson.UploadTime = person.UploadTime; | 
					
						
							|  |  |  |  |                 Funs.DB.SubmitChanges(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2021-12-07 16:34:32 +08:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | } |