Example #1
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            Contato objContato = new Contato();

            objContato.Nome     = txtNome.Text;
            objContato.Telefone = txtTelefone.Text;

            ContatoBLL.InserirContato(objContato);
        }
Example #2
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            List<Contato> listapessoas = new List<Contato>();

            Contato objContato = new Contato();
            objContato.Nome = txtNome.Text;
            objContato.Telefone = txtTelefone.Text;

            ContatoBLL.InserirContato(objContato);

            //SALVANDO NO GRID


            listapessoas.Add(NovaConta);
            gridagenda.DataSource = null;
            gridagenda.DataSource = listapessoas;
        }
Example #3
0
        private void Botao_Salvar_Click(object sender, EventArgs e)
        {
            Contato NovoContato = new Contato
            {
                Nome     = txtNome.Text,
                Obs      = txtObs.Text,
                Email    = txtEmail.Text,
                Celular  = txtDdd1.Text + txtCelular.Text,
                Telefone = txtDdd2.Text + txtTelefone.Text,
            };

            int resposta = ContatoBLL.InserirContato(NovoContato);

            if (resposta == -1)
            {
                MessageBox.Show("Preencha nome"); return;
            }
            if (resposta == -2)
            {
                MessageBox.Show("Preencha pelo menos um contato !"); return;
            }
            if (resposta == -3)
            {
                MessageBox.Show("Não podem haver letras no celular"); return;
            }
            if (resposta == -4)
            {
                MessageBox.Show("Preencha Celular Completamente"); return;
            }
            if (resposta == -5)
            {
                MessageBox.Show("Preencha Telefone Completamente"); return;
            }
            if (resposta == -6)
            {
                MessageBox.Show("Não podem haver letras no telefone"); return;
            }
        }