Termine in die Zeiterfassung übernehmen hat jetzt eine Link-Table, um das entsprechende Icon zuverlässig anzuzeigen. MoK: Löschen von Quittierungsbelegunterschriften eingebaut. Bewerten von Zielen/Maßnahmen an das entsprechende Recht gekoppelt.
196 lines
7.9 KiB
C#
196 lines
7.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Windows;
|
|
using System.Windows.Media;
|
|
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.DataContracts.Compact;
|
|
using BS.Shared.Extensions;
|
|
|
|
namespace BeWo.Scheduler.ViewModel
|
|
{
|
|
public class CustomFieldStorage
|
|
{
|
|
public string ToolTip
|
|
{
|
|
get
|
|
{
|
|
var result = Subject;
|
|
|
|
if(IsTask)
|
|
{
|
|
result = result ?? "";
|
|
|
|
if(CompletedDate.HasValue)
|
|
{
|
|
result += " erledigt am " + CompletedDate.Value.ToShortDateString();
|
|
} else if(DueDate.HasValue)
|
|
{
|
|
result += $" bis {DueDate.Value:dd.MM.yyyy HH:mm}";
|
|
}
|
|
}
|
|
|
|
if(IsAbsenceTime && _AbsenceTimeStart.HasValue)
|
|
{
|
|
result += _AbsenceTimeStart.Value.GetIntervalDescription(_AbsenceTimeEnd);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
|
|
public string Subject { get; set; }
|
|
|
|
public bool IsTask { get; set; }
|
|
public bool IsAbsenceTime { get; set; }
|
|
public bool IsPrivate { get; set; }
|
|
public bool IsAllDay { get; set; }
|
|
|
|
public LinearGradientBrush BackgroundColor => new LinearGradientBrush(new GradientStopCollection { new GradientStop(IsTask ? Color.FromRgb(153, 59, 59) : Color.FromRgb(192, 255, 208), 1) }, new Point(.5, 0), new Point(.5, 1));
|
|
public LinearGradientBrush ForegroundColor => new LinearGradientBrush(new GradientStopCollection { new GradientStop(IsTask ? Color.FromRgb(224, 224, 224) : Color.FromRgb(0, 0, 0), 1) }, new Point(.5, 0), new Point(.5, 1));
|
|
|
|
public ObservableCollection<Employee2SchedulerAppointmentDC> EmployeeList { get; set; } = new ObservableCollection<Employee2SchedulerAppointmentDC>();
|
|
public List<CompactCustomerDC> CustomerList { get; set; } = new List<CompactCustomerDC>();
|
|
public List<ResourceDC> ResourceList { get; set; } = new List<ResourceDC>();
|
|
public List<CompactSupportConceptDC> SupportConceptList { get; set; } = new List<CompactSupportConceptDC>();
|
|
|
|
public DateTime? DueDate { get; set; }
|
|
public DateTime? CompletedDate { get; set; }
|
|
public string CompletedNotice { get; set; }
|
|
public string CompletedUser { get; set; }
|
|
public string TaskDescription { get; set; }
|
|
|
|
public long? SchedulerAppointmentOid { get; set; }
|
|
|
|
public string RecurrenceId { get; set; }
|
|
public int RecurrenceIndex { get; set; }
|
|
|
|
public CompactEmployeeDC Originator { get; set; }
|
|
|
|
private DateTime? _AbsenceTimeStart;
|
|
|
|
private DateTime? _AbsenceTimeEnd;
|
|
|
|
public InternalInfo InternalInfo { get; set; }
|
|
|
|
public bool CanBeEdited { get; set; }
|
|
|
|
public long? AbsenceTimeOid { get; set; }
|
|
|
|
public bool IsCustomerAbsenceTime { get; set; }
|
|
|
|
public CustomFieldStorage()
|
|
{
|
|
|
|
}
|
|
|
|
public CustomFieldStorage(SchedulerAppointmentVM pAppointment)
|
|
{
|
|
IsTask = pAppointment.IsTask;
|
|
IsAbsenceTime = pAppointment.IsAbsenceTime;
|
|
IsPrivate = pAppointment.IsPrivate;
|
|
IsAllDay = pAppointment.AllDay;
|
|
|
|
EmployeeList = pAppointment.EmployeeList;
|
|
CustomerList = pAppointment.CustomerList;
|
|
ResourceList = pAppointment.ResourceList;
|
|
SupportConceptList = pAppointment.SupportConceptList;
|
|
|
|
DueDate = pAppointment.DueDate;
|
|
CompletedDate = pAppointment.CompletedDate;
|
|
CompletedNotice = pAppointment.CompletedNotice;
|
|
TaskDescription = pAppointment.TaskDescription;
|
|
|
|
Originator = pAppointment.Originator;
|
|
Subject = pAppointment.Subject;
|
|
|
|
SchedulerAppointmentOid = pAppointment.DataContract?.SchedulerAppointmentOid;
|
|
|
|
RecurrenceId = pAppointment.DataContract?.RecurrenceId;
|
|
RecurrenceIndex = pAppointment.DataContract?.RecurrenceIndex ?? 0;
|
|
|
|
_AbsenceTimeStart = pAppointment.AbsenceTimeStart;
|
|
_AbsenceTimeEnd = pAppointment.AbsenceTimeEnd;
|
|
|
|
HasServiceRecordEntry = pAppointment.HasServiceRecordEntry;
|
|
CanBeEdited = pAppointment.CanBeEdited;
|
|
|
|
AbsenceTimeOid = pAppointment.AbsenceTimeOid;
|
|
IsCustomerAbsenceTime = pAppointment.IsCustomerAbsenceTime;
|
|
ServiceRecordList = pAppointment.ServiceRecordList;
|
|
}
|
|
|
|
public CustomFieldStorage(SchedulerAppointmentDC pAppointment)
|
|
{
|
|
IsTask = pAppointment.IsTask;
|
|
IsAbsenceTime = false;
|
|
IsPrivate = pAppointment.IsPrivate;
|
|
IsAllDay = pAppointment.AllDay;
|
|
|
|
EmployeeList = new ObservableCollection<Employee2SchedulerAppointmentDC>(pAppointment.EmployeeList);
|
|
CustomerList = pAppointment.CustomerList;
|
|
ResourceList = pAppointment.ResourceList;
|
|
SupportConceptList = pAppointment.SupportConceptList;
|
|
|
|
DueDate = pAppointment.DueDate;
|
|
CompletedDate = pAppointment.CompletedDate;
|
|
CompletedNotice = pAppointment.CompletedNotice;
|
|
TaskDescription = pAppointment.TaskDescription;
|
|
|
|
Originator = pAppointment.Originator;
|
|
Subject = pAppointment.Subject;
|
|
|
|
SchedulerAppointmentOid = pAppointment.SchedulerAppointmentOid;
|
|
|
|
RecurrenceId = pAppointment.RecurrenceId;
|
|
RecurrenceIndex = pAppointment.RecurrenceIndex;
|
|
|
|
HasServiceRecordEntry = pAppointment.HasServiceRecordEntry;
|
|
|
|
CanBeEdited = pAppointment.CanBeEdited;
|
|
}
|
|
|
|
public CustomFieldStorage(ObservableCollection<Employee2SchedulerAppointmentDC> pEmployees, List<CompactCustomerDC> pCustomers, List<ResourceDC> pResources, CompactEmployeeDC pOriginator, bool pIsPrivate, bool pIsTask, string pTaskDescription, DateTime? pDueDate, DateTime? pCompletedDate, string pCompletedNotice, List<CompactSupportConceptDC> pSupportConcepts, string pSubject, bool pIsAllDay)
|
|
{
|
|
IsTask = pIsTask;
|
|
IsPrivate = pIsPrivate;
|
|
IsAllDay = pIsAllDay;
|
|
|
|
EmployeeList = pEmployees;
|
|
CustomerList = pCustomers;
|
|
ResourceList = pResources;
|
|
SupportConceptList = pSupportConcepts;
|
|
|
|
DueDate = pDueDate;
|
|
CompletedDate = pCompletedDate;
|
|
CompletedNotice = pCompletedNotice;
|
|
TaskDescription = pTaskDescription;
|
|
|
|
Originator = pOriginator;
|
|
Subject = pSubject;
|
|
}
|
|
|
|
public Visibility ToolTipTimeVisibility => IsTask || IsAbsenceTime || IsAllDay ? Visibility.Collapsed : Visibility.Visible;
|
|
|
|
public Visibility ToolTipResourcesVisibility => ResourceList?.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
|
|
|
|
public Visibility ToolTipEmployeesVisibility => EmployeeList?.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
|
|
|
|
public Visibility ToolTipCustomersVisibility => CustomerList?.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
|
|
|
|
public Visibility ToolTipTrennstrichVisibility => EmployeeList?.Count > 0 || CustomerList?.Count > 0 || ResourceList?.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
|
|
|
|
public Visibility ToolTipZusageVisibility => IsTask ? Visibility.Collapsed : Visibility.Visible;
|
|
|
|
public bool HasServiceRecordEntry { get; set; }
|
|
|
|
public List<ServiceRecordDC> ServiceRecordList { get; set; } = new List<ServiceRecordDC>();
|
|
}
|
|
|
|
public class InternalInfo
|
|
{
|
|
public bool IsTimeChangedRecurringAppointment { get; set; }
|
|
}
|
|
}
|