ApprovalSimpleAssignmentActions.cs
1.54 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.ApprovalSimpleAssignment;
namespace Sungero.Docflow.Client
{
partial class ApprovalSimpleAssignmentActions
{
public virtual void ExtendDeadline(Sungero.Domain.Client.ExecuteActionArgs e)
{
if (!Functions.ApprovalTask.HasDocumentAndCanRead(ApprovalTasks.As(_obj.Task)))
{
e.AddError(ApprovalTasks.Resources.NoRightsToDocument);
return;
}
var task = Docflow.PublicFunctions.DeadlineExtensionTask.Remote.GetDeadlineExtension(_obj);
task.Show();
}
public virtual bool CanExtendDeadline(Sungero.Domain.Client.CanExecuteActionArgs e)
{
return _obj.Status == Workflow.AssignmentBase.Status.InProcess && _obj.AccessRights.CanUpdate() && _obj.DocumentGroup.OfficialDocuments.Any();
}
public virtual void Complete(Sungero.Workflow.Client.ExecuteResultActionArgs e)
{
if (!Functions.ApprovalTask.HasDocumentAndCanRead(ApprovalTasks.As(_obj.Task)))
{
e.AddError(ApprovalTasks.Resources.NoRightsToDocument);
return;
}
if (!Functions.Module.ShowDialogGrantAccessRightsWithConfirmationDialog(_obj, _obj.OtherGroup.All.ToList(), e.Action, Constants.ApprovalTask.ApprovalSimpleAssignmentConfirmDialogID.Complete))
e.Cancel();
}
public virtual bool CanComplete(Sungero.Workflow.Client.CanExecuteResultActionArgs e)
{
return _obj.DocumentGroup.OfficialDocuments.Any();
}
}
}