예제 #1
0
        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;
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
        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;
        }
예제 #4
0
        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;
            }
        }