| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections; | 
					
						
							|  |  |  |  | using System.Diagnostics.CodeAnalysis; | 
					
						
							|  |  |  |  | using System.Globalization; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Data.Linq; | 
					
						
							|  |  |  |  | using System.Web.Security; | 
					
						
							|  |  |  |  | using System.Web.UI.WebControls; | 
					
						
							|  |  |  |  | using Model; | 
					
						
							|  |  |  |  | using BLL; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace BLL | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public class CnProfessionInitService | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 根据专业Id获取专业信息 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="unitProjectId">专业Id</param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public static Model.WBS_CnProfessionInit GetCnProfessionInitByCnProfessionId(string cnProfessionId) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             return Funs.DB.WBS_CnProfessionInit.FirstOrDefault(e => e.CnProfessionId.ToString() == cnProfessionId); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 增加专业 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="user">专业</param> | 
					
						
							|  |  |  |  |         //public static void AddCnProfessionInit(Model.WBS_CnProfessionInit cnProfessionInit) | 
					
						
							|  |  |  |  |         //{ | 
					
						
							|  |  |  |  |         //    Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  |         //    Model.WBS_CnProfessionInit newCnP = new Model.WBS_CnProfessionInit(); | 
					
						
							|  |  |  |  |         //    newCnP.CnProfessionId = SQLHelper.GetNewID(typeof(Model.WBS_CnProfessionInit)); | 
					
						
							|  |  |  |  |         //    newCnP.CnProfessionName = cnProfessionInit.CnProfessionName; | 
					
						
							|  |  |  |  |         //    newCnP.CnProfessionCode = cnProfessionInit.CnProfessionCode; | 
					
						
							|  |  |  |  |         //    newCnP.InstallationId = cnProfessionInit.InstallationId; | 
					
						
							|  |  |  |  |         //    newCnP.ProjectId = cnProfessionInit.ProjectId; | 
					
						
							|  |  |  |  |         //    newCnP.StartDate = cnProfessionInit.StartDate; | 
					
						
							|  |  |  |  |         //    newCnP.EndDate = cnProfessionInit.EndDate; | 
					
						
							|  |  |  |  |         //    newCnP.Weights = cnProfessionInit.Weights; | 
					
						
							|  |  |  |  |         //    newCnP.OldId = cnProfessionInit.OldId; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         //    db.WBS_CnProfessionInit.InsertOnSubmit(newCnP); | 
					
						
							|  |  |  |  |         //    db.SubmitChanges(); | 
					
						
							|  |  |  |  |         //} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 修改专业 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="user">专业</param> | 
					
						
							|  |  |  |  |         public static void UpdateCnProfession(Model.WBS_CnProfessionInit cnProfessionInit) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  |             Model.WBS_CnProfessionInit newCnP = db.WBS_CnProfessionInit.First(e => e.CnProfessionId == cnProfessionInit.CnProfessionId); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             newCnP.CnProfessionName = cnProfessionInit.CnProfessionName; | 
					
						
							|  |  |  |  |             newCnP.CnProfessionCode = cnProfessionInit.CnProfessionCode; | 
					
						
							|  |  |  |  |             newCnP.ToCNLaw = cnProfessionInit.ToCNLaw; | 
					
						
							|  |  |  |  |             newCnP.SortIndex = cnProfessionInit.SortIndex; | 
					
						
							|  |  |  |  |             db.SubmitChanges(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 根据Id删除专业信息 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="userId"></param> | 
					
						
							|  |  |  |  |         public static void DeleteCnProfessionInit(string cnProfessionId) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  |             Model.WBS_CnProfessionInit CnP = db.WBS_CnProfessionInit.First(e => e.CnProfessionId.ToString() == cnProfessionId); | 
					
						
							|  |  |  |  |             db.WBS_CnProfessionInit.DeleteOnSubmit(CnP); | 
					
						
							|  |  |  |  |             db.SubmitChanges(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取专业下拉选项 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public static List<Model.WBS_CnProfessionInit> GetCnProfessionInitDropDownList() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             var list = (from x in Funs.DB.WBS_CnProfessionInit orderby x.CnProfessionId select x).ToList(); | 
					
						
							|  |  |  |  |             return list; | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2023-06-19 10:20:55 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 专业下拉框 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="dropName">下拉框名字</param> | 
					
						
							|  |  |  |  |         /// <param name="projectId">项目id</param> | 
					
						
							|  |  |  |  |         /// <param name="isShowPlease">是否显示请选择</param> | 
					
						
							|  |  |  |  |         public static void InitCnProfessionInitDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             dropName.DataValueField = "CnProfessionId"; | 
					
						
							|  |  |  |  |             dropName.DataTextField = "CnProfessionName"; | 
					
						
							|  |  |  |  |             dropName.DataSource = GetCnProfessionInitDropDownList(); | 
					
						
							|  |  |  |  |             dropName.DataBind(); | 
					
						
							|  |  |  |  |             if (isShowPlease) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Funs.FineUIPleaseSelect(dropName); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2021-04-30 10:28:37 +08:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | } |