Exemplo n.º 1
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            Autor autor = new Autor();

            autor.Escritor         = txtNombre.Text;
            autor.Nacionalidad     = txtNacionalidad.Text;
            autor.Fecha_Nacimiento = dtpFecha.Value.Date;
            Autor.AgregarAutor(autor);

            LimpiarFormulario();
            ActualizarListaAutor();
        }
Exemplo n.º 2
0
        private void btnAgregar2_Click(object sender, EventArgs e)
        {
            try
            {
                if (ValidarCampos())
                {
                    Autor autor = new Autor();
                    autor.nroDocumento = txtNroDocumento.Text;
                    autor.nombre       = txtNombre.Text;
                    autor.direccion    = txtDireccion.Text;
                    autor.telefono     = txtTelefono.Text;



                    Autor.AgregarAutor(autor);
                    LimpiarFormulario();
                    ActualizarListaAutores();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }