20250704 项目单位重复
This commit is contained in:
parent
3f34ab5da2
commit
b9817b23df
|
@ -260,17 +260,21 @@ namespace BLL
|
|||
{
|
||||
foreach (var item in unitItemList)
|
||||
{
|
||||
var pUnit = new Model.Project_Unit();
|
||||
pUnit.ProjectUnitId = Guid.NewGuid().ToString();
|
||||
pUnit.ProjectId = projectid;
|
||||
pUnit.UnitId = item.UnitId;
|
||||
//单位类型
|
||||
var bresult = bUnit.FirstOrDefault(x => x.UnitId == item.UnitId && x.UnitType != null && x.UnitType != "");
|
||||
if (bresult != null)
|
||||
var projectUnit = from x in Funs.DB.Project_Unit where x.ProjectId == projectid && x.UnitId == item.UnitId select x;
|
||||
if (projectUnit == null)
|
||||
{
|
||||
pUnit.UnitType = bresult.UnitType;
|
||||
var pUnit = new Model.Project_Unit();
|
||||
pUnit.ProjectUnitId = Guid.NewGuid().ToString();
|
||||
pUnit.ProjectId = projectid;
|
||||
pUnit.UnitId = item.UnitId;
|
||||
//单位类型
|
||||
var bresult = bUnit.FirstOrDefault(x => x.UnitId == item.UnitId && x.UnitType != null && x.UnitType != "");
|
||||
if (bresult != null)
|
||||
{
|
||||
pUnit.UnitType = bresult.UnitType;
|
||||
}
|
||||
AddProject_Unit.Add(pUnit);
|
||||
}
|
||||
AddProject_Unit.Add(pUnit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue