84 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			84 lines
		
	
	
		
			3.5 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 DriverPrepareTrainPlanService
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 增加--开车资料收集
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        public static void AddDriverPrepareDriverPlan(Model.PersonTrain_TrainPlan DriverPrepareDriverPlan)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Model.PersonTrain_TrainPlan newDriverData = new Model.PersonTrain_TrainPlan();
							 | 
						|||
| 
								 | 
							
								                newDriverData.TrainPlanId = DriverPrepareDriverPlan.TrainPlanId;
							 | 
						|||
| 
								 | 
							
								                newDriverData.ProjectId = DriverPrepareDriverPlan.ProjectId;
							 | 
						|||
| 
								 | 
							
								                newDriverData.PlanName = DriverPrepareDriverPlan.PlanName;
							 | 
						|||
| 
								 | 
							
								                newDriverData.PlanCode = DriverPrepareDriverPlan.PlanCode;
							 | 
						|||
| 
								 | 
							
								                newDriverData.CompileMan = DriverPrepareDriverPlan.CompileMan;
							 | 
						|||
| 
								 | 
							
								                newDriverData.CompileDate = DriverPrepareDriverPlan.CompileDate;
							 | 
						|||
| 
								 | 
							
								                newDriverData.ConfirmDate = DriverPrepareDriverPlan.ConfirmDate;
							 | 
						|||
| 
								 | 
							
								                newDriverData.AttachUrl = DriverPrepareDriverPlan.AttachUrl;
							 | 
						|||
| 
								 | 
							
								                newDriverData.Remark = DriverPrepareDriverPlan.Remark;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                db.PersonTrain_TrainPlan.InsertOnSubmit(newDriverData);
							 | 
						|||
| 
								 | 
							
								                db.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 修改--开车资料收集
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        public static void UpdateDriverPrepareDriverPlan(Model.PersonTrain_TrainPlan DriverPrepareDriverPlan)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Model.PersonTrain_TrainPlan newDriverData = db.PersonTrain_TrainPlan.FirstOrDefault(e => e.TrainPlanId == DriverPrepareDriverPlan.TrainPlanId);
							 | 
						|||
| 
								 | 
							
								                if (newDriverData != null)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    newDriverData.ProjectId = DriverPrepareDriverPlan.ProjectId;
							 | 
						|||
| 
								 | 
							
								                    newDriverData.PlanName = DriverPrepareDriverPlan.PlanName;
							 | 
						|||
| 
								 | 
							
								                    newDriverData.PlanCode = DriverPrepareDriverPlan.PlanCode;
							 | 
						|||
| 
								 | 
							
								                    newDriverData.CompileMan = DriverPrepareDriverPlan.CompileMan;
							 | 
						|||
| 
								 | 
							
								                    newDriverData.CompileDate = DriverPrepareDriverPlan.CompileDate;
							 | 
						|||
| 
								 | 
							
								                    newDriverData.ConfirmDate = DriverPrepareDriverPlan.ConfirmDate;
							 | 
						|||
| 
								 | 
							
								                    newDriverData.AttachUrl = DriverPrepareDriverPlan.AttachUrl;
							 | 
						|||
| 
								 | 
							
								                    newDriverData.Remark = DriverPrepareDriverPlan.Remark;
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                db.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据主键删除 开车资料收集
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="DriverDataId"></param>
							 | 
						|||
| 
								 | 
							
								        public static void DeleteDriverPlan(string TrainPlanId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Model.PersonTrain_TrainPlan newDriverData = db.PersonTrain_TrainPlan.FirstOrDefault(e => e.TrainPlanId == TrainPlanId);
							 | 
						|||
| 
								 | 
							
								                if (newDriverData != null)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    db.PersonTrain_TrainPlan.DeleteOnSubmit(newDriverData);
							 | 
						|||
| 
								 | 
							
								                    db.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 详情--开车资料收集
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        public static Model.PersonTrain_TrainPlan GetDriverPlanById(string TrainPlanId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            return Funs.DB.PersonTrain_TrainPlan.FirstOrDefault(e => e.TrainPlanId == TrainPlanId);
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								    
							 | 
						|||
| 
								 | 
							
								}
							 |