76 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			76 lines
		
	
	
		
			3.0 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 DriverPrepareDriverDataService
 | 
						|
    {
 | 
						|
        /// <summary>
 | 
						|
        /// 增加--开车资料收集
 | 
						|
        /// </summary>
 | 
						|
        public static void AddDriverPrepareDriverData(Model.DriverPrepare_DriverData DriverPrepareDriverData)
 | 
						|
        {
 | 
						|
            using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
 | 
						|
            {
 | 
						|
                Model.DriverPrepare_DriverData newDriverData = new Model.DriverPrepare_DriverData();
 | 
						|
                newDriverData.DriverDataId = DriverPrepareDriverData.DriverDataId;
 | 
						|
                newDriverData.ProjectId = DriverPrepareDriverData.ProjectId;
 | 
						|
                newDriverData.Code = DriverPrepareDriverData.Code;
 | 
						|
                newDriverData.DriverDataName = DriverPrepareDriverData.DriverDataName;
 | 
						|
                newDriverData.Remark = DriverPrepareDriverData.Remark;
 | 
						|
 | 
						|
                db.DriverPrepare_DriverData.InsertOnSubmit(newDriverData);
 | 
						|
                db.SubmitChanges();
 | 
						|
            }
 | 
						|
        }
 | 
						|
        /// <summary>
 | 
						|
        /// 修改--开车资料收集
 | 
						|
        /// </summary>
 | 
						|
        public static void UpdateDriverPrepareDriverData(Model.DriverPrepare_DriverData DriverPrepareDriverData)
 | 
						|
        {
 | 
						|
            using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
 | 
						|
            {
 | 
						|
                Model.DriverPrepare_DriverData newDriverData = db.DriverPrepare_DriverData.FirstOrDefault(e => e.DriverDataId == DriverPrepareDriverData.DriverDataId);
 | 
						|
                if (newDriverData != null)
 | 
						|
                {
 | 
						|
                    newDriverData.ProjectId = DriverPrepareDriverData.ProjectId;
 | 
						|
                    newDriverData.Code = DriverPrepareDriverData.Code;
 | 
						|
                    newDriverData.DriverDataName = DriverPrepareDriverData.DriverDataName;
 | 
						|
                    newDriverData.Remark = DriverPrepareDriverData.Remark;
 | 
						|
                }
 | 
						|
                db.SubmitChanges();
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        /// <summary>
 | 
						|
        /// 根据主键删除 开车资料收集
 | 
						|
        /// </summary>
 | 
						|
        /// <param name="DriverDataId"></param>
 | 
						|
        public static void DeleteDriverData(string DriverDataId)
 | 
						|
        {
 | 
						|
            using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
 | 
						|
            {
 | 
						|
                Model.DriverPrepare_DriverData newDriverData = db.DriverPrepare_DriverData.FirstOrDefault(e => e.DriverDataId == DriverDataId);
 | 
						|
                if (newDriverData != null)
 | 
						|
                {
 | 
						|
                    db.DriverPrepare_DriverData.DeleteOnSubmit(newDriverData);
 | 
						|
                    db.SubmitChanges();
 | 
						|
                }
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        /// <summary>
 | 
						|
        /// 详情--开车资料收集
 | 
						|
        /// </summary>
 | 
						|
        public static Model.DriverPrepare_DriverData GetDriverDataById(string DriverDataId)
 | 
						|
        {
 | 
						|
            return Funs.DB.DriverPrepare_DriverData.FirstOrDefault(e => e.DriverDataId == DriverDataId);
 | 
						|
        }
 | 
						|
    }
 | 
						|
    
 | 
						|
}
 |