FormalizedPowerOfAttorneyHandlers.cs
2.05 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
using System;
using System.Collections.Generic;
using System.Linq;
using Sungero.Core;
using Sungero.CoreEntities;
using Sungero.Docflow.FormalizedPowerOfAttorney;
namespace Sungero.Docflow
{
partial class FormalizedPowerOfAttorneyClientHandlers
{
public override void Closing(Sungero.Presentation.FormClosingEventArgs e)
{
base.Closing(e);
e.Params.Remove(Constants.FormalizedPowerOfAttorney.HideImportParamName);
}
public override void Refresh(Sungero.Presentation.FormRefreshEventArgs e)
{
// Занесение доверенности не завершено. Не дизейблить обязательные поля, чтобы можно было завершить занесение.
if (_obj.RegistrationState == Docflow.OfficialDocument.RegistrationState.Registered &&
_obj.LifeCycleState == Docflow.OfficialDocument.LifeCycleState.Draft &&
(_obj.IssuedTo == null || _obj.BusinessUnit == null || _obj.Department == null))
{
e.Params.AddOrUpdate(Sungero.Docflow.Constants.OfficialDocument.RepeatRegister, true);
e.Params.AddOrUpdate(Sungero.Docflow.Constants.OfficialDocument.NeedValidateRegisterFormat, true);
}
// Запретить повторный импорт, если уже занесена подписанная версия.
if (!e.Params.Contains(Constants.FormalizedPowerOfAttorney.HideImportParamName) &&
Signatures.Get(_obj.LastVersion).Any(x => x.SignatureType == SignatureType.Approval))
{
e.Params.AddOrUpdate(Constants.FormalizedPowerOfAttorney.HideImportParamName, true);
}
base.Refresh(e);
}
public virtual void UnifiedRegistrationNumberValueInput(Sungero.Presentation.StringValueInputEventArgs e)
{
if (!string.IsNullOrEmpty(e.NewValue))
e.NewValue = e.NewValue.Trim();
Guid guid;
if (!Guid.TryParse(e.NewValue, out guid))
e.AddError(Sungero.Docflow.FormalizedPowerOfAttorneys.Resources.ErrorValidateUnifiedRegistrationNumber);
}
}
}