Exemplo n.º 1
0
        public static void AddEntityOwner(this Entity entity, long partyRoleId, DateTime now)
        {
            var involvementRole = new InvolvementRole
            {
                PartyRoleId           = partyRoleId,
                ValidFrom             = now,
                IsActive              = true,
                InvolvementRoleTypeId = (int)InvolvementRoleTypeEnum.EntityOwner
            };

            entity.EntityInvolvementRoles.Add(new EntityInvolvementRole
            {
                InvolvementRole = involvementRole
            });
        }
Exemplo n.º 2
0
        public static void AddEntityOwner(this Entity entity, ICurrentUserService currentUserService, DateTime now)
        {
            var contextData = currentUserService.CurrentSecurityContextData;

            var involvementRole = new InvolvementRole
            {
                PartyRoleId           = contextData.PRInvWithId,
                ValidFrom             = now,
                IsActive              = true,
                InvolvementRoleTypeId = (int)InvolvementRoleTypeEnum.EntityOwner
            };

            entity.EntityInvolvementRoles.Add(new EntityInvolvementRole
            {
                InvolvementRole = involvementRole
            });
        }