RegistrationGroupHandlers.cs
1.21 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
using System;
using System.Collections.Generic;
using System.Linq;
using Sungero.Core;
using Sungero.CoreEntities;
using Sungero.Docflow.RegistrationGroup;
namespace Sungero.Docflow
{
partial class RegistrationGroupClientHandlers
{
public override void Refresh(Sungero.Presentation.FormRefreshEventArgs e)
{
if (!e.IsValid)
return;
var isResponsible = _obj.AccessRights.CanUpdate() && Functions.Module.CalculateParams(e, _obj, true, false, false, false, null);
if (!isResponsible && !_obj.AccessRights.CanManage())
{
e.AddInformation(RegistrationGroups.Resources.FormDisable);
foreach (var property in _obj.State.Properties)
property.IsEnabled = false;
}
if (_obj.AccessRights.CanUpdate() && Functions.Module.CalculateParams(e, _obj, false, true, false, false, null))
{
_obj.State.Properties.CanRegisterIncoming.IsEnabled = true;
_obj.State.Properties.CanRegisterOutgoing.IsEnabled = true;
_obj.State.Properties.CanRegisterInternal.IsEnabled = true;
_obj.State.Properties.CanRegisterContractual.IsEnabled = true;
}
else
_obj.State.Properties.Status.IsEnabled = false;
}
}
}