private void btnEliminarUnidadInterna_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (DataGridViewRow row in grdUnidadInterna.Rows)
                {
                    if (row.Selected)
                    {
                        int id = Convert.ToInt32(row.Cells[0].Value.ToString());
                        UnidadInternaBLL unidad = new UnidadInternaBLL();
                        int eliminar            = unidad.eliminar(id);

                        if (eliminar == 1)
                        {
                            MessageBox.Show("Permiso Eliminado");
                            this.Hide();
                            frmMantenedorPermisos mp = new frmMantenedorPermisos();
                            mp.Show();
                        }
                        else
                        {
                            MessageBox.Show("Permiso no eliminado");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Se produjo un error: " + ex.ToString());
            }
        }
        private void btnAgregarUnidadInterna_Click(object sender, EventArgs e)
        {
            if (txtDescUnidadInterna.Text == "")
            {
                MessageBox.Show("Todos los valores son requeridos");
                return;
            }
            int    idPermiso    = Convert.ToInt32(1);
            string recursoLegal = txtDescUnidadInterna.Text;

            UnidadInternaBLL unidad = new UnidadInternaBLL();
            int agregar             = unidad.agregar(idPermiso, recursoLegal);

            if (agregar == 1)
            {
                MessageBox.Show("Permiso Agregado");
                this.Hide();
                frmMantenedorPermisos mp = new frmMantenedorPermisos();
                mp.Show();
            }
            else
            {
                MessageBox.Show("Permiso no Agregado");
            }
        }
        private void btnActualizarUnidadInterna_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (DataGridViewRow row in grdPermisos.Rows)
                {
                    if (row.Selected)
                    {
                        int              id         = Convert.ToInt32(row.Cells[0].Value.ToString());
                        string           desc       = row.Cells[1].Value.ToString();
                        UnidadInternaBLL unidad     = new UnidadInternaBLL();
                        int              actualizar = unidad.actualizar(id, desc);

                        if (actualizar == 1)
                        {
                            MessageBox.Show("Permiso Actualizado");
                            grdPermisos.Refresh();
                        }
                        else
                        {
                            MessageBox.Show("Permiso no Actualizado");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Se produjo un error: " + ex.ToString());
            }
        }