public override void Delete() { if (this.IDCampo == null) { throw new TradeVisionValidationError("Id campo não encontrado."); } this.Get(); if (this.Opcoes.Count > 0) { throw new TradeVisionValidationError("A campo (" + this.Nome + ") contem opções que precisam ser apagados antes de apagar o campo"); } try { this.IsTransaction = true; var campoValor = new CampoValor(); campoValor.Transaction = this.Transaction; campoValor.Campo = this; campoValor.Delete(); base.Delete(); this.Commit(); } catch (Exception err) { this.Rollback(); throw err; } }
public CampoValor Valor(Pessoa pessoa) { if (this.valor == null) { this.valor = new CampoValor(); this.valor.Pessoa = pessoa; if (this.valor.Pessoa != null) { this.valor.Campo = this; this.valor.Transaction = this.Transaction; this.valor.Get(); } } return(this.valor); }
public CampoValor Valor(Pessoa pessoa) { if (this.valor == null) { this.valor = new CampoValor(); this.valor.Pessoa = pessoa; if (this.valor.Pessoa != null) { this.valor.Campo = this; this.valor.Transaction = this.Transaction; this.valor.Get(); } } return this.valor; }
public override void Delete() { if (this.IDCampo == null) throw new TradeVisionValidationError("Id campo não encontrado."); this.Get(); if (this.Opcoes.Count > 0) throw new TradeVisionValidationError("A campo (" + this.Nome + ") contem opções que precisam ser apagados antes de apagar o campo"); try { this.IsTransaction = true; var campoValor = new CampoValor(); campoValor.Transaction = this.Transaction; campoValor.Campo = this; campoValor.Delete(); base.Delete(); this.Commit(); } catch (Exception err) { this.Rollback(); throw err; } }