20250704 项目单位重复

This commit is contained in:
毕文静 2025-07-04 10:49:21 +08:00
parent 3f34ab5da2
commit b9817b23df
1 changed files with 13 additions and 9 deletions

View File

@ -259,6 +259,9 @@ namespace BLL
if (unitItemList.Count > 0) if (unitItemList.Count > 0)
{ {
foreach (var item in unitItemList) foreach (var item in unitItemList)
{
var projectUnit = from x in Funs.DB.Project_Unit where x.ProjectId == projectid && x.UnitId == item.UnitId select x;
if (projectUnit == null)
{ {
var pUnit = new Model.Project_Unit(); var pUnit = new Model.Project_Unit();
pUnit.ProjectUnitId = Guid.NewGuid().ToString(); pUnit.ProjectUnitId = Guid.NewGuid().ToString();
@ -274,6 +277,7 @@ namespace BLL
} }
} }
} }
}
//添加 //添加
Funs.DB.Project_User.InsertAllOnSubmit(AddProject_UserList); Funs.DB.Project_User.InsertAllOnSubmit(AddProject_UserList);