80 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			80 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			C#
		
	
	
	
|  | using System; | |||
|  | using System.Collections.Generic; | |||
|  | using System.Linq; | |||
|  | using System.Text; | |||
|  | using System.Threading.Tasks; | |||
|  | 
 | |||
|  | namespace BLL | |||
|  | { | |||
|  |     public class RotatingEquipmentService | |||
|  |     { | |||
|  |         /// <summary> | |||
|  |         /// 根据主键获取设备材料报验信息 | |||
|  |         /// </summary> | |||
|  |         /// <param name="RotatingEquipmentId"></param> | |||
|  |         /// <returns></returns> | |||
|  |         public static Model.Transfer_RotatingEquipment GetRotatingEquipmentById(string Id) | |||
|  |         { | |||
|  |             return Funs.DB.Transfer_RotatingEquipment.FirstOrDefault(e => e.Id == Id); | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 添加设备材料报验 | |||
|  |         /// </summary> | |||
|  |         /// <param name="RotatingEquipment"></param> | |||
|  |         public static void AddRotatingEquipment(Model.Transfer_RotatingEquipment RotatingEquipment) | |||
|  |         { | |||
|  |             Model.SGGLDB db = Funs.DB; | |||
|  |             Model.Transfer_RotatingEquipment newRotatingEquipment = new Model.Transfer_RotatingEquipment(); | |||
|  |             newRotatingEquipment.Id = RotatingEquipment.Id; | |||
|  |             newRotatingEquipment.ProjectId = RotatingEquipment.ProjectId; | |||
|  |             newRotatingEquipment.RotatingEquipment = RotatingEquipment.RotatingEquipment; | |||
|  |             newRotatingEquipment.SYSTEM = RotatingEquipment.SYSTEM; | |||
|  |             newRotatingEquipment.Subsystem = RotatingEquipment.Subsystem; | |||
|  |             newRotatingEquipment.TestPackage = RotatingEquipment.TestPackage; | |||
|  |             newRotatingEquipment.TestPackageSTART = RotatingEquipment.TestPackageSTART; | |||
|  |             newRotatingEquipment.TestPackageFINISH = RotatingEquipment.TestPackageFINISH; | |||
|  |             newRotatingEquipment.MechanicalFINALStatus = RotatingEquipment.MechanicalFINALStatus; | |||
|  |             db.Transfer_RotatingEquipment.InsertOnSubmit(newRotatingEquipment); | |||
|  |             db.SubmitChanges(); | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 修改设备材料报验 | |||
|  |         /// </summary> | |||
|  |         /// <param name="RotatingEquipment"></param> | |||
|  |         public static void UpdateRotatingEquipment(Model.Transfer_RotatingEquipment RotatingEquipment) | |||
|  |         { | |||
|  |             Model.SGGLDB db = Funs.DB; | |||
|  |             Model.Transfer_RotatingEquipment newRotatingEquipment = db.Transfer_RotatingEquipment.FirstOrDefault(e => e.Id == RotatingEquipment.Id); | |||
|  |             if (newRotatingEquipment != null) | |||
|  |             { | |||
|  |                 newRotatingEquipment.ProjectId = RotatingEquipment.ProjectId; | |||
|  |                 newRotatingEquipment.RotatingEquipment = RotatingEquipment.RotatingEquipment; | |||
|  |                 newRotatingEquipment.SYSTEM = RotatingEquipment.SYSTEM; | |||
|  |                 newRotatingEquipment.Subsystem = RotatingEquipment.Subsystem; | |||
|  |                 newRotatingEquipment.TestPackage = RotatingEquipment.TestPackage; | |||
|  |                 newRotatingEquipment.TestPackageSTART = RotatingEquipment.TestPackageSTART; | |||
|  |                 newRotatingEquipment.TestPackageFINISH = RotatingEquipment.TestPackageFINISH; | |||
|  |                 newRotatingEquipment.MechanicalFINALStatus = RotatingEquipment.MechanicalFINALStatus; | |||
|  |                 db.SubmitChanges(); | |||
|  |             } | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 根据主键删除设备材料报验 | |||
|  |         /// </summary> | |||
|  |         /// <param name="Id"></param> | |||
|  |         public static void DeleteRotatingEquipment(string Id) | |||
|  |         { | |||
|  |             Model.SGGLDB db = Funs.DB; | |||
|  |             Model.Transfer_RotatingEquipment RotatingEquipment = db.Transfer_RotatingEquipment.FirstOrDefault(e => e.Id == Id); | |||
|  |             if (RotatingEquipment != null) | |||
|  |             { | |||
|  |                 db.Transfer_RotatingEquipment.DeleteOnSubmit(RotatingEquipment); | |||
|  |                 db.SubmitChanges(); | |||
|  |             } | |||
|  |         } | |||
|  |     } | |||
|  | } |