private void btnEliminar_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(nudID.Value);

            if (LibrosBLL.Eliminar(id))
            {
                MessageBox.Show("Eliminado!");
            }
            else
            {
                MessageBox.Show("No se puede encontrar el registro con id: " + id);
            }
        }
        private void Eliminar_Click(object sender, EventArgs e)
        {
            int id;

            int.TryParse(IDNumericoUpDowm.Text, out id);
            if (!EliminarValidar())
            {
                return;
            }
            if (LibrosBLL.Eliminar(id))
            {
                MessageBox.Show("Libro Eliminado", "Exito", MessageBoxButtons.OK);
            }
            else
            {
                MessageBox.Show("No se pudo eliminar el libro", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#3
0
        private void Eliminarbutton_Click(object sender, EventArgs e)
        {
            errorProvider.Clear();
            int id;

            int.TryParse(IDLibronumericUpDown.Text, out id);

            if (!ExisteEnLaBaseDeDatos())
            {
                errorProvider.SetError(IDLibronumericUpDown, "No se puede eliminar una persona que no existe");
                return;
            }
            if (LibrosBLL.Eliminar(id))
            {
                Limpiar();
                MessageBox.Show("Eliminado");
            }
        }
示例#4
0
        private void buttonEliminar_Click(object sender, EventArgs e)
        {
            if (Validar(1))
            {
                MessageBox.Show("Ingresar un ID");
                return;
            }
            int id = Convert.ToInt32(TipoId_numericUpDown.Value);

            if (LibrosBLL.Eliminar(id))
            {
                LimpiarCampos();
                MessageBox.Show("Eliminado!!", "Exito",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("No se pudo eliminar!!", "Fallo",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#5
0
        private void EliminarButton_Click(object sender, EventArgs e)
        {
            int    id     = Convert.ToInt32(LibrosIdNumericUpDown.Value);
            Libros libros = LibrosBLL.Buscar(id);

            if (libros != null)
            {
                if (LibrosBLL.Eliminar(id))
                {
                    MessageBox.Show("Eliminado!!", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Limpiar();
                }
                else
                {
                    MessageBox.Show("No se pudo eliminar!!", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("El Id no existe", "Falló", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }