public void RaiseCallbackEvent(string eventArg) { string sResultado = "", sCad = ""; //1º Si hubiera argumentos, se recogen y tratan. //string MisArg = eventArg; string[] aArgs = Regex.Split(eventArg, "@#@"); sResultado = aArgs[0] + @"@#@"; if (Session["GVT_IDRED"] == null) { _callbackResultado = aArgs[0] + @"@#@Error@#@SESIONCADUCADA"; return; } ; //2º Aquí realizaríamos el acceso a BD, etc,... switch (aArgs[0]) { case ("tramitar"): try { sResultado += "OK@#@" + CABECERAGV.TramitarNotaMultiProyecto(aArgs[1], aArgs[2], aArgs[3]); } catch (Exception ex) { string[] aMsg = Regex.Split(ex.Message, "##EC##"); if (aMsg[0] == "ErrorControlado") { sResultado += "Error@#@" + aMsg[1]; } else { sResultado += "Error@#@" + Errores.mostrarError("Error al tramitar la solicitud multiproyecto.", ex); } } break; case ("aparcar"): try { sResultado += "OK@#@" + CABECERAAPARCADA_NMPGV.AparcarNotaMultiProyecto(aArgs[1], aArgs[2]); } catch (Exception ex) { if (ex.Message == "Solicitud aparcada no existente") { sResultado += "OK@#@" + ex.Message; } else { sResultado += "Error@#@" + Errores.mostrarError("Error al aparcar la solicitud multiproyecto.", ex); } } break; //case ("tarearecurso"): // sResultado += ObtenerDatosTareaRecurso(aArgs[1], aArgs[2]); // break; case ("getDatosPestana"): switch (int.Parse(aArgs[1])) { case 0: //Gastos //nada porque al ser la primera pestaña se carga directamente en el Page_Load break; case 1: //Anticipos //sCad = ObtenerRecursosAsociados(aArgs[2], aArgs[4], false); if (sCad.IndexOf("Error@#@") >= 0) { sResultado += sCad; } else { sResultado += "OK@#@" + aArgs[1] + "@#@" + sCad; } break; case 2: //Otros datos //sCad = ObtenerRecursosAsociados(aArgs[2], aArgs[4], false); if (sCad.IndexOf("Error@#@") >= 0) { sResultado += sCad; } else { sResultado += "OK@#@" + aArgs[1] + "@#@" + sCad; } break; } break; case ("eliminar"): try { CABECERAAPARCADA_NMPGV.Eliminar(int.Parse(aArgs[1])); sResultado += "OK@#@"; } catch (Exception ex) { sResultado += "Error@#@" + Errores.mostrarError("Error al eliminar la solicitud multiproyecto.", ex); } break; case ("getDatosBeneficiario"): try { sResultado += "OK@#@" + ObtenerDatosBeneficiario(int.Parse(aArgs[1])); } catch (Exception ex) { sResultado += "Error@#@" + Errores.mostrarError("Error al obtener los datos del beneficiario.", ex); } break; case ("getDatosEmpresas"): try { sResultado += "OK@#@" + ObtenerDatosEmpresas(int.Parse(aArgs[1])); } catch (Exception ex) { sResultado += "Error@#@" + Errores.mostrarError("Error al obtener los datos del beneficiario.", ex); } break; } //3º Damos contenido a la variable que se envía de vuelta al cliente. _callbackResultado = sResultado; }