2017-09-26 13:30:20 +02:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
2018-01-05 19:13:18 -04:00
|
|
|
|
|
2017-09-26 13:30:20 +02:00
|
|
|
|
using BS.Shared.DataContracts;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BeWo.ViewModel.ListViewModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public class TextModuleListVM : AbstractDCListMapperVM<TextModuleDC, TextModuleVM>
|
|
|
|
|
|
{
|
|
|
|
|
|
public static string PropertyName_PossibleCategories = "PossibleCategories";
|
|
|
|
|
|
public static string PropertyName_PossibleTextModuleParents = "PossibleTextModuleParents";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private readonly List<ServiceCategoryDC> _PossibleCategories;
|
|
|
|
|
|
private readonly List<TextModuleVM> _PossibleTextModuleParents;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TextModuleListVM(IEnumerable<TextModuleDC> pDataContracts, List<ServiceCategoryDC> pPossibleCategories) : base(pDataContracts)
|
|
|
|
|
|
{
|
|
|
|
|
|
_PossibleCategories = pPossibleCategories;
|
|
|
|
|
|
_PossibleTextModuleParents = VMList.Where(w => w.IsParent).ToList();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IEnumerable<ServiceCategoryDC> PossibleCategories => _PossibleCategories;
|
|
|
|
|
|
|
|
|
|
|
|
public IEnumerable<TextModuleVM> PossibleTextModuleParents => _PossibleTextModuleParents;
|
2018-01-16 17:11:02 +01:00
|
|
|
|
|
|
|
|
|
|
public IEnumerable<TextModuleVM> GetTextModuleParents(TextModuleVM textModule)
|
|
|
|
|
|
{
|
|
|
|
|
|
return _PossibleTextModuleParents.Except(new List<TextModuleVM> {textModule});
|
|
|
|
|
|
}
|
2017-09-26 13:30:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|