122 lines
		
	
	
		
			6.8 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			122 lines
		
	
	
		
			6.8 KiB
		
	
	
	
		
			C#
		
	
	
	
|  | using System; | |||
|  | using System.Collections.Generic; | |||
|  | using System.Linq; | |||
|  | using System.Text; | |||
|  | using System.Threading.Tasks; | |||
|  | using System.Web.UI.WebControls; | |||
|  | 
 | |||
|  | namespace BLL | |||
|  | { | |||
|  |     /// <summary> | |||
|  |     /// 施工标准规范 | |||
|  |     /// </summary> | |||
|  |     public static class ConstructionStandardListService | |||
|  |     {  | |||
|  |         /// <summary> | |||
|  |       /// 根据标准规范清单Id获取一个标准规范清单信息 | |||
|  |       /// </summary> | |||
|  |       /// <param name="standardCode">标准规范清单Id</param> | |||
|  |       /// <returns>一个标准规范清单实体</returns> | |||
|  |         public static Model.CQMS_Law_ConstructionStandardList GetConstructionStandardListByStandardCode(int standardCode) | |||
|  |         { | |||
|  |             return Funs.DB.CQMS_Law_ConstructionStandardList.FirstOrDefault(x => x.StandardCode == standardCode); | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 查询的标准规范信息的数量 | |||
|  |         /// </summary> | |||
|  |         /// <returns>标准规范信息的数量</returns> | |||
|  |         public static int GetCountConstructionStandardList() | |||
|  |         { | |||
|  |             return (from x in Funs.DB.CQMS_Law_ConstructionStandardList select x).Count(); | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 查询最大的标准规范序号 | |||
|  |         /// </summary> | |||
|  |         /// <returns>最大的标准规范序号</returns> | |||
|  |         public static int GetMaxStandardCode() | |||
|  |         { | |||
|  |             return (from x in Funs.DB.CQMS_Law_ConstructionStandardList select x.StandardCode).Max(); | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 增加标准规范清单信息 | |||
|  |         /// </summary> | |||
|  |         /// <param name="ConstructionStandardList">标准规范清单实体</param> | |||
|  |         public static void AddConstructionStandardList(Model.CQMS_Law_ConstructionStandardList ConstructionStandardList) | |||
|  |         { | |||
|  |             Model.CQMS_Law_ConstructionStandardList newConstructionStandardList = new Model.CQMS_Law_ConstructionStandardList(); | |||
|  |             newConstructionStandardList.StandardCode = ConstructionStandardList.StandardCode; | |||
|  |             newConstructionStandardList.StandardGrade = ConstructionStandardList.StandardGrade; | |||
|  |             newConstructionStandardList.StandardNo = ConstructionStandardList.StandardNo; | |||
|  |             newConstructionStandardList.StandardName = ConstructionStandardList.StandardName; | |||
|  |             newConstructionStandardList.AttachUrl = ConstructionStandardList.AttachUrl; | |||
|  |             newConstructionStandardList.Memo = ConstructionStandardList.Memo; | |||
|  |             newConstructionStandardList.Status = ConstructionStandardList.Status; | |||
|  |             newConstructionStandardList.ImpDate = ConstructionStandardList.ImpDate; | |||
|  |             newConstructionStandardList.PubDate = ConstructionStandardList.PubDate; | |||
|  |             newConstructionStandardList.UseLevel = ConstructionStandardList.UseLevel; | |||
|  |             newConstructionStandardList.StandardType = ConstructionStandardList.StandardType; | |||
|  |             newConstructionStandardList.ReplaceStandard = ConstructionStandardList.ReplaceStandard; | |||
|  |             newConstructionStandardList.IsSelected1 = ConstructionStandardList.IsSelected1; | |||
|  |             newConstructionStandardList.IsSelected2 = ConstructionStandardList.IsSelected2; | |||
|  |             newConstructionStandardList.IsSelected3 = ConstructionStandardList.IsSelected3; | |||
|  |             newConstructionStandardList.IsSelected4 = ConstructionStandardList.IsSelected4; | |||
|  |             newConstructionStandardList.IsSelected5 = ConstructionStandardList.IsSelected5; | |||
|  |             newConstructionStandardList.IsSelected6 = ConstructionStandardList.IsSelected6; | |||
|  |             newConstructionStandardList.IsSelected7 = ConstructionStandardList.IsSelected7; | |||
|  |             newConstructionStandardList.IsSelected8 = ConstructionStandardList.IsSelected8; | |||
|  |             newConstructionStandardList.IsSelected9 = ConstructionStandardList.IsSelected9; | |||
|  |             newConstructionStandardList.IsSelected10 = ConstructionStandardList.IsSelected10; | |||
|  | 
 | |||
|  |             Funs.DB.CQMS_Law_ConstructionStandardList.InsertOnSubmit(newConstructionStandardList); | |||
|  |             Funs.DB.SubmitChanges(); | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 修改标准规范清单信息 | |||
|  |         /// </summary> | |||
|  |         /// <param name="ConstructionStandardList">标准规范清单实体</param> | |||
|  |         public static void UpdateConstructionStandardList(Model.CQMS_Law_ConstructionStandardList ConstructionStandardList) | |||
|  |         { | |||
|  |             Model.CQMS_Law_ConstructionStandardList newConstructionStandardList = Funs.DB.CQMS_Law_ConstructionStandardList.FirstOrDefault(e => e.StandardCode == ConstructionStandardList.StandardCode); | |||
|  |             if (newConstructionStandardList != null) | |||
|  |             { | |||
|  |                 newConstructionStandardList.StandardGrade = ConstructionStandardList.StandardGrade; | |||
|  |                 newConstructionStandardList.StandardNo = ConstructionStandardList.StandardNo; | |||
|  |                 newConstructionStandardList.StandardName = ConstructionStandardList.StandardName; | |||
|  |                 newConstructionStandardList.AttachUrl = ConstructionStandardList.AttachUrl; | |||
|  |                 newConstructionStandardList.Memo = ConstructionStandardList.Memo; | |||
|  |                 newConstructionStandardList.Status = ConstructionStandardList.Status; | |||
|  |                 newConstructionStandardList.ImpDate = ConstructionStandardList.ImpDate; | |||
|  |                 newConstructionStandardList.PubDate = ConstructionStandardList.PubDate; | |||
|  |                 newConstructionStandardList.UseLevel = ConstructionStandardList.UseLevel; | |||
|  |                 newConstructionStandardList.StandardType = ConstructionStandardList.StandardType; | |||
|  |                 newConstructionStandardList.ReplaceStandard = ConstructionStandardList.ReplaceStandard; | |||
|  |                 newConstructionStandardList.IsSelected1 = ConstructionStandardList.IsSelected1; | |||
|  |                 newConstructionStandardList.IsSelected2 = ConstructionStandardList.IsSelected2; | |||
|  |                 newConstructionStandardList.IsSelected3 = ConstructionStandardList.IsSelected3; | |||
|  |                 newConstructionStandardList.IsSelected4 = ConstructionStandardList.IsSelected4; | |||
|  |                 newConstructionStandardList.IsSelected5 = ConstructionStandardList.IsSelected5; | |||
|  |                 newConstructionStandardList.IsSelected6 = ConstructionStandardList.IsSelected6; | |||
|  |                 Funs.DB.SubmitChanges(); | |||
|  |             } | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 根据标准规范清单Id删除一个标准规范清单信息 | |||
|  |         /// </summary> | |||
|  |         /// <param name="standardCode">标准规范清单Id</param> | |||
|  |         public static void DeleteConstructionStandardList(int standardCode) | |||
|  |         { | |||
|  |             Model.CQMS_Law_ConstructionStandardList ConstructionStandardList = Funs.DB.CQMS_Law_ConstructionStandardList.FirstOrDefault(e => e.StandardCode == standardCode); | |||
|  |             if (ConstructionStandardList != null) | |||
|  |             { | |||
|  |                 Funs.DB.CQMS_Law_ConstructionStandardList.DeleteOnSubmit(ConstructionStandardList); | |||
|  |                 Funs.DB.SubmitChanges(); | |||
|  |             } | |||
|  |         }         | |||
|  |     } | |||
|  | } |