Textbausteine...
This commit is contained in:
@@ -16,21 +16,13 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pDataContract.Name = pEntity.Name;
|
||||
pDataContract.IsOnlyForEmployee = pEntity.IsOnlyForEmployee;
|
||||
pDataContract.IsParent = pEntity.IsParent;
|
||||
pDataContract.IsExpanded = pEntity.IsExpanded;
|
||||
|
||||
if(pEntity.Parent != null)
|
||||
{
|
||||
pDataContract.Parent = MapperFactory.TextModuleDC_TextModule.MapToNewDC(pEntity.Parent);
|
||||
}
|
||||
pDataContract.Parent = pEntity.Parent != null ? MapperFactory.TextModuleDC_TextModule.MapToNewDC(pEntity.Parent) : null;
|
||||
|
||||
if(pEntity.ServiceCategory != null)
|
||||
{
|
||||
pDataContract.ServiceCategory = MapperFactory.ServiceCategoryDC_ServiceCategory.MapToNewDC(pEntity.ServiceCategory);
|
||||
}
|
||||
pDataContract.ServiceCategory = pEntity.ServiceCategory != null ? MapperFactory.ServiceCategoryDC_ServiceCategory.MapToNewDC(pEntity.ServiceCategory) : null;
|
||||
|
||||
if (pEntity.Employee != null)
|
||||
{
|
||||
pDataContract.Employee = MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(pEntity.Employee);
|
||||
}
|
||||
pDataContract.Employee = pEntity.Employee != null ? MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(pEntity.Employee) : null;
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
@@ -45,24 +37,22 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pEntity.Name = pDataContract.Name;
|
||||
pEntity.IsOnlyForEmployee = pDataContract.IsOnlyForEmployee;
|
||||
pEntity.IsParent = pDataContract.IsParent;
|
||||
pEntity.IsExpanded = pDataContract.IsExpanded;
|
||||
|
||||
if(pDataContract.Parent != null)
|
||||
{
|
||||
pEntity.Parent = DAOFactory.GenericDAO.LoadByID<TextModule>(pDataContract.Parent.TextModuleOid.Value);
|
||||
pEntity.Parent = pDataContract.Parent != null ? DAOFactory.GenericDAO.LoadByID<TextModule>(pDataContract.Parent.TextModuleOid.Value) : null;
|
||||
|
||||
}
|
||||
|
||||
if (pDataContract.ServiceCategory != null)
|
||||
if(pDataContract.ServiceCategory != null)
|
||||
{
|
||||
pEntity.ServiceCategory = pDataContract.ServiceCategory.ServiceCategoryOid.HasValue ?
|
||||
DAOFactory.GenericDAO.LoadByID<ServiceCategory>(pDataContract.ServiceCategory.ServiceCategoryOid.Value) :
|
||||
MapperFactory.ServiceCategoryDC_ServiceCategory.MapToNewEntity(pDataContract.ServiceCategory);
|
||||
pEntity.ServiceCategory = pDataContract.ServiceCategory.ServiceCategoryOid.HasValue
|
||||
? DAOFactory.GenericDAO.LoadByID<ServiceCategory>(pDataContract.ServiceCategory.ServiceCategoryOid.Value)
|
||||
: MapperFactory.ServiceCategoryDC_ServiceCategory.MapToNewEntity(pDataContract.ServiceCategory);
|
||||
}
|
||||
else
|
||||
{
|
||||
pEntity.ServiceCategory = null;
|
||||
}
|
||||
|
||||
if (pDataContract.Employee != null)
|
||||
{
|
||||
pEntity.Employee = DAOFactory.GenericDAO.LoadByID<Employee>(pDataContract.Employee.EmployeeOid);
|
||||
}
|
||||
pEntity.Employee = pDataContract.Employee != null ? DAOFactory.GenericDAO.LoadByID<Employee>(pDataContract.Employee.EmployeeOid) : null;
|
||||
|
||||
return pEntity;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user