﻿// JScript File
var ruta = "";
var param = "status=no;dialogWidth=430px;dialogHeight=105px;help=no;close=no;resizable=no;scroll=no;unadorned=no";
//var param = 'status=no;dialogWidth=420px;dialogHeight=20px;toolbar=no;directories=no;menubar=no;scrollbars=no;resizable=no;modal=yes';
  
function Tabla_DblClickHandler(gridName, cellId)
{
    var renglon = igtbl_getRowById(cellId);
    var parametrosModal = 'status=no;dialogWidth=580px;dialogHeight=400px;help=no;close=no;scroll=no';
    var parametrosModal1 = 'status=no,Width=650px,Height=600px,help=no,close=no,scroll=yes';
  //  var parametrosModal3 = 'status=no;dialogWidth=900px;dialogHeight=550px;help=no;close=no;scroll=yes;';
    var parametrosModal4 = 'status=no,Width=800px,Height=250px;help=no;close=no;scroll=no;';
    var parametrosModal5 = 'status=no,Width=550px,Height=400px,help=no,close=no,scroll=yes';
    var parametrosModal3='left=50,top=50,width=900px,height=550,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no';
   
    switch(igtbl_getCellById(cellId).Column.Key)
    {
        case "PorcentajeAsistencia":
            //alert( renglon.getCellFromKey("IdCurso").getValue());
            //alert( renglon.getCellFromKey("IdParticipante").getValue());
            if (renglon.getCellFromKey("IdCurso").getValue() == null) return;
            window.open("Asistencia.aspx?IdCurso=" + renglon.getCellFromKey("IdCurso").getValue() + "&IdParticipante=" + renglon.getCellFromKey("IdParticipante").getValue() + "&IdKardex=" + renglon.getCellFromKey("IdKardex").getValue(), "", parametrosModal4);
            break;
        case "CalExamenPre":
            //alert( renglon.getCellFromKey("IdKuestionarioPre").getValue());
            if(renglon.getCellFromKey("IdKuestionarioPre").getValue() == null) return;
           window.open("CuestionariosContestados.aspx?IdKuestionarioPre=" + renglon.getCellFromKey("IdKuestionarioPre").getValue() + "&IdParticipante=" + renglon.getCellFromKey("IdParticipante").getValue() + "&UltimaVersionPre=" + renglon.getCellFromKey("UltimaVersionKuestionariosPre").getValue() + "&IdKardex=" + renglon.getCellFromKey("IdKardex").getValue()+"&TipoExamen=Pre.", "", parametrosModal1);
        break;
        case "CalExamenPost":
            //alert( renglon.getCellFromKey("IdKuestionarioPost").getValue());
            if(renglon.getCellFromKey("IdKuestionarioPost").getValue() == null) return;
            window.open("CuestionariosContestados.aspx?IdKuestionarioPost=" + renglon.getCellFromKey("IdKuestionarioPost").getValue() + "&IdParticipante=" + renglon.getCellFromKey("IdParticipante").getValue() + "&UltimaVersionPost=" + renglon.getCellFromKey("UltimaVersionKuestionariosPost").getValue() + "&IdKardex=" + renglon.getCellFromKey("IdKardex").getValue() + "&TipoExamen=Post.", "", parametrosModal1);
            break;
        case "CalDiagnostico":
            //alert(renglon.getCellFromKey("UltimaVersionKuestionariosDiagnostico").getValue());
            if (renglon.getCellFromKey("IdKuestionarioDiagnostico").getValue() == null) return;
            //alert(renglon.getCellFromKey("IdKuestionarioDiagnostico").getValue());
            //window.showModalDialog("DetalleDiagnostico.aspx?Idkuestionario=" + renglon.getCellFromKey("IdKuestionarioDiagnostico").getValue() + "&IdParticipante=" + renglon.getCellFromKey("IdParticipante").getValue() + "&UltimaVersionDiagnostico=" + renglon.getCellFromKey("UltimaVersionKuestionariosDiagnostico").getValue() + "&IdKardex=" + renglon.getCellFromKey("IdKardexDiagnostico").getValue(), "", parametrosModal5);
            window.open("DetalleDiagnostico.aspx?Idkuestionario=" + renglon.getCellFromKey("IdKuestionarioDiagnostico").getValue() + "&IdParticipante=" + renglon.getCellFromKey("IdParticipante").getValue() + "&UltimaVersionDiagnostico=" + renglon.getCellFromKey("UltimaVersionKuestionariosDiagnostico").getValue() + "&IdKardex=" + renglon.getCellFromKey("IdKardexDiagnostico").getValue(), "", parametrosModal5);
            break;
        case "NombreParticipante":
            var NombreParticipante=igtbl_getCellById(cellId).Row.getCellFromKey("NombreParticipante").getValue(); 
            if (igtbl_getCellById(cellId).Row.getCellFromKey("PC").getValue() == "0") {LlamarVentanaEmergente("El Participante no cuenta con rutas de certificacion.") ; return; }
            //  var IdRuta = "c4e888ab-ceab-44ca-ad25-3add7e4e25f6";
            var IdPaticipante = igtbl_getCellById(cellId).Row.getCellFromKey("IdParticipante").getValue();
            var IdCuentaParticipante = igtbl_getCellById(cellId).Row.getCellFromKey("IdCuentaParticipante").getValue();
            //window.showModalDialog("../MiCertificacion/MiCertificacionParticipante.aspx?IdParticipante=" + IdPaticipante + "&IdCuentaParticipante=" + IdCuentaParticipante + "&NombreParticipante=" + NombreParticipante, window, parametrosModal3);
            window.open("../MiCertificacion/MiCertificacionParticipante.aspx?IdParticipante=" + IdPaticipante + "&IdCuentaParticipante=" + IdCuentaParticipante ,"", parametrosModal3);
            break;
    }
}
 function Cerrar(event) {
            if(event.Resultado)
              window.close();
        } 
function notext(e) {


    return false;
}
function LlamarVentanaEmergente(Mensaje) {
    window.showModalDialog("../VentanasDialogo/MensajesDialogo.aspx?IdMensaje="+Mensaje.toString(), "", param);
}
function solonumeros(e) {

    var key;

    if (window.event) // IE
    {
        key = e.keyCode;
    }
    else if (e.which) // Netscape/Firefox/Opera
    {
        key = e.which;
    }

    if (key < 48 || key > 57) {
        return false;
    }

    return true;
}

function soloLetras(e) {
   
   var key;
//60,62,38,47,92,183,35
    if (window.event) // IE
    {
        key = e.keyCode;
    }
    else if (e.which) // Netscape/Firefox/Opera
    {
        key = e.which;
    }

    if (key == 60 || key ==62 ||key == 38|| key ==47||key == 92 || key ==183||key == 35) {
        return false;
    }

    return true;
}

function AbrirVentanaDatosEmpresa(id) {
    var parametrosModal = 'status=no;dialogWidth=800px;dialogHeight=400px;help=no;close=no;scroll=no';
    window.showModalDialog("../MiCuenta/MostrarVentanaDatosEmpresaCRM.aspx?Id=" + id, window, parametrosModal);
   
}




