protected void btnGrabar_OnClick(object sender, EventArgs e)
    {
        Int32     retorno;
        UsuarioBL oUsuarioBL = new UsuarioBL();

        oUsuarioBL.ErrorEvent += new UsuarioBL.ErrorDelegate((Master as Seguridad).Transaction_ErrorEvent);

        SeguridadBL oSeguridadBL = new SeguridadBL();

        oSeguridadBL.ErrorEvent += new SeguridadBL.ErrorDelegate((Master as Seguridad).Transaction_ErrorEvent);

        CargaDesdeForm();

        if (!this.txtClave.Text.Trim().Equals(String.Empty))
        {
            this.oUsuarioBE.VUSR_PASS = oSeguridadBL.GetEncripta(this.oUsuarioBE.VUSR_PASS);
        }

        retorno = oUsuarioBL.GrabarUsuario(this.oUsuarioBE, Profile.Aplicacion);
        if (retorno > 0)
        {
            this.txhNidUsuario.Value = retorno.ToString();
            JavaScriptHelper.Alert(this, Message.keyGrabar, "");
            this.usuarioID = retorno;
            this.oUsuarioBE.Nid_usuario = this.usuarioID;
            CargaUsuario();
        }
        else
        {
            if (retorno == -5)
            {
                JavaScriptHelper.Alert(this, Message.keyLoginRepetido, "");
            }
            else if (retorno == -6)
            {
                JavaScriptHelper.Alert(this, Message.keyDNIRepetido, "");
            }
            else
            {
                JavaScriptHelper.Alert(this, Message.keyErrorGrabar, "");
            }
        }
    }