RetentionPolicyHandlers.cs
1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.Linq;
using Sungero.Core;
using Sungero.CoreEntities;
using Sungero.Docflow.RetentionPolicy;
namespace Sungero.Docflow
{
partial class RetentionPolicySharedHandlers
{
public virtual void IntervalChanged(Sungero.Domain.Shared.IntegerPropertyChangedEventArgs e)
{
if (!Equals(e.NewValue, e.OldValue))
_obj.NextRetention = Functions.RetentionPolicy.GetNextRetentionDate(_obj.RepeatType, _obj.IntervalType, e.NewValue, Calendar.Now);
}
public virtual void IntervalTypeChanged(Sungero.Domain.Shared.EnumerationPropertyChangedEventArgs e)
{
if (!Equals(e.NewValue, e.OldValue))
_obj.NextRetention = Functions.RetentionPolicy.GetNextRetentionDate(_obj.RepeatType, e.NewValue, _obj.Interval, Calendar.Now);
}
public virtual void RepeatTypeChanged(Sungero.Domain.Shared.EnumerationPropertyChangedEventArgs e)
{
if (!Equals(e.NewValue, e.OldValue))
{
if (e.NewValue == null || e.NewValue.Value != RetentionPolicy.RepeatType.CustomInterval)
{
_obj.Interval = null;
_obj.IntervalType = null;
}
if (e.NewValue != null && e.NewValue.Value == RetentionPolicy.RepeatType.WhenJobStart)
_obj.NextRetention = null;
_obj.NextRetention = Functions.RetentionPolicy.GetNextRetentionDate(e.NewValue, _obj.IntervalType, _obj.Interval, Calendar.Now);
}
Functions.RetentionPolicy.SetRequiredProperties(_obj);
}
}
}