ChatControlleränderungen

This commit is contained in:
LynJet
2022-07-28 19:19:01 +02:00
parent 1984d19898
commit 9e882e38df
2 changed files with 50 additions and 3 deletions

View File

@@ -2296,9 +2296,33 @@ namespace BeWo.Scheduler.View
appointmentOidListe.AddRange(serienTerminOids.Where(w => !appointmentOidListe.Contains(w)));
var mehrTaegigeTermine = new List<SchedulerAppointmentDC>();
var mehrTaegigeTermine = apps.Where(a => !a.SameDay && !(!a.SameDay && a.AllDay && a.Duration == new TimeSpan(1, 0, 0, 0))).Select(s => ((SchedulerAppointmentVM) s.GetSourceObject(Scheduler.GetCoreStorage())).CommitToDataContract()).ToList();
appointmentOidListe.RemoveRange(mehrTaegigeTermine.Select(s => s.SchedulerAppointmentOid.Value));
// ToDo: Für Montag, 18.07.2022:
// ToDo: Serientermine kommen doppelt vor! Mehrtägige Serientermine aus den appointmentOids herausnehmen!
foreach (var app in apps.Where(a => !a.SameDay && !(!a.SameDay && a.AllDay && a.Duration == new TimeSpan(1, 0, 0, 0))))
{
var sourceObject = app.GetSourceObject(Scheduler.GetCoreStorage());
if(sourceObject is SchedulerAppointmentVM vm)
{
mehrTaegigeTermine.Add(vm.CommitToDataContract());
BeWoApp.LogMessage($"{vm.Subject}: {vm.Start:dd.MM.yyyy HH:mm} - {vm.End:dd.MM.yyyy HH:mm}; {(AppointmentType) vm.EventType}", Colors.Green);
}
else
{
var occurrenceVM = new SchedulerAppointmentVM(app);
mehrTaegigeTermine.Add(occurrenceVM.CommitToDataContract());
BeWoApp.LogMessage($"{occurrenceVM.Subject}: {occurrenceVM.Start:dd.MM.yyyy HH:mm} - {occurrenceVM.End:dd.MM.yyyy HH:mm}; {(AppointmentType)occurrenceVM.EventType}", Colors.Purple);
}
}
var test = apps.Select(s => $"{s.Subject} ist {s.Type}").ToList();
var test2 = mehrTaegigeTermine.Select(s => $"{s.Subject} ist {s.Type}").ToList();
// ToDo: Mehrtägige Serientermine tauchen doppelt auf!
appointmentOidListe.RemoveRange(mehrTaegigeTermine.Where(w => w.SchedulerAppointmentOid.HasValue).Select(s => s.SchedulerAppointmentOid.Value));
var neueTermine = new List<SchedulerAppointmentDC>();
foreach(var termin in mehrTaegigeTermine)

View File

@@ -2,13 +2,14 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using BeWo.Scheduler.Utils;
using BeWo.ViewModel;
using BS.Shared;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using DevExpress.XtraScheduler;
namespace BeWo.Scheduler.ViewModel
{
@@ -559,6 +560,28 @@ namespace BeWo.Scheduler.ViewModel
CanBeEdited = pDC.CanBeEdited;
}
// Wird für die Druckfunktion von Serienterminen benutzt:
public SchedulerAppointmentVM(Appointment appointment) : base(new SchedulerAppointmentDC(), true)
{
_AllDay = appointment.AllDay;
_Start = appointment.Start;
_End = appointment.End;
_Location = appointment.Location;
_Description = appointment.Description;
_Subject = appointment.Subject;
_Type = (int) appointment.Type;
_IsPrivate = appointment.CF_IsPrivate();
_EmployeeList = appointment.CF_EmployeeList();
_CustomerList = appointment.CF_CustomerList();
_ResourceList = appointment.CF_ResourceList();
_Originator = appointment.CF_Originator();
if(!(appointment.RecurrenceInfo is null) && appointment.Type == AppointmentType.Occurrence)
{
_RecurrenceInfo = $"<RecurrenceInfo Id=\"{appointment.RecurrenceInfo.Id}\" Index=\"{appointment.RecurrenceIndex}\" />";
}
}
// Wird für Abwesenheiten genutzt
public SchedulerAppointmentVM(bool pAllDay, string pSubject, DateTime pStart, DateTime pEnd, CompactEmployeeDC pOriginator, DateTime? absenceTimeStart, DateTime? absenceTimeEnd)
{