using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BLL { public class DriverPrepareSchemePlanService { /// /// 增加--开车资料收集 /// public static void AddDriverPrepareDriverPlan(Model.DriverPrepare_SchemePlan DriverPrepareDriverPlan) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { Model.DriverPrepare_SchemePlan newDriverData = new Model.DriverPrepare_SchemePlan(); newDriverData.SchemePlanId = DriverPrepareDriverPlan.SchemePlanId; newDriverData.ProjectId = DriverPrepareDriverPlan.ProjectId; newDriverData.SchemePlanName = DriverPrepareDriverPlan.SchemePlanName; newDriverData.SchemePlanCode = DriverPrepareDriverPlan.SchemePlanCode; newDriverData.CompileMan = DriverPrepareDriverPlan.CompileMan; newDriverData.CompileDate = DriverPrepareDriverPlan.CompileDate; newDriverData.AttachUrl = DriverPrepareDriverPlan.AttachUrl; newDriverData.Remark = DriverPrepareDriverPlan.Remark; db.DriverPrepare_SchemePlan.InsertOnSubmit(newDriverData); db.SubmitChanges(); } } /// /// 修改--开车资料收集 /// public static void UpdateDriverPrepareDriverPlan(Model.DriverPrepare_SchemePlan DriverPrepareDriverPlan) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { Model.DriverPrepare_SchemePlan newDriverData = db.DriverPrepare_SchemePlan.FirstOrDefault(e => e.SchemePlanId == DriverPrepareDriverPlan.SchemePlanId); if (newDriverData != null) { newDriverData.ProjectId = DriverPrepareDriverPlan.ProjectId; newDriverData.SchemePlanName = DriverPrepareDriverPlan.SchemePlanName; newDriverData.SchemePlanCode = DriverPrepareDriverPlan.SchemePlanCode; newDriverData.CompileMan = DriverPrepareDriverPlan.CompileMan; newDriverData.CompileDate = DriverPrepareDriverPlan.CompileDate; newDriverData.AttachUrl = DriverPrepareDriverPlan.AttachUrl; newDriverData.Remark = DriverPrepareDriverPlan.Remark; } db.SubmitChanges(); } } /// /// 根据主键删除 开车资料收集 /// /// public static void DeleteDriverPlan(string SchemePlanId) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { Model.DriverPrepare_SchemePlan newDriverData = db.DriverPrepare_SchemePlan.FirstOrDefault(e => e.SchemePlanId == SchemePlanId); if (newDriverData != null) { db.DriverPrepare_SchemePlan.DeleteOnSubmit(newDriverData); db.SubmitChanges(); } } } /// /// 详情--开车资料收集 /// public static Model.DriverPrepare_SchemePlan GetDriverPlanById(string SchemePlanId) { return Funs.DB.DriverPrepare_SchemePlan.FirstOrDefault(e => e.SchemePlanId == SchemePlanId); } } }