Example #1
0
        public override void Delete()
        {
            if (this.IDTabela == null)
            {
                throw new TradeVisionValidationError("Id tabela não encontrado.");
            }

            this.Get();

            if (this.Campos.Count > 0)
            {
                throw new TradeVisionValidationError("A tabela (" + this.Descricao + ") contem campos que precisam ser apagados antes de apagar a tabela");
            }


            try
            {
                this.IsTransaction = true;
                var tabelaCliente = new TabelaCliente();
                tabelaCliente.Transaction = this.Transaction;
                tabelaCliente.Tabela      = this;
                tabelaCliente.Delete();

                base.Delete();
                this.Commit();
            }
            catch (Exception err)
            {
                this.Rollback();
                throw err;
            }
        }
Example #2
0
        public void CreateTabelaDinamica()
        {
            var tabela = new Tabela();

            tabela.Descricao = "TabelaPessoaFisica" + Cliente.Current().Nome;
            tabela.Save();

            var tabelaCliente = new TabelaCliente(Cliente.Current());

            tabelaCliente.Tabela     = tabela;
            tabelaCliente.TipoPessoa = TipoPessoa.Fisica;
            tabelaCliente.Save();
        }
Example #3
0
        public void CreateTabelaDinamica()
        {
            var tabela = new Tabela();
            tabela.Descricao = "TabelaPessoaFisica" + Cliente.Current().Nome;
            tabela.Save();

            var tabelaCliente = new TabelaCliente(Cliente.Current());
            tabelaCliente.Tabela = tabela;
            tabelaCliente.TipoPessoa = TipoPessoa.Fisica;
            tabelaCliente.Save();
        }
Example #4
0
        public override void Delete()
        {
            if (this.IDTabela == null)
                throw new TradeVisionValidationError("Id tabela não encontrado.");

            this.Get();

            if (this.Campos.Count > 0)
                throw new TradeVisionValidationError("A tabela (" + this.Descricao + ") contem campos que precisam ser apagados antes de apagar a tabela");

            try
            {
                this.IsTransaction = true;
                var tabelaCliente = new TabelaCliente();
                tabelaCliente.Transaction = this.Transaction;
                tabelaCliente.Tabela = this;
                tabelaCliente.Delete();

                base.Delete();
                this.Commit();
            }
            catch (Exception err)
            {
                this.Rollback();
                throw err;
            }
        }