2016-06-27 01:45:38 +02:00
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BeWo.View.Report.FLSReport
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class FLSOverviewGrid : UserControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public static readonly DependencyProperty DetailRowProperty = DependencyProperty.Register("DetailRow", typeof(FLSOverviewDetailRow), typeof(FLSOverviewGrid), new UIPropertyMetadata(new FLSOverviewDetailRow(DetailRowTypes.Header), RowChanged));
|
|
|
|
|
|
|
|
|
|
|
|
public FLSOverviewGrid()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.InitializeComponent();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public FLSOverviewDetailRow DetailRow
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return (FLSOverviewDetailRow)this.GetValue(DetailRowProperty);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
this.SetValue(DetailRowProperty, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void RefreshGrid(FLSOverviewDetailRow row)
|
|
|
|
|
|
{
|
|
|
|
|
|
Grid grid = this.detailRowGrid;
|
|
|
|
|
|
|
|
|
|
|
|
grid.RowDefinitions.Add(new RowDefinition());
|
|
|
|
|
|
|
|
|
|
|
|
// Employee Column
|
|
|
|
|
|
if (row.ShowServiceRecords && row.ShowOnlyTotalRows)
|
|
|
|
|
|
{
|
|
|
|
|
|
grid.ColumnDefinitions.Add(this.CreateColumnDefinition(175));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
grid.ColumnDefinitions.Add(this.CreateColumnDefinition(120));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Label lbl;
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
if (row.DetailRowType != DetailRowTypes.Detail)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.FontWeight = FontWeights.Bold;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 0);
|
|
|
|
|
|
if (row.ShowServiceRecords && row.ShowOnlyTotalRows && row.DetailRowType == DetailRowTypes.Header)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = "Datum";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = row.GroupName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
if (row.ShowServiceRecords)
|
|
|
|
|
|
{
|
|
|
|
|
|
// grid.Margin = new Thickness(0, 0, 8, 0);
|
|
|
|
|
|
if (row.ShowServiceRecords && row.ShowOnlyTotalRows)
|
|
|
|
|
|
{
|
|
|
|
|
|
grid.ColumnDefinitions.Add(this.CreateColumnDefinition(150));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
grid.ColumnDefinitions.Add(this.CreateColumnDefinition(175));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
grid.ColumnDefinitions.Add(this.CreateColumnDefinition(175));
|
|
|
|
|
|
grid.ColumnDefinitions.Add(this.CreateColumnDefinition(1, GridUnitType.Star));
|
|
|
|
|
|
|
|
|
|
|
|
if (row.DetailRowType == DetailRowTypes.Header)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
lbl.FontWeight = FontWeights.Bold;
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 1);
|
|
|
|
|
|
if (row.ShowOnlyTotalRows)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = row.GroupName;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = "Datum";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
lbl.FontWeight = FontWeights.Bold;
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 2);
|
|
|
|
|
|
lbl.Content = "Leistung";
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
lbl.FontWeight = FontWeights.Bold;
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 3);
|
|
|
|
|
|
lbl.Content = "Dokumentation";
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (row.DetailRowType == DetailRowTypes.Detail)
|
|
|
|
|
|
{
|
|
|
|
|
|
int rowIndex = 0;
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in row.DateValues)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool evenRow = false;
|
|
|
|
|
|
if (rowIndex > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
grid.RowDefinitions.Add(new RowDefinition());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Border border = new Border();
|
|
|
|
|
|
|
|
|
|
|
|
if (row.ShowOnlyTotalRows)
|
|
|
|
|
|
{
|
|
|
|
|
|
border.SetValue(Grid.ColumnProperty, 0);
|
|
|
|
|
|
border.SetValue(Grid.ColumnSpanProperty, 4);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
border.SetValue(Grid.ColumnProperty, 1);
|
|
|
|
|
|
border.SetValue(Grid.ColumnSpanProperty, 3);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
border.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
border.CornerRadius = new CornerRadius(3, 3, 0, 0);
|
|
|
|
|
|
border.BorderThickness = new Thickness(1, 1, 1, 0);
|
|
|
|
|
|
border.BorderBrush = Brushes.Gray;
|
|
|
|
|
|
border.Background = Brushes.Cornsilk;
|
|
|
|
|
|
if (rowIndex > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
border.Margin = new Thickness(0, 4, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
// border.Height = 35;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(border);
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
if (row.ShowOnlyTotalRows)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnSpanProperty, 2);
|
|
|
|
|
|
lbl.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
lbl.FontWeight = FontWeights.Bold;
|
|
|
|
|
|
lbl.Content = item.HeaderLongValue;
|
|
|
|
|
|
if (rowIndex > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Margin = new Thickness(0, 4, 0, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
if (row.ShowOnlyTotalRows)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 2);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnSpanProperty, 2);
|
|
|
|
|
|
lbl.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
lbl.FontWeight = FontWeights.Bold;
|
|
|
|
|
|
lbl.Content = "Summe: " + item.DateValueText + " Std.";
|
|
|
|
|
|
lbl.Margin = new Thickness(-100, 0, 0, 0);
|
|
|
|
|
|
if (rowIndex > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Margin = new Thickness(-100, 4, 0, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
int count = 0;
|
|
|
|
|
|
if (item.ServiceRecordList != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var sr in item.ServiceRecordList)
|
|
|
|
|
|
{
|
|
|
|
|
|
grid.RowDefinitions.Add(new RowDefinition());
|
|
|
|
|
|
|
|
|
|
|
|
border = new Border();
|
|
|
|
|
|
if (row.ShowOnlyTotalRows)
|
|
|
|
|
|
{
|
|
|
|
|
|
border.SetValue(Grid.ColumnProperty, 0);
|
|
|
|
|
|
border.SetValue(Grid.ColumnSpanProperty, 4);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
border.SetValue(Grid.ColumnProperty, 1);
|
|
|
|
|
|
border.SetValue(Grid.ColumnSpanProperty, 3);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
border.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
border.BorderThickness = new Thickness(1, 0, 1, 0);
|
|
|
|
|
|
border.BorderBrush = Brushes.Gray;
|
|
|
|
|
|
if (evenRow)
|
|
|
|
|
|
{
|
|
|
|
|
|
border.Background = Brushes.WhiteSmoke;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
border.Background = Brushes.White;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
evenRow = !evenRow;
|
|
|
|
|
|
if (count == item.ServiceRecordList.Count - 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
border.CornerRadius = new CornerRadius(0, 0, 3, 3);
|
|
|
|
|
|
border.BorderThickness = new Thickness(1, 0, 1, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(border);
|
|
|
|
|
|
|
|
|
|
|
|
if (row.ShowOnlyTotalRows)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 1);
|
|
|
|
|
|
lbl.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
|
|
|
|
|
|
if (sr.GroupOid != null && sr.GroupPersonCount != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = "Gruppe (" + sr.GroupPersonCount.Value + " Teilnehmer)";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = "Sonstiges".Equals(sr.GroupName) ? string.Empty : sr.GroupName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
if (row.ShowOnlyTotalRows)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lbl.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
|
|
|
|
|
|
if (sr.Start != null && sr.Start.Value.Second == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (sr.GroupOid != null && sr.GroupRoundedDuration != null && sr.GroupPersonCount != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = sr.Start.Value.ToShortDateString().Substring(0, 6) + " " + sr.Start.Value.ToShortTimeString() + "-" + sr.Start.Value.AddMinutes((double)sr.GroupRoundedDuration).ToShortTimeString() + " (" + (int)sr.RoundedDuration + " min.)";
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
if (row.ShowOnlyTotalRows)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lbl.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
lbl.VerticalAlignment = VerticalAlignment.Top;
|
|
|
|
|
|
lbl.Margin = new Thickness(0, 20, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
lbl.Content += sr.GroupPersonCount.Value + " Personen, " + sr.GroupEmployeeCount.Value + " Betreuuer";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = sr.Start.Value.ToShortDateString().Substring(0, 6) + " " + sr.Start.Value.ToShortTimeString() + "-" + sr.Start.Value.AddMinutes((double)sr.RoundedDuration).ToShortTimeString() + " (" + (int)sr.RoundedDuration + " min.)";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (sr.GroupOid != null && sr.GroupRoundedDuration != null && sr.GroupPersonCount != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = sr.Start.Value.ToShortDateString().Substring(0, 6) + " " + (int)sr.GroupRoundedDuration.Value + " min.";
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
if (row.ShowOnlyTotalRows)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lbl.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
lbl.VerticalAlignment = VerticalAlignment.Top;
|
|
|
|
|
|
lbl.Margin = new Thickness(0, 20, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
lbl.Content += sr.GroupPersonCount.Value + " Personen, " + sr.GroupEmployeeCount.Value + " Betreuuer";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = sr.Start.Value.ToShortDateString().Substring(0, 6) + " " + (int)sr.RoundedDuration + " min.";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
TextBlock block = new TextBlock();
|
|
|
|
|
|
block.TextWrapping = TextWrapping.Wrap;
|
|
|
|
|
|
block.HorizontalAlignment = HorizontalAlignment.Left;
|
|
|
|
|
|
block.SetValue(Grid.ColumnProperty, 2);
|
|
|
|
|
|
block.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
if (sr.ServiceDescription != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
block.Text = sr.ServiceDescription.Name;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// block.MaxWidth = 500;
|
|
|
|
|
|
block.Margin = new Thickness(0, 5, 5, 3);
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(block);
|
|
|
|
|
|
|
|
|
|
|
|
block = new TextBlock();
|
|
|
|
|
|
block.TextWrapping = TextWrapping.Wrap;
|
|
|
|
|
|
block.HorizontalAlignment = HorizontalAlignment.Left;
|
|
|
|
|
|
block.SetValue(Grid.ColumnProperty, 3);
|
|
|
|
|
|
block.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
block.Text = sr.Notice;
|
|
|
|
|
|
block.MaxWidth = 500;
|
|
|
|
|
|
block.Margin = new Thickness(5, 5, 5, 3);
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(block);
|
|
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
count++;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (count == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
border.CornerRadius = new CornerRadius(3, 3, 3, 3);
|
|
|
|
|
|
border.BorderThickness = new Thickness(1, 1, 1, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (row.DetailRowType == DetailRowTypes.Total)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 1);
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnSpanProperty, 2);
|
|
|
|
|
|
|
|
|
|
|
|
// lbl.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
lbl.FontWeight = FontWeights.Bold;
|
|
|
|
|
|
lbl.Content = row.RowTotalFLS + " Std.";
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (row.DateValues != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
int idx = 1;
|
|
|
|
|
|
foreach (FLSOverviewDateValue dv in row.DateValues)
|
|
|
|
|
|
{
|
|
|
|
|
|
grid.ColumnDefinitions.Add(this.CreateColumnDefinition(65));
|
|
|
|
|
|
|
|
|
|
|
|
Label lblDate = new Label();
|
|
|
|
|
|
if (row.DetailRowType != DetailRowTypes.Detail)
|
|
|
|
|
|
{
|
|
|
|
|
|
lblDate.FontWeight = FontWeights.Bold;
|
2017-02-01 13:53:59 +01:00
|
|
|
|
lblDate.Content = dv.DateValueText;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (dv.DateValue != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
lblDate.Content = dv.DateValueText;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lblDate.SetValue(Grid.ColumnProperty, idx++);
|
|
|
|
|
|
lblDate.HorizontalAlignment = HorizontalAlignment.Right;
|
|
|
|
|
|
lblDate.ToolTip = this.CreateToolTip(dv);
|
|
|
|
|
|
grid.Children.Add(lblDate);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Total Column
|
|
|
|
|
|
grid.ColumnDefinitions.Add(this.CreateColumnDefinition(70));
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
if (row.DetailRowType != DetailRowTypes.Detail)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.FontWeight = FontWeights.Bold;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, grid.ColumnDefinitions.Count - 1);
|
|
|
|
|
|
lbl.Content = row.RowTotalFLS;
|
|
|
|
|
|
lbl.HorizontalAlignment = HorizontalAlignment.Right;
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (row.ShowChart && (row.DetailRowType == DetailRowTypes.Detail || row.DetailRowType == DetailRowTypes.Total))
|
|
|
|
|
|
{
|
|
|
|
|
|
FLSOverviewChart chart = this.CreateChart(row);
|
|
|
|
|
|
RowDefinition rowDef = new RowDefinition();
|
|
|
|
|
|
rowDef.Height = new GridLength(200, GridUnitType.Pixel);
|
|
|
|
|
|
grid.RowDefinitions.Add(rowDef);
|
|
|
|
|
|
|
|
|
|
|
|
chart.SetValue(Grid.RowProperty, grid.RowDefinitions.Count - 1);
|
|
|
|
|
|
chart.SetValue(Grid.ColumnProperty, 1);
|
|
|
|
|
|
|
|
|
|
|
|
if (row.ShowServiceRecords)
|
|
|
|
|
|
{
|
|
|
|
|
|
double width = 0;
|
|
|
|
|
|
if (row.DateValues != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
width = row.DateValues.Count * 50;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (width < 600)
|
|
|
|
|
|
{
|
|
|
|
|
|
width = 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
chart.Width = width;
|
|
|
|
|
|
|
|
|
|
|
|
// chart.HorizontalAlignment = HorizontalAlignment.Stretch;
|
|
|
|
|
|
chart.HorizontalAlignment = HorizontalAlignment.Left;
|
|
|
|
|
|
chart.SetValue(Grid.ColumnSpanProperty, grid.ColumnDefinitions.Count);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
chart.SetValue(Grid.ColumnSpanProperty, grid.ColumnDefinitions.Count - 2);
|
|
|
|
|
|
chart.Margin = new Thickness(10, 0, 0, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(chart);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static void RowChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
FLSOverviewGrid item = (FLSOverviewGrid)obj;
|
|
|
|
|
|
FLSOverviewDetailRow row = (FLSOverviewDetailRow)e.NewValue;
|
|
|
|
|
|
item.RefreshGrid(row);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private FLSOverviewChart CreateChart(FLSOverviewDetailRow row)
|
|
|
|
|
|
{
|
|
|
|
|
|
FLSOverviewChart chart = new FLSOverviewChart();
|
|
|
|
|
|
chart.InitChart(row);
|
|
|
|
|
|
|
|
|
|
|
|
return chart;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ColumnDefinition CreateColumnDefinition(int p)
|
|
|
|
|
|
{
|
|
|
|
|
|
ColumnDefinition def = new ColumnDefinition();
|
|
|
|
|
|
def.Width = new GridLength(p);
|
|
|
|
|
|
|
|
|
|
|
|
return def;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ColumnDefinition CreateColumnDefinition(double value, GridUnitType type)
|
|
|
|
|
|
{
|
|
|
|
|
|
ColumnDefinition def = new ColumnDefinition();
|
|
|
|
|
|
def.Width = new GridLength(value, type);
|
|
|
|
|
|
|
|
|
|
|
|
return def;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private object CreateToolTip(FLSOverviewDateValue dv)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (dv.ServiceRecordList != null && dv.ServiceRecordList.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
Grid grid = new Grid();
|
|
|
|
|
|
|
|
|
|
|
|
grid.ColumnDefinitions.Add(this.CreateColumnDefinition(40));
|
|
|
|
|
|
grid.ColumnDefinitions.Add(this.CreateColumnDefinition(130));
|
|
|
|
|
|
ColumnDefinition def = this.CreateColumnDefinition(1, GridUnitType.Auto);
|
|
|
|
|
|
|
|
|
|
|
|
// def.MaxWidth = 330;
|
|
|
|
|
|
grid.ColumnDefinitions.Add(def);
|
|
|
|
|
|
int rowIndex = 0;
|
|
|
|
|
|
foreach (var item in dv.ServiceRecordList)
|
|
|
|
|
|
{
|
|
|
|
|
|
grid.RowDefinitions.Add(new RowDefinition());
|
|
|
|
|
|
|
|
|
|
|
|
Label lbl = new Label();
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 0);
|
|
|
|
|
|
lbl.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
lbl.Content = item.Start.Value.ToShortDateString().Substring(0, 6);
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 1);
|
|
|
|
|
|
lbl.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
if (item.Start != null && item.Start.Value.Second == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (item.GroupOid != null && item.GroupRoundedDuration != null && item.GroupPersonCount != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = item.Start.Value.ToShortTimeString() + "-" + item.Start.Value.AddMinutes((double)item.GroupRoundedDuration).ToShortTimeString() + " (" + (int)item.RoundedDuration + " min.)";
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 0);
|
|
|
|
|
|
lbl.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnSpanProperty, 2);
|
|
|
|
|
|
lbl.VerticalAlignment = VerticalAlignment.Top;
|
|
|
|
|
|
lbl.Margin = new Thickness(0, 20, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
lbl.Content += item.GroupPersonCount.Value + " Personen, " + item.GroupEmployeeCount.Value + " Betreuuer";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = item.Start.Value.ToShortTimeString() + "-" + item.Start.Value.AddMinutes((double)item.RoundedDuration).ToShortTimeString() + " (" + (int)item.RoundedDuration + " min.)";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (item.GroupOid != null && item.GroupRoundedDuration != null && item.GroupPersonCount != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = (int)item.GroupRoundedDuration.Value + " min.";
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
lbl = new Label();
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnProperty, 0);
|
|
|
|
|
|
lbl.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
lbl.SetValue(Grid.ColumnSpanProperty, 2);
|
|
|
|
|
|
lbl.VerticalAlignment = VerticalAlignment.Top;
|
|
|
|
|
|
lbl.Margin = new Thickness(0, 20, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
lbl.Content += item.GroupPersonCount.Value + " Personen, " + item.GroupEmployeeCount.Value + " Betreuuer";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
lbl.Content = (int)item.RoundedDuration + " min.";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(lbl);
|
|
|
|
|
|
|
|
|
|
|
|
TextBlock block = new TextBlock();
|
|
|
|
|
|
block.TextWrapping = TextWrapping.Wrap;
|
|
|
|
|
|
block.MaxWidth = 400;
|
|
|
|
|
|
block.SetValue(Grid.ColumnProperty, 2);
|
|
|
|
|
|
block.SetValue(Grid.RowProperty, rowIndex);
|
|
|
|
|
|
block.Text = item.Notice;
|
|
|
|
|
|
|
|
|
|
|
|
block.Margin = new Thickness(0, 5, 3, 0);
|
|
|
|
|
|
|
|
|
|
|
|
grid.Children.Add(block);
|
|
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return grid;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|