예제 #1
0
        private void btnInserirContato_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(NomeContato.Text) ||
                String.IsNullOrEmpty(EmailContato.Text) ||
                (String.IsNullOrEmpty(CelularContato.Text) && String.IsNullOrEmpty(Telefonecontato.Text)))
            {
                MessageBox.Show("Nome, E-Mail e ao menos um contato telefonico são obrigatórios!");
            }
            else
            {
                var pessoaContato = new PessoaContato
                {
                    Nome      = NomeContato.Text,
                    Email     = EmailContato.Text,
                    Celular   = CelularContato.Text,
                    Telefone  = Telefonecontato.Text,
                    IdCliente = cliente.Id
                };

                PessoaContatoBLL.SalvarContato(pessoaContato);

                CarregaDadosCliente();
            }
        }