88 lines
		
	
	
		
			4.1 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			88 lines
		
	
	
		
			4.1 KiB
		
	
	
	
		
			C#
		
	
	
	
|  | using System; | |||
|  | using System.Collections; | |||
|  | using System.Collections.Generic; | |||
|  | using System.Linq; | |||
|  | using System.Text; | |||
|  | using System.Threading.Tasks; | |||
|  | 
 | |||
|  | namespace BLL | |||
|  | { | |||
|  |     public class DriverPrepareDriverPersonPlanService | |||
|  |     { | |||
|  |         /// <summary> | |||
|  |         /// 增加--开车资料收集 | |||
|  |         /// </summary> | |||
|  |         public static void AddDriverPrepareDriverPlan(Model.DriverPrepare_DriverPersonPlan DriverPrepareDriverPlan) | |||
|  |         { | |||
|  |             using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) | |||
|  |             { | |||
|  |                 Model.DriverPrepare_DriverPersonPlan newDriverData = new Model.DriverPrepare_DriverPersonPlan(); | |||
|  |                 newDriverData.DriverPersonPlanId = DriverPrepareDriverPlan.DriverPersonPlanId; | |||
|  |                 newDriverData.ProjectId = DriverPrepareDriverPlan.ProjectId; | |||
|  |                 newDriverData.DriverPersonPlanName = DriverPrepareDriverPlan.DriverPersonPlanName; | |||
|  |                 newDriverData.DriverPersonPlanCode = DriverPrepareDriverPlan.DriverPersonPlanCode; | |||
|  |                 newDriverData.CompileMan = DriverPrepareDriverPlan.CompileMan; | |||
|  |                 newDriverData.SubmitDate = DriverPrepareDriverPlan.SubmitDate; | |||
|  |                 newDriverData.Audit = DriverPrepareDriverPlan.Audit; | |||
|  |                 newDriverData.Approve = DriverPrepareDriverPlan.Approve; | |||
|  |                 newDriverData.ApproveDate = DriverPrepareDriverPlan.ApproveDate; | |||
|  |                 newDriverData.AttachUrl = DriverPrepareDriverPlan.AttachUrl; | |||
|  |                 newDriverData.Remark = DriverPrepareDriverPlan.Remark; | |||
|  | 
 | |||
|  |                 db.DriverPrepare_DriverPersonPlan.InsertOnSubmit(newDriverData); | |||
|  |                 db.SubmitChanges(); | |||
|  |             } | |||
|  |         } | |||
|  |         /// <summary> | |||
|  |         /// 修改--开车资料收集 | |||
|  |         /// </summary> | |||
|  |         public static void UpdateDriverPrepareDriverPlan(Model.DriverPrepare_DriverPersonPlan DriverPrepareDriverPlan) | |||
|  |         { | |||
|  |             using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) | |||
|  |             { | |||
|  |                 Model.DriverPrepare_DriverPersonPlan newDriverData = db.DriverPrepare_DriverPersonPlan.FirstOrDefault(e => e.DriverPersonPlanId == DriverPrepareDriverPlan.DriverPersonPlanId); | |||
|  |                 if (newDriverData != null) | |||
|  |                 { | |||
|  |                     newDriverData.ProjectId = DriverPrepareDriverPlan.ProjectId; | |||
|  |                     newDriverData.DriverPersonPlanName = DriverPrepareDriverPlan.DriverPersonPlanName; | |||
|  |                     newDriverData.DriverPersonPlanCode = DriverPrepareDriverPlan.DriverPersonPlanCode; | |||
|  |                     newDriverData.CompileMan = DriverPrepareDriverPlan.CompileMan; | |||
|  |                     newDriverData.SubmitDate = DriverPrepareDriverPlan.SubmitDate; | |||
|  |                     newDriverData.Audit = DriverPrepareDriverPlan.Audit; | |||
|  |                     newDriverData.Approve = DriverPrepareDriverPlan.Approve; | |||
|  |                     newDriverData.ApproveDate = DriverPrepareDriverPlan.ApproveDate; | |||
|  |                     newDriverData.AttachUrl = DriverPrepareDriverPlan.AttachUrl; | |||
|  |                     newDriverData.Remark = DriverPrepareDriverPlan.Remark; | |||
|  |                 } | |||
|  |                 db.SubmitChanges(); | |||
|  |             } | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 根据主键删除 开车资料收集 | |||
|  |         /// </summary> | |||
|  |         /// <param name="DriverDataId"></param> | |||
|  |         public static void DeleteDriverPlan(string DriverPersonPlanId) | |||
|  |         { | |||
|  |             using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) | |||
|  |             { | |||
|  |                 Model.DriverPrepare_DriverPersonPlan newDriverData = db.DriverPrepare_DriverPersonPlan.FirstOrDefault(e => e.DriverPersonPlanId == DriverPersonPlanId); | |||
|  |                 if (newDriverData != null) | |||
|  |                 { | |||
|  |                     db.DriverPrepare_DriverPersonPlan.DeleteOnSubmit(newDriverData); | |||
|  |                     db.SubmitChanges(); | |||
|  |                 } | |||
|  |             } | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 详情--开车资料收集 | |||
|  |         /// </summary> | |||
|  |         public static Model.DriverPrepare_DriverPersonPlan GetDriverPlanById(string DriverPersonPlanId) | |||
|  |         { | |||
|  |             return Funs.DB.DriverPrepare_DriverPersonPlan.FirstOrDefault(e => e.DriverPersonPlanId == DriverPersonPlanId); | |||
|  |         } | |||
|  |     } | |||
|  |      | |||
|  | } |