| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Text; | 
					
						
							|  |  |  |  | using System.Threading.Tasks; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace BLL | 
					
						
							|  |  |  |  | { | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |     public static class GJSXService | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |     { | 
					
						
							|  |  |  |  |         public static Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 根据主键获取信息 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="groupId"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public static Model.GJSX GetGJSXById(string _GJSXID) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             return Funs.DB.GJSX.FirstOrDefault(e => e.GJSXID == _GJSXID); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 添加 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="?"></param> | 
					
						
							|  |  |  |  |         public static void AddGJSX(Model.GJSX _GJSX) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  |             Model.GJSX newGJSX = new Model.GJSX | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |                 GJSXID = _GJSX.GJSXID, | 
					
						
							|  |  |  |  |                 Detail = _GJSX.Detail, | 
					
						
							|  |  |  |  |                 UserID = _GJSX.UserID, | 
					
						
							|  |  |  |  |                 CreateDate = _GJSX.CreateDate, | 
					
						
							|  |  |  |  |                 User_ReceiveID = _GJSX.User_ReceiveID, | 
					
						
							|  |  |  |  |                 CNProfessional_ID = _GJSX.CNProfessional_ID, | 
					
						
							|  |  |  |  |                 ProjectId = _GJSX.ProjectId, | 
					
						
							|  |  |  |  |                 UnitId = _GJSX.UnitId, | 
					
						
							|  |  |  |  |                 CloseDate = _GJSX.CloseDate, | 
					
						
							|  |  |  |  |                 State = _GJSX.State, | 
					
						
							|  |  |  |  |                 QuestionTypeID = _GJSX.QuestionTypeID, | 
					
						
							|  |  |  |  |                 GJSXTypeId = _GJSX.GJSXTypeId, | 
					
						
							|  |  |  |  |                 IsManypeople = _GJSX.IsManypeople, | 
					
						
							|  |  |  |  |                 CompleteDate = _GJSX.CompleteDate, | 
					
						
							|  |  |  |  |                 AttachUrl = _GJSX.AttachUrl, | 
					
						
							|  |  |  |  |                 User_Acceptance = _GJSX.User_Acceptance, | 
					
						
							|  |  |  |  |                 ProgressStatus = _GJSX.ProgressStatus, | 
					
						
							| 
									
										
										
										
											2024-10-12 15:27:37 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |                 CsUsers = _GJSX.CsUsers | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |             }; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             db.GJSX.InsertOnSubmit(newGJSX); | 
					
						
							|  |  |  |  |             db.SubmitChanges(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 修改 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="teamGroup"></param> | 
					
						
							|  |  |  |  |         public static void UpdateGJSX(Model.GJSX _GJSX) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  |             Model.GJSX newGJSX = db.GJSX.FirstOrDefault(e => e.GJSXID == _GJSX.GJSXID); | 
					
						
							|  |  |  |  |             if (newGJSX != null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 newGJSX.GJSXID = _GJSX.GJSXID; | 
					
						
							|  |  |  |  |                 newGJSX.Detail = _GJSX.Detail; | 
					
						
							| 
									
										
										
										
											2025-03-24 14:21:16 +08:00
										 |  |  |  |                 //newGJSX.UserID = _GJSX.UserID; | 
					
						
							|  |  |  |  |                 //newGJSX.CreateDate = _GJSX.CreateDate; | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |                 newGJSX.User_ReceiveID = _GJSX.User_ReceiveID; | 
					
						
							|  |  |  |  |                 newGJSX.CNProfessional_ID = _GJSX.CNProfessional_ID; | 
					
						
							|  |  |  |  |                 newGJSX.ProjectId = _GJSX.ProjectId; | 
					
						
							|  |  |  |  |                 newGJSX.UnitId = _GJSX.UnitId; | 
					
						
							|  |  |  |  |                 newGJSX.CloseDate = _GJSX.CloseDate; | 
					
						
							|  |  |  |  |                 newGJSX.State = _GJSX.State; | 
					
						
							|  |  |  |  |                 newGJSX.QuestionTypeID = _GJSX.QuestionTypeID; | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |                 newGJSX.GJSXTypeId = _GJSX.GJSXTypeId; | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |                 newGJSX.IsManypeople = _GJSX.IsManypeople; | 
					
						
							|  |  |  |  |                 newGJSX.CompleteDate = _GJSX.CompleteDate; | 
					
						
							|  |  |  |  |                 newGJSX.AttachUrl = _GJSX.AttachUrl; | 
					
						
							|  |  |  |  |                 newGJSX.User_Acceptance = _GJSX.User_Acceptance; | 
					
						
							| 
									
										
										
										
											2024-10-12 15:27:37 +08:00
										 |  |  |  |                 newGJSX.CsUsers = _GJSX.CsUsers; | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |                 newGJSX.ProgressStatus = _GJSX.ProgressStatus; | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |                 db.SubmitChanges(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 根据主键删除信息 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_GJSXID"></param> | 
					
						
							|  |  |  |  |         public static void DeleteGJSXById(string _GJSXID) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  |             Model.GJSX _GJSX = db.GJSX.FirstOrDefault(e => e.GJSXID == _GJSXID); | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 db.GJSX.DeleteOnSubmit(_GJSX); | 
					
						
							|  |  |  |  |                 db.SubmitChanges(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private static int count; | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |         public static System.Collections.IEnumerable GetListData(string projectId) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |             IQueryable<Model.GJSX> q = GetGJSXList().AsQueryable(); | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(projectId)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 q = q.Where(e => e.ProjectId == projectId); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             count = q.Count(); | 
					
						
							|  |  |  |  |             if (count == 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return new object[] { "" }; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             return from x in q | 
					
						
							|  |  |  |  |                    select new | 
					
						
							|  |  |  |  |                    { | 
					
						
							|  |  |  |  |                        x.GJSXID, | 
					
						
							|  |  |  |  |                        x.Detail, | 
					
						
							|  |  |  |  |                        tcr = (from y in db.Sys_User where y.UserId == x.UserID select y.UserName).First(), | 
					
						
							|  |  |  |  |                        x.CreateDate, | 
					
						
							|  |  |  |  |                        zrr = (from y in db.Sys_User where y.UserId == x.UserID select y.UserName).First(), | 
					
						
							|  |  |  |  |                        regipient = x.GJSXID, | 
					
						
							|  |  |  |  |                        qrr = (from y in db.Sys_User where y.UserId == x.UserID select y.UserName).First(), | 
					
						
							|  |  |  |  |                        sjqrr = (from y in db.Sys_User where y.UserId == x.UserID select y.UserName).First(), | 
					
						
							|  |  |  |  |                        x.CNProfessional_ID, | 
					
						
							|  |  |  |  |                        AffprojectId = (from y in db.Base_Project where y.ProjectId == x.ProjectId select y.ProjectName).First(), | 
					
						
							|  |  |  |  |                        unit = (from y in db.Base_Unit where y.UnitId == x.UnitId select y.UnitName).First(), | 
					
						
							|  |  |  |  |                        x.CloseDate, | 
					
						
							|  |  |  |  |                        x.State, | 
					
						
							|  |  |  |  |                        x.QuestionTypeID, | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |                        x.GJSXTypeId, | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |                        x.CompleteDate, | 
					
						
							|  |  |  |  |                        x.AttachUrl, | 
					
						
							|  |  |  |  |                        x.User_Acceptance | 
					
						
							|  |  |  |  |                        //Acceptance = (from y in db.Sys_User where y.UserId == x.Acceptance select y.UserName).FirstOrDefault() | 
					
						
							|  |  |  |  |                    }; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 根据项目Id,获取关键事项责任人list | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="projectId"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public static List<string> GetGJSXUserList(string projectId) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             var list = (from x in Funs.DB.GJSX where x.ProjectId == projectId select x.User_Acceptance).Distinct().ToList(); | 
					
						
							|  |  |  |  |             return list; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取问题下拉项 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public static List<Model.GJSX> GetGJSXList() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             var list = (from x in Funs.DB.GJSX orderby x.QuestionTypeID select x).ToList(); | 
					
						
							|  |  |  |  |             return list; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///  类型表下拉框 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="dropName">下拉框名字</param> | 
					
						
							|  |  |  |  |         /// <param name="isShowPlease">是否显示请选择</param> | 
					
						
							|  |  |  |  |         public static void InitQuestionTypeDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             dropName.DataValueField = "GJSXID"; | 
					
						
							|  |  |  |  |             dropName.DataTextField = "QuestionTypeName"; | 
					
						
							|  |  |  |  |             dropName.DataSource = GetGJSXList(); | 
					
						
							|  |  |  |  |             dropName.DataBind(); | 
					
						
							|  |  |  |  |             if (isShowPlease) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Funs.FineUIPleaseSelect(dropName); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         //public static Model.GJSX GetQuestionTypeByName(string name) | 
					
						
							|  |  |  |  |         //{ | 
					
						
							|  |  |  |  |         //    return Funs.DB.GJSX.FirstOrDefault(e => e.QuestionTypeName == name); | 
					
						
							|  |  |  |  |         //} | 
					
						
							|  |  |  |  |         ///// <summary> | 
					
						
							|  |  |  |  |         ///// 根据工程类别获取专项方案类别下拉项 | 
					
						
							|  |  |  |  |         ///// </summary> | 
					
						
							|  |  |  |  |         ///// <returns></returns> | 
					
						
							|  |  |  |  |         //public static List<Model.GJSX> GetQuestionTypeByTempleteList(string ProjectId) | 
					
						
							|  |  |  |  |         //{ | 
					
						
							|  |  |  |  |         //    var list = (from x in Funs.DB.GJSX where x.ProjectId == ProjectId orderby x.QuestionTypeCode select x).ToList(); | 
					
						
							|  |  |  |  |         //    return list; | 
					
						
							|  |  |  |  |         //} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         ///// <summary> | 
					
						
							|  |  |  |  |         /////  类型表下拉框 | 
					
						
							|  |  |  |  |         ///// </summary> | 
					
						
							|  |  |  |  |         ///// <param name="dropName">下拉框名字</param> | 
					
						
							|  |  |  |  |         ///// <param name="isShowPlease">是否显示请选择</param> | 
					
						
							|  |  |  |  |         //public static void InitQuestionTypeByTempleteDropDownList(FineUIPro.DropDownList dropName, string ProjectId, bool isShowPlease) | 
					
						
							|  |  |  |  |         //{ | 
					
						
							|  |  |  |  |         //    dropName.DataValueField = "GJSXID"; | 
					
						
							|  |  |  |  |         //    dropName.DataTextField = "QuestionTypeName"; | 
					
						
							|  |  |  |  |         //    dropName.DataSource = GetQuestionTypeByTempleteList(ProjectId); | 
					
						
							|  |  |  |  |         //    dropName.DataBind(); | 
					
						
							|  |  |  |  |         //    if (isShowPlease) | 
					
						
							|  |  |  |  |         //    { | 
					
						
							|  |  |  |  |         //        Funs.FineUIPleaseSelect(dropName); | 
					
						
							|  |  |  |  |         //    } | 
					
						
							|  |  |  |  |         //} | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |