ConditionServerFunctions.cs
1.4 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.Core;
using Sungero.CoreEntities;
using Sungero.Docflow.Condition;
using Sungero.Docflow.ConditionBase;
namespace Sungero.Docflow.Server
{
partial class ConditionFunctions
{
/// <summary>
/// Создание условия.
/// </summary>
/// <returns>Условие.</returns>
[Remote]
public static ICondition CreateCondition()
{
return Conditions.Create();
}
public override string GetConditionName()
{
using (TenantInfo.Culture.SwitchTo())
{
if (_obj.ConditionType == Sungero.Docflow.Condition.ConditionType.Addressee)
{
var addressees = _obj.Addressees.Select(a => a.Addressee.Person.ShortName).ToList();
var conditionName = Functions.ConditionBase.ConditionMultiSelectNameBuilder(addressees);
return Conditions.Resources.TitleAddresseeFormat(conditionName);
}
if (_obj.ConditionType == Sungero.Docflow.Condition.ConditionType.ManyAddressees)
return Conditions.Resources.ManyAddressees;
}
return base.GetConditionName();
}
public override List<Sungero.Company.IEmployee> GetEmployeesFromProperties()
{
var employees = base.GetEmployeesFromProperties();
employees.AddRange(_obj.Addressees.Select(a => a.Addressee));
return employees;
}
}
}