コード例 #1
0
    public void RaiseCallbackEvent(string eventArg)
    {
        string sResultado = "";

        //1º Si hubiera argumentos, se recogen y tratan.
        //string MisArg = eventArg;
        string[] aArgs = Regex.Split(eventArg, @"@#@");
        sResultado = aArgs[0] + @"@#@"; if (Session["IDRED"] == null)
        {
            _callbackResultado = aArgs[0] + @"@#@Error@#@SESIONCADUCADA"; return;
        }
        ;

        try
        {
            //2º Aquí realizaríamos el acceso a BD, etc,...
            switch (aArgs[0])
            {
            case ("cargarFormacionAcad"):
                sResultado += "OK@#@" + TituloFicepi.MiCvTitulacion(int.Parse(hdnIdficepi.Value)) + "@#@" + Curriculum.MiCVPendientes(int.Parse(hdnIdficepi.Value)).ToString();
                break;

            case ("cargarCursos"):
                sResultado += "OK@#@" + Curso.MiCVFormacionRecibida(int.Parse(hdnIdficepi.Value)) + "@#@" + Curriculum.MiCVPendientes(int.Parse(hdnIdficepi.Value)).ToString();
                break;

            case ("cargarCursosImpartidos"):
                sResultado += "OK@#@" + Curso.MiCVFormacionImpartida(int.Parse(hdnIdficepi.Value)) + "@#@" + Curriculum.MiCVPendientes(int.Parse(hdnIdficepi.Value)).ToString();
                break;

            case ("cargarCertExam"):
            case ("reCargarCertExam"):
                sResultado += "OK@#@" + Certificado.MiCVFormacionCertExam(int.Parse(hdnIdficepi.Value), (hdnEsEncargado.Value == "1") ? true : false) + "@#@" + Curriculum.MiCVPendientes(int.Parse(hdnIdficepi.Value)).ToString();
                break;

            case ("cargarExam"):
            case ("reCargarExam"):
                //sResultado += "OK@#@" + Certificado.MiCVFormacionExam(int.Parse(hdnIdficepi.Value), (hdnEsEncargado.Value == "1") ? true : false) + "@#@" + Curriculum.MiCVPendientes(int.Parse(hdnIdficepi.Value)).ToString();
                sResultado += "OK@#@" + Examen.MiCVFormacionExam(int.Parse(hdnIdficepi.Value)) + "@#@" + Curriculum.MiCVPendientes(int.Parse(hdnIdficepi.Value)).ToString();
                break;

            case ("cargarIdiomas"):
                sResultado += "OK@#@" + Idioma.MiCvIdiomas(int.Parse(hdnIdficepi.Value)) + "@#@" + Curriculum.MiCVPendientes(int.Parse(hdnIdficepi.Value)).ToString();
                break;

            case ("cargarTitulos"):
                sResultado += "OK@#@" + TituloIdiomaFic.MiCVCatalogo(int.Parse(hdnIdficepi.Value), int.Parse(aArgs[2])) + "@#@" + aArgs[1] + "@#@" + Curriculum.MiCVPendientes(int.Parse(hdnIdficepi.Value)).ToString();
                break;

            case ("cargarExpIb"):
                sResultado += "OK@#@" + SUPER.BLL.EXPPROF.MiCVExpProfEnIbermatica(int.Parse(hdnIdficepi.Value)) + "@#@" +
                              Curriculum.MiCVPendientes(int.Parse(hdnIdficepi.Value)).ToString();
                break;

            case ("cargarExpNoIb"):
                sResultado += "OK@#@" + SUPER.BLL.EXPPROF.MiCVExpProfFueraIbermatica(int.Parse(hdnIdficepi.Value)) + "@#@" +
                              Curriculum.MiCVPendientes(int.Parse(hdnIdficepi.Value)).ToString();
                break;

            case ("grabar"):
                Curriculum.Grabar(null, aArgs[1], int.Parse(hdnIdficepi.Value), (aArgs[3] == "") ? null : (bool?)bool.Parse(aArgs[3].ToString()), (aArgs[2] == "") ? null : (int?)int.Parse(aArgs[2]), aArgs[4].ToString());
                sResultado += "OK@#@";
                break;

            case ("borrarForAcad"):
                sResultado += TituloFicepi.Borrar(aArgs[1], int.Parse(hdnIdficepi.Value), int.Parse(Session["IDFICEPI_ENTRADA"].ToString()));
                break;

            case ("borrarForRec"):
                sResultado += Curso.BorrarAsistente(int.Parse(aArgs[1]), aArgs[2], int.Parse(Session["IDFICEPI_ENTRADA"].ToString()));
                break;

            case ("borrarForImp"):
                sResultado += Curso.BorrarMonitor(aArgs[1], int.Parse(hdnIdficepi.Value), int.Parse(Session["IDFICEPI_ENTRADA"].ToString()));
                break;

            case ("borrarCertif"):
                //if (SUPER.BLL.Certificado.TieneExamenesValidados(int.Parse(aArgs[1]), aArgs[2]))
                //    sResultado +="KO@#@S";
                //else
                sResultado += Certificado.BorrarAsistente(aArgs[1], int.Parse(aArgs[2]), aArgs[3], int.Parse(Session["IDFICEPI_ENTRADA"].ToString()));
                break;

            case ("borrarIdioma"):
                sResultado += IdiomaFic.Borrar(int.Parse(aArgs[1]), aArgs[2], int.Parse(Session["IDFICEPI_ENTRADA"].ToString()));
                break;

            case ("borrarExamen"):
                sResultado += SUPER.BLL.Examen.BorrarAsistentes(int.Parse(aArgs[1]), aArgs[2], int.Parse(Session["IDFICEPI_ENTRADA"].ToString()));
                break;

            case ("borrarExpIber"):
            case ("borrarExpNoIber"):
                sResultado += SUPER.BLL.EXPPROF.Borrar(aArgs[2], int.Parse(aArgs[1]), int.Parse(Session["IDFICEPI_ENTRADA"].ToString()));
                break;

            case ("FinCV"):
                sResultado += Curriculum.FinalizacionCv(int.Parse(aArgs[1]), Utilidades.unescape(aArgs[2]), aArgs[3]);
                break;

            case ("setCompletadoProf"):
                sResultado += Curriculum.setCompletadoProf(int.Parse(aArgs[1]));
                break;

            case ("setRevisadoActualizadoCV"):
                sResultado += Curriculum.setRevisadoActualizadoCV(int.Parse(aArgs[1]));
                break;

            case ("cargarSinopsis"):
                sResultado += "OK@#@" + Curriculum.getSinopsis(int.Parse(hdnIdficepi.Value));
                break;

            case ("grabarS"):    //grabar sinopsis
                Curriculum.GrabarSinopsis(int.Parse(hdnIdficepi.Value), aArgs[1]);
                sResultado += "OK";
                break;
            }
        }
        catch (Exception ex)
        {
            sResultado += "Error@#@" + Errores.mostrarError("Error al cargar datos", ex);
        }
        //3º Damos contenido a la variable que se envía de vuelta al cliente.
        _callbackResultado = sResultado;
    }