DocumentKindHandlers.cs
2.12 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;
using System.Linq;
using Sungero.Core;
using Sungero.CoreEntities;
using Sungero.Docflow.DocumentKind;
namespace Sungero.Docflow
{
partial class DocumentKindSharedHandlers
{
public virtual void ProjectsAccountingChanged(Sungero.Domain.Shared.BooleanPropertyChangedEventArgs e)
{
if (e.NewValue == false)
_obj.GrantRightsToProject = false;
}
public virtual void DocumentFlowChanged(Sungero.Domain.Shared.EnumerationPropertyChangedEventArgs e)
{
if (e.NewValue != e.OldValue)
_obj.DocumentType = null;
if (e.NewValue != e.OldValue)
{
var actions = _obj.AvailableActions.ToList();
foreach (var action in actions)
{
_obj.AvailableActions.Remove(action);
}
}
if (e.NewValue != null && !Equals(e.NewValue, e.OldValue))
{
if (e.NewValue != DocumentFlow.Outgoing)
_obj.AvailableActions.AddNew().Action = Functions.Module.GetSendAction(OfficialDocuments.Info.Actions.SendActionItem);
if (e.NewValue == DocumentFlow.Incoming)
{
_obj.AvailableActions.AddNew().Action = Functions.Module.GetSendAction(OfficialDocuments.Info.Actions.SendForReview);
}
else
{
_obj.AvailableActions.AddNew().Action = Functions.Module.GetSendAction(OfficialDocuments.Info.Actions.SendForFreeApproval);
_obj.AvailableActions.AddNew().Action = Functions.Module.GetSendAction(OfficialDocuments.Info.Actions.SendForApproval);
}
}
}
public virtual void NumberingTypeChanged(Sungero.Domain.Shared.EnumerationPropertyChangedEventArgs e)
{
var isNumerable = e.NewValue == NumberingType.Numerable;
var isRegistrable = e.NewValue == NumberingType.Registrable;
_obj.State.Properties.AutoNumbering.IsVisible = isNumerable;
_obj.GenerateDocumentName = isNumerable || isRegistrable;
}
public virtual void NameChanged(Sungero.Domain.Shared.StringPropertyChangedEventArgs e)
{
if (_obj.ShortName == null)
_obj.ShortName = e.NewValue;
}
}
}