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); }
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); }
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); }
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); }
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); }