Intervallfinder überarbeitet & Bug gefixt, der zu einem Fehler beim Suchen nach freien Intervallen über mehrere Tage geführt hatte, wenn die Enduhrzeit vor der Startuhrzeit lag. Berichte mit Parametern. Verbesserte Mitarbeiter-, Klienten-, Team-, und Organisationsdropdowns mit Suche. Quittierungsbelegresultate (zum Unterschreiben) wird wie die Zeiterfassung paginiert. FaC: neuer Kalender noch nicht fertig.
54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
using System;
|
|
using BeWo.Data.Entities;
|
|
using BS.Shared.Extensions;
|
|
|
|
using NHibernate;
|
|
using NHibernate.Type;
|
|
|
|
namespace BeWoPlanerMobil.Service
|
|
{
|
|
public class MobileUpdInsInterceptor : EmptyInterceptor
|
|
{
|
|
public override bool OnFlushDirty(object entity, object id, object[] currentState, object[] previousState, string[] propertyNames, IType[] types)
|
|
{
|
|
var i = propertyNames.IndexOf(BeWoEntityBase.PropertyName_UdpUser);
|
|
if (i >= 0)
|
|
{
|
|
if (MobileSessionFacade.IsUserLoggedIn())
|
|
{
|
|
currentState[i] = $"{MobileSessionFacade.EmployeeFullname}";
|
|
}
|
|
else
|
|
{
|
|
currentState[i] = null;
|
|
}
|
|
}
|
|
|
|
return base.OnFlushDirty(entity, id, currentState, previousState, propertyNames, types);
|
|
}
|
|
|
|
public override bool OnSave(object entity, object id, object[] state, string[] propertyNames, IType[] types)
|
|
{
|
|
if (MobileSessionFacade.IsUserLoggedIn())
|
|
{
|
|
var i = propertyNames.IndexOf(BeWoEntityBase.PropertyName_InsUser);
|
|
if (i >= 0)
|
|
{
|
|
state[i] = $"{MobileSessionFacade.EmployeeFullname}";
|
|
}
|
|
|
|
i = propertyNames.IndexOf(BeWoEntityBase.PropertyName_UdpUser);
|
|
if (i >= 0)
|
|
{
|
|
state[i] = $"{MobileSessionFacade.EmployeeFullname}";
|
|
}
|
|
}
|
|
|
|
var i2 = propertyNames.IndexOf(BeWoEntityBase.PropertyName_InsTs);
|
|
if (i2 >= 0)
|
|
state[i2] = DateTime.Now;
|
|
|
|
return base.OnSave(entity, id, state, propertyNames, types);
|
|
}
|
|
}
|
|
} |