Exemplo n.º 1
0
        private void btnSalvar_Click_1(object sender, EventArgs e)
        {
            Veiculo        c   = new Veiculo();
            CadVeiculosBLL BLL = new CadVeiculosBLL();

            c = TelaToEntity();

            if (BLL.Cadastra(c))
            {
                MessageBox.Show("Cadastro Realizado com Sucesso");
                LimpaTela();
            }
            else
            {
                MessageBox.Show("Verifique os campos Obrigatórios");
                MensagemErro();
            }

            MensagemErro();
        }
Exemplo n.º 2
0
        private void btnAnterior_Click(object sender, EventArgs e)
        {
            CadVeiculosBLL BLL = new CadVeiculosBLL();
            Veiculo        c   = new Veiculo();

            c = TelaToEntity();

            c = BLL.BuscaAnt(c);

            if (c != null)
            {
                LimpaTela();
                EntityToTela(c);
            }
            else
            {
                MessageBox.Show("Erro ao Buscar, Reinicie o Programa, se Persistir entre em contato com o Suporte");
            }
            MensagemErro();
        }
Exemplo n.º 3
0
        private void btnApagar_Click(object sender, EventArgs e)
        {
            DialogResult Result = MessageBox.Show("Realmente deseja Excluir? A Exclusão pode ocasionar inconsistencia no Banco de Dados! ", "Importante", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (Result == DialogResult.Yes)
            {
                CadVeiculosBLL BLL = new CadVeiculosBLL();
                Veiculo        c   = new Veiculo();
                c = TelaToEntity();
                if (BLL.Apaga(c.Placa))
                {
                    MessageBox.Show("Deletado com Sucesso");
                }
                else
                {
                    MessageBox.Show("O Veiculo não poderá ser excluido, ou Selecione um cliente Válido!");
                }

                LimpaTela();
                MensagemErro();
            }
        }