2024-01-26 开车分包管理修改
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -17,6 +18,16 @@ namespace BLL
|
||||
return Funs.DB.DriverSub_DriverSubContact.FirstOrDefault(e => e.DriverSubContactId == DriverSubContactId);
|
||||
}
|
||||
|
||||
public static List<Model.DriverSub_DriverSubContact> GetDriverSubContactByProjectid(string projectId)
|
||||
{
|
||||
return Funs.DB.DriverSub_DriverSubContact.Where(e => e.ProjectId == projectId).ToList();
|
||||
}
|
||||
|
||||
public static List<Model.DriverSub_DriverSubContact> GetDriverSubContactByDriverSubPlanId(
|
||||
string DriverSubPlanId)
|
||||
{
|
||||
return Funs.DB.DriverSub_DriverSubContact.Where(e => e.DriverSubPlanId == DriverSubPlanId).ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加开车分包联络信息
|
||||
/// </summary>
|
||||
@@ -36,6 +47,9 @@ namespace BLL
|
||||
newDriverSubContact.OutTime = DriverSubContact.OutTime;
|
||||
newDriverSubContact.AttachUrl = DriverSubContact.AttachUrl;
|
||||
newDriverSubContact.Remark = DriverSubContact.Remark;
|
||||
newDriverSubContact.DriverSubPlanId= DriverSubContact.DriverSubPlanId;
|
||||
newDriverSubContact.DriverSubContractorsId = DriverSubContact.DriverSubContractorsId;
|
||||
newDriverSubContact.SubcontractingType = DriverSubContact.SubcontractingType;
|
||||
Funs.DB.DriverSub_DriverSubContact.InsertOnSubmit(newDriverSubContact);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
@@ -59,6 +73,9 @@ namespace BLL
|
||||
newDriverSubContact.OutTime = DriverSubContact.OutTime;
|
||||
newDriverSubContact.AttachUrl = DriverSubContact.AttachUrl;
|
||||
newDriverSubContact.Remark = DriverSubContact.Remark;
|
||||
newDriverSubContact.DriverSubPlanId = DriverSubContact.DriverSubPlanId;
|
||||
newDriverSubContact.DriverSubContractorsId = DriverSubContact.DriverSubContractorsId;
|
||||
newDriverSubContact.SubcontractingType = DriverSubContact.SubcontractingType;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
@@ -80,5 +97,22 @@ namespace BLL
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteDriverSubContactByDriverSubPlanId(string DriverSubPlanId)
|
||||
{
|
||||
List<Model.DriverSub_DriverSubContact> DriverSubContact = Funs.DB.DriverSub_DriverSubContact.Where(e => e.DriverSubPlanId == DriverSubPlanId).ToList();
|
||||
if (DriverSubContact != null)
|
||||
{
|
||||
foreach (var item in DriverSubContact)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.AttachUrl))
|
||||
{
|
||||
BLL.UploadAttachmentService.DeleteFile(Funs.RootPath, item.AttachUrl);//删除附件
|
||||
}
|
||||
Funs.DB.DriverSub_DriverSubContact.DeleteOnSubmit(item);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user