private void btnGuardar_Click(object sender, EventArgs e) { try { RolDAL roldal = new RolDAL(); Rol rol = new Rol(); if (textBox1.Text != "") { if (RolDAL.RolId(textBox1.Text) > 0) { MessageBox.Show("Error. Nombre del rol ya existente"); } else { rol.Nombre = textBox1.Text; int res = RolDAL.insert(rol.Nombre); MessageBox.Show("Rol registrados Correctamente!"); if (res > 0) { int resultado = agregarFuncionalidades(res); } } } else { MessageBox.Show("Debe ingresar un nombre de ROL"); } } catch (Exception ex) { MessageBox.Show("Error en el alta de rol -" + ex.Message); } }