2024-01-25 15:21:19 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace BLL
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 开车保运计划
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class DriverRunPlanService
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据主键获取开车保运计划
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="driverRunPlanId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static Model.DriverRun_DriverRunPlan GetDriverRunPlanById(string driverRunPlanId)
|
|
|
|
|
{
|
|
|
|
|
return Funs.DB.DriverRun_DriverRunPlan.FirstOrDefault(e => e.DriverRunPlanId == driverRunPlanId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 添加开车保运计划
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="driverRunPlan"></param>
|
|
|
|
|
public static void AddDriverRunPlan(Model.DriverRun_DriverRunPlan driverRunPlan)
|
|
|
|
|
{
|
|
|
|
|
Model.DriverRun_DriverRunPlan newDriverRunPlan = new Model.DriverRun_DriverRunPlan();
|
|
|
|
|
newDriverRunPlan.DriverRunPlanId = driverRunPlan.DriverRunPlanId;
|
|
|
|
|
newDriverRunPlan.Code = driverRunPlan.Code;
|
|
|
|
|
newDriverRunPlan.ProjectId = driverRunPlan.ProjectId;
|
|
|
|
|
newDriverRunPlan.UnitId = driverRunPlan.UnitId;
|
|
|
|
|
newDriverRunPlan.EnterpriseDescription = driverRunPlan.EnterpriseDescription;
|
|
|
|
|
newDriverRunPlan.DriverRunPerformance = driverRunPlan.DriverRunPerformance;
|
|
|
|
|
newDriverRunPlan.TeamworkHistory = driverRunPlan.TeamworkHistory;
|
|
|
|
|
newDriverRunPlan.InstallationId = driverRunPlan.InstallationId;
|
|
|
|
|
newDriverRunPlan.InstallationNames = driverRunPlan.InstallationNames;
|
|
|
|
|
newDriverRunPlan.IsAcceptInvite = driverRunPlan.IsAcceptInvite;
|
|
|
|
|
newDriverRunPlan.AttachUrl = driverRunPlan.AttachUrl;
|
|
|
|
|
newDriverRunPlan.EstimatedInsuredPersonNum = driverRunPlan.EstimatedInsuredPersonNum;
|
|
|
|
|
newDriverRunPlan.GuaranteedOperationPeriod = driverRunPlan.GuaranteedOperationPeriod;
|
|
|
|
|
newDriverRunPlan.TotalGuaranteedOperationDays = driverRunPlan.TotalGuaranteedOperationDays;
|
|
|
|
|
newDriverRunPlan.Remark = driverRunPlan.Remark;
|
|
|
|
|
Funs.DB.DriverRun_DriverRunPlan.InsertOnSubmit(newDriverRunPlan);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 修改开车保运计划
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="driverRunPlan"></param>
|
|
|
|
|
public static void UpdateDriverRunPlan(Model.DriverRun_DriverRunPlan driverRunPlan)
|
|
|
|
|
{
|
|
|
|
|
Model.DriverRun_DriverRunPlan newDriverRunPlan = Funs.DB.DriverRun_DriverRunPlan.FirstOrDefault(e => e.DriverRunPlanId == driverRunPlan.DriverRunPlanId);
|
|
|
|
|
if (newDriverRunPlan != null)
|
|
|
|
|
{
|
|
|
|
|
newDriverRunPlan.Code = driverRunPlan.Code;
|
|
|
|
|
newDriverRunPlan.ProjectId = driverRunPlan.ProjectId;
|
|
|
|
|
newDriverRunPlan.UnitId = driverRunPlan.UnitId;
|
|
|
|
|
newDriverRunPlan.EnterpriseDescription = driverRunPlan.EnterpriseDescription;
|
|
|
|
|
newDriverRunPlan.DriverRunPerformance = driverRunPlan.DriverRunPerformance;
|
|
|
|
|
newDriverRunPlan.TeamworkHistory = driverRunPlan.TeamworkHistory;
|
|
|
|
|
newDriverRunPlan.InstallationId = driverRunPlan.InstallationId;
|
|
|
|
|
newDriverRunPlan.InstallationNames = driverRunPlan.InstallationNames;
|
|
|
|
|
newDriverRunPlan.IsAcceptInvite = driverRunPlan.IsAcceptInvite;
|
|
|
|
|
newDriverRunPlan.AttachUrl = driverRunPlan.AttachUrl;
|
|
|
|
|
newDriverRunPlan.EstimatedInsuredPersonNum = driverRunPlan.EstimatedInsuredPersonNum;
|
|
|
|
|
newDriverRunPlan.GuaranteedOperationPeriod = driverRunPlan.GuaranteedOperationPeriod;
|
|
|
|
|
newDriverRunPlan.TotalGuaranteedOperationDays = driverRunPlan.TotalGuaranteedOperationDays;
|
|
|
|
|
newDriverRunPlan.Remark = driverRunPlan.Remark;
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据主键删除开车保运计划
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="driverRunPlanId"></param>
|
|
|
|
|
public static void DeleteDriverRunPlanById(string driverRunPlanId)
|
|
|
|
|
{
|
|
|
|
|
Model.DriverRun_DriverRunPlan newDriverRunPlan = Funs.DB.DriverRun_DriverRunPlan.FirstOrDefault(e => e.DriverRunPlanId == driverRunPlanId);
|
|
|
|
|
if (newDriverRunPlan != null)
|
|
|
|
|
{
|
2024-01-31 16:32:26 +08:00
|
|
|
|
////删除附件表
|
|
|
|
|
BLL.CommonService.DeleteAttachFileById(newDriverRunPlan.DriverRunPlanId);
|
|
|
|
|
BLL.CommonService.DeleteAttachFileById(newDriverRunPlan.DriverRunPlanId + "K");
|
2024-01-25 15:21:19 +08:00
|
|
|
|
Funs.DB.DriverRun_DriverRunPlan.DeleteOnSubmit(newDriverRunPlan);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|