BankHandlers.cs
2.22 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
66
67
68
69
70
71
72
73
74
75
using System;
using System.Collections.Generic;
using System.Linq;
using Sungero.Core;
using Sungero.CoreEntities;
using Sungero.Parties.Bank;
namespace Sungero.Parties
{
partial class BankClientHandlers
{
public override void Refresh(Sungero.Presentation.FormRefreshEventArgs e)
{
base.Refresh(e);
Sungero.Parties.PublicFunctions.Bank.SetRequiredProperties(_obj);
}
public override void NonresidentValueInput(Sungero.Presentation.BooleanValueInputEventArgs e)
{
base.NonresidentValueInput(e);
if (e.NewValue != true)
{
var errorMessage = Functions.Bank.CheckBicLength(_obj.BIC);
if (!string.IsNullOrEmpty(errorMessage))
e.AddError(_obj.Info.Properties.BIC, errorMessage);
errorMessage = Functions.Bank.CheckCorrLength(_obj.CorrespondentAccount);
if (!string.IsNullOrEmpty(errorMessage))
e.AddError(_obj.Info.Properties.CorrespondentAccount, errorMessage);
}
else
{
var errorMessage = Functions.Bank.CheckCorrAccountForNonresident(_obj.CorrespondentAccount);
if (!string.IsNullOrEmpty(errorMessage))
e.AddError(_obj.Info.Properties.CorrespondentAccount, errorMessage);
}
}
public virtual void SWIFTValueInput(Sungero.Presentation.StringValueInputEventArgs e)
{
var result = Functions.Bank.CheckSwift(e.NewValue);
if (!string.IsNullOrEmpty(result))
e.AddError(result);
}
public virtual void CorrespondentAccountValueInput(Sungero.Presentation.StringValueInputEventArgs e)
{
if (_obj.Nonresident != true)
{
var result = Functions.Bank.CheckCorrLength(e.NewValue);
if (!string.IsNullOrEmpty(result))
e.AddError(result);
}
else
{
var result = Functions.Bank.CheckCorrAccountForNonresident(e.NewValue);
if (!string.IsNullOrEmpty(result))
e.AddError(result);
}
}
public virtual void BICValueInput(Sungero.Presentation.StringValueInputEventArgs e)
{
if (_obj.Nonresident != true)
{
var result = Functions.Bank.CheckBicLength(e.NewValue);
if (!string.IsNullOrEmpty(result))
e.AddError(result);
}
}
}
}