KI Promptbausteine: Parent mit mappen

This commit is contained in:
2025-12-09 20:52:27 +01:00
parent 73dc59927e
commit 464cfd4eca

View File

@@ -74,10 +74,14 @@ namespace BeWo.Service.DCEntityMapper
dataContract.Name = entity.Name;
dataContract.IsOnlyForEmployee = entity.IsOnlyForEmployee;
dataContract.ActivationType = entity.IsActive;
dataContract.IsParent = entity.IsParent;
if (entity.Employee != null)
dataContract.Employee = MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(entity.Employee);
if (entity.Parent != null)
dataContract.Parent = MapperFactory.AiPromptbausteinDC_AiPromptbaustein.MapToNewDC(entity.Parent);
return dataContract;
}
@@ -91,11 +95,13 @@ namespace BeWo.Service.DCEntityMapper
entity.Name = dataContract.Name;
entity.IsOnlyForEmployee = dataContract.IsOnlyForEmployee;
entity.IsActive = dataContract.ActivationType;
entity.IsParent = dataContract.IsParent;
if (dataContract.Employee != null)
{
entity.Employee = DAOFactory.GenericDAO.LoadByID<Employee>(dataContract.Employee.EmployeeOid);
}
if (dataContract.Parent != null)
entity.Parent = DAOFactory.GenericDAO.LoadByID<AiPromptbaustein>(dataContract.Parent.Oid.Value);
return entity;
}