private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (txtRol.Text == "")
            {
                ErrorProvider.SetError(txtRol, "Campo necesario");
                ErrorProvider.SetIconAlignment(txtRol, ErrorIconAlignment.MiddleRight);
                txtRol.Focus();
            }
            else
            {
                roles nRol = new Modelo.roles();
                nRol.sNombre = txtRol.Text.Trim();

                ControladorRol cRol = new ControladorRol();
                cRol.Guardar(nRol);

                wMain.cargarRoles();
                this.Close();
            }
        }
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (txtRol.Text == "")
            {
                ErrorProvider.SetError(txtRol, "Campo necesario");
                ErrorProvider.SetIconAlignment(txtRol, ErrorIconAlignment.MiddleRight);
                txtRol.Focus();
            }
            else
            {
                roles nroles = new Modelo.roles();
                nroles.pkRol   = frmMainRoles.PKROLES;
                nroles.sNombre = txtRol.Text;

                ControladorRol croles = new ControladorRol();
                croles.Modificar(nroles);

                wMain.cargarRoles();
                this.Close();
            }
        }
 public frmNuevoRol(frmMainRoles wmain)
 {
     InitializeComponent();
     wMain = wmain;
     wMain.cargarRoles();
 }
 public frmModificarRoles(frmMainRoles wmain)
 {
     InitializeComponent();
     wMain = wmain;
     wMain.cargarRoles();
 }