Maßnahme und Ziele per Popup bearbeiten Maßnahme und Ziele Notiz optional einblenden Das selbe auch bei Hilfeplan -> Ziele (ohne Icf import) ReportTemplate hinzugefügt (Tabelle, Hibernate, Enity, Mapper, DC) Listbox Select hinzugefügt, dient dem generischen Auswählen eines object aus einer list<object> per control
135 lines
3.1 KiB
C#
135 lines
3.1 KiB
C#
using BeWo.Core;
|
|
using BeWo.ServiceProxy;
|
|
using BS.Shared.Extensions;
|
|
using DevExpress.Utils;
|
|
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using BeWo.ViewModel;
|
|
using BS.Shared;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.DataContracts.ClientPartials;
|
|
using DevExpress.Data;
|
|
using DevExpress.Mvvm.Native;
|
|
using DevExpress.Xpf.Grid;
|
|
using DevExpress.Xpf.Scheduler.UI;
|
|
using DevExpress.XtraExport.Xls;
|
|
using static BeWo.View.Detail.Report.FlexibleReportView;
|
|
|
|
namespace BeWo.View.Detail.Report
|
|
{
|
|
public partial class IcfImportControl
|
|
{
|
|
#region Constant Fields
|
|
|
|
#endregion
|
|
|
|
#region Fields
|
|
|
|
public event Action ButtonImportClicked;
|
|
private SupportConceptGoalDC _TreeViewGoalItem;
|
|
|
|
#endregion
|
|
|
|
#region Constructors
|
|
|
|
public IcfImportControl(List<ValueListEntryDC> icfs)
|
|
{
|
|
InitializeComponent();
|
|
|
|
DataContext = this;
|
|
|
|
InitTreeView(icfs);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Finalizers
|
|
|
|
#endregion
|
|
|
|
#region Delegates
|
|
|
|
#endregion
|
|
|
|
#region Events
|
|
|
|
private void ButtonImport_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
ButtonImportClicked?.Invoke();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region InterfacesImplementations
|
|
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
public SupportConceptGoalDC TreeViewGoalItem
|
|
{
|
|
get => _TreeViewGoalItem;
|
|
set
|
|
{
|
|
_TreeViewGoalItem = value;
|
|
TreeView.ItemsSource = new List<SupportConceptGoalDC>() { value };
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Indexers
|
|
|
|
#endregion
|
|
|
|
#region Methods
|
|
|
|
private static SupportConceptGoalDC GetSupportConceptGoal(SupportConceptGoalDC parent, ValueListEntryDC actual, List<ValueListEntryDC> allIcfs)
|
|
{
|
|
// Erzeugt das O
|
|
var goalItem = new SupportConceptGoalDC
|
|
{
|
|
GoalEntryDC = actual,
|
|
ParentGoal = parent
|
|
};
|
|
|
|
// Sucht nach Einträgen, wo die ParentID gleich der acutal.Oid ist
|
|
var remaining = allIcfs.Where(x =>
|
|
x.ParentOid == actual.ValueListEntryOid).ToList();
|
|
|
|
// Schaut, ob welche gefunden worden, sonst bleibt Children leer
|
|
if (remaining.Any())
|
|
{
|
|
goalItem.Children = remaining.Select(x => GetSupportConceptGoal(goalItem, x, allIcfs)).ToList();
|
|
}
|
|
|
|
return goalItem;
|
|
}
|
|
|
|
private void InitTreeView(List<ValueListEntryDC> icfs)
|
|
{
|
|
if (icfs == null || icfs.All(x => x.ParentOid != -1)) return;
|
|
|
|
TreeViewGoalItem = GetSupportConceptGoal(null, icfs.Find(x => x.ParentOid == -1), icfs);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Structs
|
|
|
|
#endregion
|
|
|
|
#region Classes
|
|
|
|
#endregion
|
|
}
|
|
}
|