EmployeeHandlers.cs
1.44 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
using System;
using System.Collections.Generic;
using System.Linq;
using Sungero.Company.Employee;
using Sungero.Core;
using Sungero.CoreEntities;
namespace Sungero.Company
{
partial class EmployeeClientHandlers
{
public override void Refresh(Sungero.Presentation.FormRefreshEventArgs e)
{
Sungero.Company.PublicFunctions.Employee.SetRequiredProperties(_obj);
if (!Functions.Employee.IsValidEmail(_obj.Email))
e.AddWarning(_obj.Info.Properties.Email, Parties.Resources.WrongEmailFormat);
}
public virtual void EmailValueInput(Sungero.Presentation.StringValueInputEventArgs e)
{
if (!Functions.Employee.IsValidEmail(e.NewValue))
e.AddError(Parties.Resources.WrongEmailFormat);
else if (!Docflow.PublicFunctions.Module.IsASCII(e.NewValue))
e.AddWarning(Docflow.Resources.ASCIIWarning);
}
public override void SignatoryInfoObtaining(Sungero.Domain.Client.SignatoryInfoObtainingEventArgs e)
{
var result = _obj.JobTitle != null ? _obj.JobTitle.Name.Trim() : string.Empty;
if (_obj.Department != null)
{
var department = string.IsNullOrEmpty(_obj.Department.ShortName) ? _obj.Department.Name : _obj.Department.ShortName;
if (string.IsNullOrEmpty(result))
result = department;
else
result = string.Format("{0} ({1})", result, department);
}
e.AdditionalInfo = result + "|";
}
}
}