Files
BeWoPlaner/BeWo/Core/SupportConceptGoalTreeItem.cs
Lyndon 68925d074f Kalender: Rechteprüfung überarbeitet. Aufgaben in den Kalender integriert.
Verwaltung: Notizen bei den Maßnahmen hinzugefügt
2019-02-28 12:38:29 +01:00

92 lines
2.4 KiB
C#

using System.ComponentModel;
using BS.Shared;
using BeWo.ViewModel;
using BS.Shared.DataContracts.ClientPartials;
namespace BeWo.Core
{
public class SupportConceptGoalTreeItem : SupportConceptGoalDC
{
private ValueListEntryVM _GoalEntryVM;
private BindingList<SupportConceptGoalTreeItem> _Children;
public ValueListEntryVM GoalEntryVM
{
get
{
return _GoalEntryVM;
}
set
{
_GoalEntryVM = value;
}
}
public string ItemName
{
get => _GoalEntryVM != null ? _GoalEntryVM.Description : GoalEntryDC?.TypeDescription;
set
{
if (_GoalEntryVM != null)
{
_GoalEntryVM.Description = value;
}
if (GoalEntryDC != null)
{
GoalEntryDC.TypeDescription = value;
}
}
}
public string Notice
{
get => _GoalEntryVM != null ? _GoalEntryVM.Notice : GoalEntryDC?.Notice;
set
{
if(_GoalEntryVM != null)
{
_GoalEntryVM.Notice = value;
}
if(GoalEntryDC != null)
{
GoalEntryDC.Notice = value;
}
}
}
public bool IsGoal
{
get
{
return GoalEntryVM != null ?
GoalEntryVM.Type.Equals(ValueListEntryType.SupportConceptGoalType) || GoalEntryVM.Type.Equals(ValueListEntryType.SupportConceptIndividualGoalType) :
GoalEntryDC.Type.Equals(ValueListEntryType.SupportConceptGoalType) || GoalEntryDC.Type.Equals(ValueListEntryType.SupportConceptIndividualGoalType);
}
}
public BindingList<SupportConceptGoalTreeItem> Items
{
get
{
return _Children ?? (_Children = new BindingList<SupportConceptGoalTreeItem>());
}
set
{
_Children = value;
}
}
public ValueListEntryType GoalType
{
get { return GoalEntryDC == null ? GoalEntryVM.Type : GoalEntryDC.Type; }
}
}
}