Ejemplo n.º 1
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            Categoria unaCategoria = new Categoria();

            unaCategoria.nombre      = txtNombre.Text;
            unaCategoria.descripcion = txtDescripcion.Text;
            unaCategoria.id          = txtCodigo.Text;
            int intRegsAffected = CategoriasManager.Insertar(unaCategoria);

            if (intRegsAffected > 0)
            {
                ElementoPila elemento = pila.Pop();
                if (elemento.nombreForm == "NuevoLibro")
                {
                    pila.Push(elemento);
                    Funciones.agregarParaLibro(pila, this);
                }
                else
                {
                    pila.Push(elemento);
                    DetalleCategoria formulario = new DetalleCategoria(unaCategoria.id, pila);
                    Funciones.cambiarFormA(this, formulario);
                }
            }
        }
Ejemplo n.º 2
0
        private void btnAgregar_Click_2(object sender, EventArgs e)
        {
            Editorial unaEditorial = new Editorial();

            unaEditorial.nombre = txtNombre.Text;
            unaEditorial.id     = txtCodigo.Text;
            int          intRegsAffected = EditorialesManager.Insertar(unaEditorial);
            ElementoPila elemento        = pila.Pop();

            if (elemento.nombreForm == "NuevoLibro")
            {
                pila.Push(elemento);
                Funciones.agregarParaLibro(pila, this);
            }
            else
            {
                pila.Push(elemento);
                DetalleEditorial formulario = new DetalleEditorial(unaEditorial.id, pila);
                Funciones.cambiarFormA(this, formulario);
            }
        }
Ejemplo n.º 3
0
        private void btnAgregar_Click_1(object sender, EventArgs e)
        {
            Autor unAutor = new Autor();

            unAutor.nombre = txtNombre.Text;
            unAutor.id     = txtCodigo.Text;
            int intRegsAffected = AutoresManager.Insertar(unAutor);

            if (intRegsAffected > 0)
            {
                ElementoPila elemento = pila.Pop();
                if (elemento.nombreForm == "NuevoLibro")
                {
                    pila.Push(elemento);
                    Funciones.agregarParaLibro(pila, this);
                }
                else
                {
                    DetalleAutor formulario = new DetalleAutor(unAutor.id, pila);
                    pila.Push(elemento);
                    Funciones.cambiarFormA(this, formulario);
                }
            }
        }