コード例 #1
0
        public override Colaborador AuditDefault(DomainBaseWithUserCreate entity, DomainBaseWithUserCreate entityOld)
        {
            var colaborador = base.AuditDefault(entity, entityOld);

            if (colaborador.Pessoa.IsNotNull())
            {
                base.AuditDefault(colaborador.Pessoa, entityOld);
            }

            return(colaborador);
        }
コード例 #2
0
        public override Condominio AuditDefault(DomainBaseWithUserCreate entity, DomainBaseWithUserCreate entityOld)
        {
            var alvo = base.AuditDefault(entity, entityOld);

            if (alvo.Endereco.IsNotNull())
            {
                base.AuditDefault(alvo.Endereco, entityOld);
            }

            return(alvo);
        }
コード例 #3
0
        public override OrdemServico AuditDefault(DomainBaseWithUserCreate entity, DomainBaseWithUserCreate entityOld)
        {
            var ordemServico = base.AuditDefault(entity, entityOld);

            if (ordemServico.Agenda.IsNotNull())
            {
                base.AuditDefault(ordemServico.Agenda, entityOld);
            }

            return(ordemServico);
        }
コード例 #4
0
        public override Cliente AuditDefault(DomainBaseWithUserCreate entity, DomainBaseWithUserCreate entityOld)
        {
            var alvo = base.AuditDefault(entity, entityOld);

            if (alvo.Pessoa.IsNotNull())
            {
                base.AuditDefault(alvo.Pessoa, entityOld);

                if (alvo.Pessoa.Endereco.IsNotNull())
                {
                    var alvoOld = entityOld as Cliente;
                    base.AuditDefault(alvo.Pessoa.Endereco, alvoOld?.Pessoa?.Endereco);
                }
            }

            return(alvo);
        }
コード例 #5
0
        public override Pendencia AuditDefault(DomainBaseWithUserCreate entity, DomainBaseWithUserCreate entityOld)
        {
            var result = base.AuditDefault(entity, entityOld);

            if (result.CollectionPendenciaEventos.IsAny())
            {
                foreach (var pe in result.CollectionPendenciaEventos.Where(_ => _.PendenciaEventosId == 0))
                {
                    pe.SetUserCreate(this._user.GetTenantId <int>());
                }
            }

            if (result.CollectionComentarios.IsAny())
            {
                foreach (var pe in result.CollectionComentarios.Where(_ => _.ComentarioId == 0))
                {
                    pe.SetUserCreate(this._user.GetTenantId <int>());
                }
            }

            if (result.CollectionPendenciaTempos.IsAny())
            {
                foreach (var pt in result.CollectionPendenciaTempos)
                {
                    if (pt.PendenciaTemposId == 0)
                    {
                        pt.SetUserCreate(this._user.GetTenantId <int>());
                    }
                    else
                    {
                        pt.SetUserUpdate(this._user.GetSubjectId <int>());
                    }
                }
            }

            return(result);
        }