AerolineaFrba.Abm_Rol.Modificacion.button2_Click C# (CSharp) Method

button2_Click() private method

private button2_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void button2_Click(object sender, EventArgs e)
        {
            if (datosCorrectos())
            {
                if ( String.Compare(txtRolSeleccionado.Text , "Administrador" , false) == 0 && txtRolSeleccionado.Text != txtNombre.Text)
                {
                    MessageBox.Show("No se puede modificar el nombre del rol Administrador" , "Informe" , MessageBoxButtons.OK);
                    return;
                }
                if (this.ExisteNombreRol())
                {
                    if (txtNombre.Text != txtRolSeleccionado.Text)
                    {
                        MessageBox.Show("El nombre ingresado ya existe. No es posible dar de alta el rol", "Informe", MessageBoxButtons.OK);
                        return;
                    }
                }
                this.realizarModificacion();

            }
        }