public void SetValues( IEnumerable<WorkflowType> workflowTypes )
{
var workflowTypeList = workflowTypes.ToList();
if ( workflowTypeList.Any() )
{
var ids = new List<string>();
var names = new List<string>();
var parentCategoryIds = string.Empty;
foreach ( var workflowType in workflowTypeList )
{
if ( workflowType != null )
{
ids.Add( workflowType.Id.ToString() );
names.Add( workflowType.Name );
var parentCategory = workflowType.Category;
while ( parentCategory != null )
{
parentCategoryIds += parentCategory.Id.ToString() + ",";
parentCategory = parentCategory.ParentCategory;
}
}
}
InitialItemParentIds = parentCategoryIds.TrimEnd( new[] { ',' } );
ItemIds = ids;
ItemNames = names;
}
else
{
ItemId = Constants.None.IdValue;
ItemName = Constants.None.TextHtml;
}
}