ReceiptNotificationSendingTaskRouteHandlers.cs
2.18 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
using System;
using System.Collections.Generic;
using System.Linq;
using Sungero.Core;
using Sungero.CoreEntities;
using Sungero.Exchange.ReceiptNotificationSendingTask;
using Sungero.Workflow;
namespace Sungero.Exchange.Server
{
partial class ReceiptNotificationSendingTaskRouteHandlers
{
public virtual void StartReviewAssignment3(Sungero.Workflow.IReviewAssignment reviewAssignment)
{
}
#region Задание ответственному (Блок 2)
public virtual void StartBlock2(Sungero.Exchange.Server.ReceiptNotificationSendingAssignmentArguments e)
{
// Определить исполнителя.
var performer = _obj.Addressee != null ? _obj.Addressee : _obj.Box.Responsible;
e.Block.Performers.Add(performer);
// Заполнить поля из задачи.
e.Block.Subject = ReceiptNotificationSendingTasks.Resources.AssignmentSubjectFormat(_obj.Box.Name);
e.Block.Box = _obj.Box;
e.Block.RelativeDeadlineHours = 4;
// Выдать права на задачу.
_obj.AccessRights.Grant(performer, DefaultAccessRightsTypes.Change);
}
public virtual void StartAssignment2(Sungero.Exchange.IReceiptNotificationSendingAssignment assignment, Sungero.Exchange.Server.ReceiptNotificationSendingAssignmentArguments e)
{
_obj.MaxDeadline = assignment.Deadline;
// Переадресованное задание должно приходить от последнего исполнителя.
var lastProcessingAssignment = ReceiptNotificationSendingAssignments.GetAll().Where(a => Equals(a.Task, assignment.Task) && a.Id != assignment.Id).OrderByDescending(a => a.Created).FirstOrDefault();
if (lastProcessingAssignment != null)
assignment.Author = lastProcessingAssignment.Performer;
}
public virtual void CompleteAssignment2(Sungero.Exchange.IReceiptNotificationSendingAssignment assignment, Sungero.Exchange.Server.ReceiptNotificationSendingAssignmentArguments e)
{
}
public virtual void EndBlock2(Sungero.Exchange.Server.ReceiptNotificationSendingAssignmentEndBlockEventArguments e)
{
}
#endregion
}
}