ManagersAssistantHandlers.cs
1.1 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
using System;
using System.Collections.Generic;
using System.Linq;
using Sungero.Company.ManagersAssistant;
using Sungero.Core;
using Sungero.CoreEntities;
namespace Sungero.Company
{
partial class ManagersAssistantServerHandlers
{
public override void BeforeDelete(Sungero.Domain.BeforeDeleteEventArgs e)
{
Functions.ManagersAssistant.RemoveAssistantsFromRoleUsersWithAssignmentCompletionRights(_obj, null);
}
public override void Created(Sungero.Domain.CreatedEventArgs e)
{
if (!_obj.State.IsCopied)
{
_obj.PreparesResolution = false;
_obj.PreparesAssignmentCompletion = false;
_obj.IsAssistant = true;
}
}
public override void BeforeSave(Sungero.Domain.BeforeSaveEventArgs e)
{
Functions.ManagersAssistant.UpdateRoleUsersWithAssignmentCompletionRights(_obj);
if (_obj.Status == CoreEntities.DatabookEntry.Status.Closed)
return;
if (_obj.Manager == null || _obj.Assistant == null)
return;
Functions.ManagersAssistant.ValidateManagersAssistants(_obj, e);
}
}
}