示例#1
0
        private void butAgregar_Click(object sender, EventArgs e)
        {
            String titulo = txtTitulo.Text;
            String anho   = txtAnho.Text;
            String autor  = txtAutor.Text;
            String tipo   = comboBoxTipo.Text;


            if (titulo == "" || anho == "" || autor == "" || tipo == "")
            {
                MessageBox.Show("Algún campo se encuentra sin llenar");
            }
            else
            {
                if (tipo == "Físico")
                {
                    conexionPrincipal.AgregarLibros(titulo, autor, anho, "Físico");
                }
                else
                {
                    conexionPrincipal.AgregarLibros(titulo, autor, anho, "Digital");
                }
            }


            limpiar limparTxt = new limpiar();

            limparTxt.borrarCampos(this);
        }
示例#2
0
        private void butSelectA_Click(object sender, EventArgs e)
        {
            int   fila = tabla.CurrentRow.Index;
            Libro p    = principal.BuscarEnTablaFisicos(fila);

            principal.EliminarLibros(p.Titulo, p.Tipo);
            p.Tipo = Libro.digital;
            principal.AgregarLibros(p.Titulo, p.Autor, p.Anho, p.Tipo);
            refrescarFisicos();
        }
        private void butAgregar_Click(object sender, EventArgs e)
        {
            if (txtTitulo.Text == "" || txtAnho.Text == "" || txtAutor.Text == "")
            {
                MessageBox.Show("Algún campo se encuentra sin llenar");
            }
            if (checkBoxFisico.Checked == false)
            {
                MessageBox.Show("Solo puedes agendar libros que estan en físico");
            }
            else
            {
                conexionInterfazPrincipal.AgregarLibros(txtTitulo.Text, txtAutor.Text, txtAnho.Text, Libro.fisico);
            }
            limpiar limpiarBox = new limpiar();

            limpiarBox.borrarCampos(this);
        }