示例#1
0
        protected void btnExcluir_Click(object sender, EventArgs e)
        {
            Orcamento    objOrcamento = new Orcamento();
            OrcamentoDAL dbOrcamento  = new OrcamentoDAL();

            if (!string.IsNullOrEmpty(txtCodigo.Text))
            {
                if (dbOrcamento.ExcluirProdutoPorIdOrcamento(Convert.ToInt32(txtCodigo.Text), ref erro))
                {
                    if (dbOrcamento.ExcluirOrcamento(Convert.ToInt32(txtCodigo.Text), ref erro))
                    {
                        Session.Add("success", "Orçamento Excluído com Sucesso! ");
                        limpa();
                    }
                    else
                    {
                        Session.Add("danger", "Não foi possível excluído o Orçamento " + erro);
                    }
                }
                else
                {
                    Session.Add("danger", "Não foi possível excluído o Orçamento " + erro);
                }
            }
        }
示例#2
0
        protected void btnRemover_Click(object sender, EventArgs e)
        {
            Orcamento    objOrcamento = new Orcamento();
            OrcamentoDAL dbOrcamento  = new OrcamentoDAL();

            if (!string.IsNullOrEmpty(hfCodigoProdutoOrcamento.Value))
            {
                if (dbOrcamento.ExcluirProdutoPorIdOrcamento(Convert.ToInt32(hfCodigoProdutoOrcamento.Value), ref erro))
                {
                    Session.Add("success", "Produto Excluído com Sucesso! ");
                    carregaGvProduto();
                }
                else
                {
                    Session.Add("danger", "Não foi possível excluído o Produto " + erro);
                }
            }
        }