public void cargarCombos() { cboTipo.DataSource = TituloFicepi.obtenerTipos(); cboTipo.DataValueField = "sValor"; cboTipo.DataTextField = "sDenominacion"; cboTipo.DataBind(); cboModalidad.DataSource = TituloFicepi.obtenerModalidades(); cboModalidad.DataValueField = "sValor"; cboModalidad.DataTextField = "sDenominacion"; cboModalidad.DataBind(); cboInicio.DataSource = TituloFicepi.obtenerAños(); cboInicio.DataValueField = "sValor"; cboInicio.DataTextField = "sDenominacion"; cboInicio.DataBind(); cboFin.DataSource = cboInicio.DataSource; cboFin.DataValueField = "sValor"; cboFin.DataTextField = "sDenominacion"; cboFin.DataBind(); }
public void cargarDatos(int idTitulacionFicepi) { try { TituloFicepi tf = TituloFicepi.Select(idTitulacionFicepi); txtTitulo.Value = tf.T019_DESCRIPCION.ToString(); hdnIdTituloficepi.Value = tf.T012_IDTITULOFICEPI.ToString(); hdnIdtitulacion.Value = tf.T019_IDCODTITULO.ToString(); hdnIdtitulacionIni.Value = tf.T019_IDCODTITULO.ToString(); if (tf.t019_tipo != null) { cboTipo.SelectedValue = tf.t019_tipo.ToString(); } if (tf.t019_modalidad != null) { cboModalidad.SelectedValue = tf.t019_modalidad.ToString(); } if (tf.T839_IDESTADO != "B") { cboTipo.Enabled = false; cboModalidad.Enabled = false; chkTIC.Disabled = true; } //Revisar. Poner un solo radio button con dos opciones. chkTIC.Checked = tf.t019_tic; chkFinalizado.Checked = tf.T012_FINALIZADO; txtEspecialidad.Text = tf.T012_ESPECIALIDAD.ToString(); txtCentro.Text = tf.T012_CENTRO.ToString(); if (tf.T012_INICIO != null) { cboInicio.SelectedValue = tf.T012_INICIO.ToString(); } if (tf.T012_FIN != null) { cboFin.SelectedValue = tf.T012_FIN.ToString(); } txtObservaciones.Text = tf.T012_OBSERVA.ToString(); hdnEstadoInicial.Value = tf.T839_IDESTADO.ToString(); if (tf.T019_ESTADO) { hdnTituloEstadoIni.Value = "V";//Validado } else { hdnTituloEstadoIni.Value = "N";//No Validado } //txtMotivoRT.Text = tf.t597_motivort.ToString(); if (tf.T839_IDESTADO == "S" || tf.T839_IDESTADO == "T") //Pendiente de cumplimentar. { //imgEstado.Attributes.Add("title", tf.t597_motivort.ToString()); //imgEstado.Attributes.Add("onmouseover", "showTTE(\"" + Utilidades.escape(tf.t597_motivort.ToString()) + "\",\"Motivo\",null,300)"); //imgEstado.Attributes.Add("onmouseout", "hideTTE()"); imgInfoEstado.Style.Add("visibility", "visible"); imgInfoEstado.Attributes.Add("onmouseover", "showTTE(\"" + Utilidades.escape(tf.t597_motivort.ToString()) + "\",\"Motivo\",null,300)"); imgInfoEstado.Attributes.Add("onmouseout", "hideTTE()"); } if (tf.T839_IDESTADO != "V") { imgEstado.Attributes.Add("onmouseover", "showTTE(\"" + Utilidades.escape(Curvit.ToolTipEstados(tf.T839_IDESTADO)) + "\",\"Información\",null,300)"); imgEstado.Attributes.Add("onmouseout", "hideTTE()"); } //if (tf.T012_DOCTITULO != null) if (tf.t2_iddocumento != null) { txtNombreDocumento.Text = tf.T012_NDOCTITULO; imgUploadDoc.Style.Add("display", "inline-block"); imgDownloadDoc.Style.Add("display", "inline-block"); imgBorrarDoc.Style.Add("display", "inline-block"); imgDownloadDoc.Attributes.Add("onclick", "descargar('CVTDOCTIT','" + tf.T012_IDTITULOFICEPI.ToString() + "')"); } //if (tf.T012_DOCEXPDTE != null) if (tf.t2_iddocumentoExpte != null) { txtNombreExpediente.Text = tf.T012_NDOCEXPDTE; imgUploadExp.Style.Add("display", "inline-block"); imgDownloadExp.Style.Add("display", "inline-block"); imgBorrarExp.Style.Add("display", "inline-block"); imgDownloadExp.Attributes.Add("onclick", "descargar('CVTDOCEX','" + tf.T012_IDTITULOFICEPI.ToString() + "')"); } this.hdnNombreDocInicial.Value = tf.T012_NDOCTITULO; this.hdnContentServer.Value = tf.t2_iddocumento.ToString(); this.hdnNombreDocInicialExpte.Value = tf.T012_NDOCEXPDTE; this.hdnContentServerExpte.Value = tf.t2_iddocumentoExpte.ToString(); } catch (Exception ex) { hdnErrores.Value = Errores.mostrarError("Error al cargar datos", ex); } }
public string Grabar(string t012_idtituloficepi, int idFicepi, string sIdTitulacion, string sTitulo, string sTipo, string sModalidad, string sTic, string sFinalizado, string sEspecialidad, string sCentro, string sInicio, string sFin, string sNombreDoc, string sNombreExp, string sObs, string sEstadoNuevo, string sMotivoR, string sCambioDoc, string sCambioExpte, string sEstadoInicial, string sOperacion, short idTitulacionIni, string sUsuTickTit, string sUsuTickExpte, string sIdContentServer, string sIdContentServerExpte, string sEsMiCV) { string sRes = "OK@#@"; try { long?idContentServer = null; long?idContentServerExpte = null; #region Atenea if (sUsuTickTit.Trim() != "" && sNombreDoc.Trim() != "")//Recupero el idDocumento de la tabla Temporal { SUPER.DAL.DocuAux oDoc = SUPER.DAL.DocuAux.GetDocumento(null, sUsuTickTit); idContentServer = oDoc.t2_iddocumento; } else { if (sIdContentServer != "") { idContentServer = long.Parse(sIdContentServer); } } if (sUsuTickExpte.Trim() != "" && sNombreExp.Trim() != "")//Recupero el idDocumento de la tabla Temporal { SUPER.DAL.DocuAux oDoc = SUPER.DAL.DocuAux.GetDocumento(null, sUsuTickExpte); idContentServerExpte = oDoc.t2_iddocumento; } else { if (sIdContentServerExpte != "") { idContentServerExpte = long.Parse(sIdContentServerExpte); } } #endregion TituloFicepi.Grabar((t012_idtituloficepi == "") ? null : (int?)int.Parse(t012_idtituloficepi), sTitulo, (sIdTitulacion == "") ? (short)-1 : short.Parse(sIdTitulacion), idFicepi, ((sTipo == "") ? null : (byte?)byte.Parse(sTipo)), ((sModalidad == "") ? null : (byte?)byte.Parse(sModalidad)), (sTic == "S") ? true : false, (sFinalizado == "S") ? true : false, sEspecialidad, sCentro, ((sInicio == "") ? null : (short?)short.Parse(sInicio)), ((sFin == "") ? null : (short?)short.Parse(sFin)), sNombreDoc, sNombreExp, sObs, char.Parse(sEstadoNuevo), sMotivoR, int.Parse(Session["IDFICEPI_ENTRADA"].ToString()), bool.Parse(sCambioDoc), bool.Parse(sCambioExpte), char.Parse(sEstadoInicial), sOperacion, idTitulacionIni, idContentServer, idContentServerExpte, sEsMiCV); if (sUsuTickTit.Trim() != "") { //Marco el documento como asignado para que el trigger no lo borre de Atenea if (idContentServer != null) { SUPER.DAL.DocuAux.Asignar(null, (long)idContentServer); } //Borro el documento de la tabla temporal SUPER.DAL.DocuAux.BorrarDocumento(null, "A", sUsuTickTit); } if (sUsuTickExpte.Trim() != "") { //Marco el documento como asignado para que el trigger no lo borre de Atenea if (idContentServerExpte != null) { SUPER.DAL.DocuAux.Asignar(null, (long)idContentServerExpte); } //Borro el documento de la tabla temporal SUPER.DAL.DocuAux.BorrarDocumento(null, "A", sUsuTickExpte); } } catch (Exception ex) { sRes = "Error@#@" + ex.Message; } return(sRes); }
protected void Page_Load(object sender, EventArgs e) { #region Control de sesión if (Session["IDRED"] == null) { try { Response.Redirect("~/SesionCaducadaModal.aspx", true); } catch (System.Threading.ThreadAbortException) { return; } } #endregion string sTipo = Request.QueryString["sTipo"].ToString(); string[] sIDDOC = null; int nIDDOC = 0; switch (sTipo) { case "TIF": case "TAD": case "TAE": sIDDOC = Regex.Split(Request.QueryString["nIDDOC"].ToString(), "datos"); break; case "CVTCUR": case "CVTCUR_IMP": case "CVTEXAMEN": case "CVTCERT": case "CVTEXAMEN2": sIDDOC = Regex.Split(Request.QueryString["nIDDOC"].ToString(), "datos"); break; default: try { nIDDOC = int.Parse(Request.QueryString["nIDDOC"].ToString()); } catch (Exception e1) { string sError = "Descargar.aspx->Page_Load. Tipo=" + sTipo + " Id documento=" + Request.QueryString["nIDDOC"].ToString(); sError += " Ficepi=" + Session["IDFICEPI_PC_ACTUAL"].ToString() + " Error=" + e1.Message; throw (new Exception(sError)); } break; } #region Pruebas //string sPath = "", sNomFich=""; ////sPath = @"../../Upload/634527150288235168.txt"; ////sPath = Server.MapPath(@"/Upload/634527150288235168.txt"); ////sPath = @"d:\inetpub\wwwroot\SUPER\Upload\634527150288235168.txt"; //if (Request.QueryString["sPath"] != null) //{ // sNomFich = Utilidades.decodpar(Request.QueryString["sPath"].ToString()); // //sNomFich = "pepe.xml"; // //sPath = Server.MapPath(@"/SUPER/Upload/") + @"\" + sNomFich; // if (System.Configuration.ConfigurationManager.ConnectionStrings["ENTORNO"].ToString() == "D") // sPath = Server.MapPath(@"/SUPER/Upload/") + sNomFich; // else // sPath = Server.MapPath(@"/Upload/") + sNomFich; // //sPath = @"d:\inetpub\wwwroot\SUPER\Upload\634527150288235168.txt"; // //sPath = Server.MapPath(@"/Upload/634527150288235168.txt"); //} ////sPath = Server.MapPath(@"/Upload/634527150288235168.xml"); ////sNomFich = "634527150288235168.txt"; #endregion string sNombreArchivo = ""; byte[] ArchivoBinario = null; long? t2_iddocumento = null; Response.ClearContent(); Response.ClearHeaders(); Response.Buffer = true; if (Request.QueryString["descargaToken"] != null) { Response.AppendCookie(new HttpCookie("fileDownloadToken", Request.QueryString["descargaToken"].ToString())); //downloadTokenValue will have been provided in the form submit via the hidden input field } Response.ContentType = "application/octet-stream"; try { #region Leer archivo en función de la tabla solicitada switch (sTipo) { case "AS_T": //Asunto de Bitácora de TAREA DOCASU_T oDocAS_T = DOCASU_T.Select(null, nIDDOC); //, true); sNombreArchivo = oDocAS_T.t602_nombrearchivo; t2_iddocumento = oDocAS_T.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocAS_T.t602_archivo; break; case "AC_T": //Acción de Bitácora de TAREA DOCACC_T oDocAC_T = DOCACC_T.Select(null, nIDDOC); //, true); sNombreArchivo = oDocAC_T.t603_nombrearchivo; t2_iddocumento = oDocAC_T.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocAC_T.t603_archivo; break; case "AS_PT": //Asunto de Bitácora de PT DOCASU_PT oDocAS_PT = DOCASU_PT.Select(null, nIDDOC); //, true); sNombreArchivo = oDocAS_PT.t411_nombrearchivo; t2_iddocumento = oDocAS_PT.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocAS_PT.t411_archivo; break; case "AC_PT": //Acción de Bitácora de PT DOCACC_PT oDocAC_PT = DOCACC_PT.Select(null, nIDDOC); //, true); sNombreArchivo = oDocAC_PT.t412_nombrearchivo; t2_iddocumento = oDocAC_PT.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocAC_PT.t412_archivo; break; case "AS": //Asunto de Bitácora case "AS_PE": //Asunto de Bitácora DOCASU oDocAS = DOCASU.Select(null, nIDDOC); //, true); sNombreArchivo = oDocAS.t386_nombrearchivo; t2_iddocumento = oDocAS.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocAS.t386_archivo; break; case "AC": //Acción de Bitácora case "AC_PE": //Acción de Bitácora DOCACC oDocAC = DOCACC.Select(null, nIDDOC); //, true); sNombreArchivo = oDocAC.t387_nombrearchivo; t2_iddocumento = oDocAC.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocAC.t387_archivo; break; case "IAP_T": case "T": DOCUT oDocT = DOCUT.Select(null, nIDDOC); //, true); sNombreArchivo = oDocT.t363_nombrearchivo; t2_iddocumento = oDocT.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocT.t363_archivo; break; case "A": //Actividad DOCUA oDocA = DOCUA.Select(null, nIDDOC); //, true); sNombreArchivo = oDocA.t365_nombrearchivo; t2_iddocumento = oDocA.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocA.t365_archivo; break; case "F": //Fase DOCUF oDocF = DOCUF.Select(null, nIDDOC); //, true); sNombreArchivo = oDocF.t364_nombrearchivo; t2_iddocumento = oDocF.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocF.t364_archivo; break; case "PT": //Proyecto Técnico DOCUPT oDocPT = DOCUPT.Select(null, nIDDOC); //, true); sNombreArchivo = oDocPT.t362_nombrearchivo; t2_iddocumento = oDocPT.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocPT.t362_archivo; break; case "PE": //Proyecto Económico case "PSN": //Proyecto Económico DOCUPE oDocPE = DOCUPE.Select(null, nIDDOC); //, true); sNombreArchivo = oDocPE.t368_nombrearchivo; t2_iddocumento = oDocPE.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocPE.t368_archivo; break; case "PEF": //Espacio de acuerdo de Proyecto Económico DOC_ACUERDO_PROY oDocPEF = DOC_ACUERDO_PROY.Select(null, nIDDOC); //, true); sNombreArchivo = oDocPEF.t640_nombrearchivo; t2_iddocumento = oDocPEF.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocPEF.t640_archivo; break; case "HT": //Hito lineal case "HM": //Hito discontinuo DOCUH oDocH = DOCUH.Select(null, nIDDOC); //, true); sNombreArchivo = oDocH.t366_nombrearchivo; t2_iddocumento = oDocH.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocH.t366_archivo; break; case "HF": //Hito de fecha DOCUHE oDocHE = DOCUHE.Select(null, nIDDOC); //, true); sNombreArchivo = oDocHE.t367_nombrearchivo; t2_iddocumento = oDocHE.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocHE.t367_archivo; break; case "OF": //ORDEN DE FACTURACIÓN DOCUOF oDocOF = DOCUOF.Select(null, nIDDOC, true); sNombreArchivo = oDocOF.t624_nombrearchivo; t2_iddocumento = oDocOF.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocOF.t624_archivo; break; case "PL_OF": //PLANTILLA ORDEN DE FACTURACIÓN PLANTILLADOCUOF oDocPOF = PLANTILLADOCUOF.Select(null, nIDDOC); //, true); sNombreArchivo = oDocPOF.t631_nombrearchivo; t2_iddocumento = oDocPOF.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocPOF.t631_archivo; break; case "EC": //ESPACIO DE COMUNICACION DOCUEC oDocEC = DOCUEC.Select(null, nIDDOC); //, true); sNombreArchivo = oDocEC.t658_nombrearchivo; t2_iddocumento = oDocEC.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocEC.t658_archivo; break; case "DI": //DIALOGO DE ALERTA SUPER.Capa_Datos.DOCDIALOGO oDocDI = SUPER.Capa_Datos.DOCDIALOGO.Select(null, nIDDOC); //, true); sNombreArchivo = oDocDI.t837_nombrearchivo; t2_iddocumento = oDocDI.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocDI.t837_archivo; break; case "SC": //SOLICITUD DE CERTIFICADO SUPER.BLL.DOCSOLICITUD oDocSC = SUPER.BLL.DOCSOLICITUD.Select(null, nIDDOC); //, true); sNombreArchivo = oDocSC.t697_nombrearchivo; t2_iddocumento = oDocSC.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocSC.t697_archivo; break; case "CVTEXAMEN": //CURVIT EXAMEN if (Utilidades.isNumeric(sIDDOC[0].ToString())) { Examen oDocCVTE = Examen.SelectDoc(null, int.Parse(sIDDOC[0].ToString()), int.Parse(sIDDOC[1].ToString())); sNombreArchivo = oDocCVTE.T591_NDOC; //ArchivoBinario = oDocCVTE.T591_DOC; t2_iddocumento = oDocCVTE.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocCVTE.T591_DOC; } else { SUPER.DAL.DocuAux oDoc = SUPER.DAL.DocuAux.GetDocumento(null, sIDDOC[0].ToString()); sNombreArchivo = oDoc.t686_nombre; t2_iddocumento = oDoc.t2_iddocumento; } break; case "CVTEXAMEN2": //DESDE VARIABLE DE SESIÓN. NO ESTÁ AÚN GRABADO... sNombreArchivo = sIDDOC[1]; ArchivoBinario = (byte[])Session[Utilidades.decodpar(sIDDOC[0])]; break; case "CVTCERT": //CURVIT CERTIFICADO if (Utilidades.isNumeric(sIDDOC[0].ToString())) { Certificado oDocCVTC = Certificado.SelectDoc(null, int.Parse(sIDDOC[0].ToString()), int.Parse(sIDDOC[1].ToString())); sNombreArchivo = oDocCVTC.T593_NDOC; //ArchivoBinario = oDocCVTC.T593_DOC; t2_iddocumento = oDocCVTC.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oDocCVTC.T593_DOC; } else { SUPER.DAL.DocuAux oDoc = SUPER.DAL.DocuAux.GetDocumento(null, sIDDOC[0].ToString()); sNombreArchivo = oDoc.t686_nombre; t2_iddocumento = oDoc.t2_iddocumento; } break; case "TIF": //CURVIT TITULO IDIOMA FICEPI if (Utilidades.isNumeric(sIDDOC[0].ToString())) { TituloIdiomaFic o = TituloIdiomaFic.SelectDoc(null, int.Parse(sIDDOC[0].ToString())); sNombreArchivo = o.T021_NDOC; t2_iddocumento = o.t2_iddocumento; } else { SUPER.DAL.DocuAux oDoc = SUPER.DAL.DocuAux.GetDocumento(null, sIDDOC[0].ToString()); sNombreArchivo = oDoc.t686_nombre; t2_iddocumento = oDoc.t2_iddocumento; } break; case "CVTCUR": //CURVIT CURSO RECIBIDOS if (Utilidades.isNumeric(sIDDOC[0].ToString())) { Curso oCurso = Curso.SelectDoc(null, int.Parse(sIDDOC[0].ToString()), int.Parse(sIDDOC[1].ToString())); sNombreArchivo = oCurso.T575_NDOC; //ArchivoBinario = oCurso.T575_DOC; t2_iddocumento = oCurso.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oCurso.T575_DOC; } else { SUPER.DAL.DocuAux oDoc = SUPER.DAL.DocuAux.GetDocumento(null, sIDDOC[0].ToString()); sNombreArchivo = oDoc.t686_nombre; t2_iddocumento = oDoc.t2_iddocumento; } break; case "CVTCUR_IMP": //CURVIT CURSO IMPARTIDOS if (Utilidades.isNumeric(sIDDOC[0].ToString())) { Curso oCursoImp = Curso.SelectDoc2(null, int.Parse(sIDDOC[0].ToString()), int.Parse(sIDDOC[1].ToString())); sNombreArchivo = oCursoImp.T580_NDOC; //ArchivoBinario = oCursoImp.T580_DOC; t2_iddocumento = oCursoImp.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oCursoImp.T580_DOC; } else { SUPER.DAL.DocuAux oDoc = SUPER.DAL.DocuAux.GetDocumento(null, sIDDOC[0].ToString()); sNombreArchivo = oDoc.t686_nombre; t2_iddocumento = oDoc.t2_iddocumento; } break; case "CVTDOCTIT": //CURVIT TITULACION DOCUMENTO TITULO Titulacion oTitulo = Titulacion.SelectDoc(null, nIDDOC, "Tit"); sNombreArchivo = oTitulo.NDOC; //ArchivoBinario = oTitulo.DOC; t2_iddocumento = oTitulo.t2_iddocumento; //if (t2_iddocumento == null) ArchivoBinario = oTitulo.DOC; break; case "CVTDOCEX": //CURVIT TITULACION DOCUMENTO EXPEDIENTE Titulacion oTitulo1 = Titulacion.SelectDoc(null, nIDDOC, "Ex"); sNombreArchivo = oTitulo1.NDOC; //ArchivoBinario = oTitulo1.DOC; t2_iddocumento = oTitulo1.t2_iddocumentoExpte; //if (t2_iddocumento == null) ArchivoBinario = oTitulo1.DOC; break; case "TAD": //CURVIT TITULO FICEPI if (Utilidades.isNumeric(sIDDOC[0].ToString())) { TituloFicepi o = TituloFicepi.Select(int.Parse(sIDDOC[0].ToString())); sNombreArchivo = o.T012_NDOCTITULO; t2_iddocumento = o.t2_iddocumento; } else { SUPER.DAL.DocuAux oDoc = SUPER.DAL.DocuAux.GetDocumento(null, sIDDOC[0].ToString()); sNombreArchivo = oDoc.t686_nombre; t2_iddocumento = oDoc.t2_iddocumento; } break; case "TAE": //CURVIT Expediente TITULO FICEPI if (Utilidades.isNumeric(sIDDOC[0].ToString())) { TituloFicepi o = TituloFicepi.Select(int.Parse(sIDDOC[0].ToString())); sNombreArchivo = o.T012_NDOCEXPDTE; t2_iddocumento = o.t2_iddocumentoExpte; } else { SUPER.DAL.DocuAux oDoc = SUPER.DAL.DocuAux.GetDocumento(null, sIDDOC[0].ToString()); sNombreArchivo = oDoc.t686_nombre; t2_iddocumento = oDoc.t2_iddocumento; } break; } #endregion if (t2_iddocumento != null) { ArchivoBinario = IB.Conserva.ConservaHelper.ObtenerDocumento((long)t2_iddocumento).content; } Response.AddHeader("Content-Disposition", "attachment; filename=\"" + sNombreArchivo + "\""); if (HttpContext.Current.Request.Browser.Browser.ToString() == "Chrome") { Response.AddHeader("Content-Length", "999999999999"); } Response.BinaryWrite(ArchivoBinario); if (Response.IsClientConnected) { Response.Flush(); } } catch (ConservaException cex) { this.hdnError.Value = Utilidades.MsgErrorConserva("R", cex); } //catch (System.Web.HttpException hexc) //{ //} catch (Exception ex) { this.hdnError.Value = "No se ha podido obtener el archivo.<br /><br />Error: " + ex.Message; if (ex.InnerException != null) { this.hdnError.Value += "<br />Detalle error: " + ex.InnerException.Message; } } //Response.Flush(); finally { if (this.hdnError.Value == "") { Response.Close(); //Response.End(); } } }
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; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsCallback) { try { //string[] sFiltros = Regex.Split(Session["FILTROS_HTML"].ToString(), "{filtro}"); //string[] sArbol = Regex.Split(sFiltros[1], "{valor}");//desglose //string strFormato = sFiltros[18];//Formato a exportar int idFicepi = int.Parse(Utilidades.decodpar(Request.QueryString["idficepi"].ToString())); string[] sDatos = Regex.Split(Curriculum.MiCVPersonalHtml(idFicepi), "#@@#");//ficepi #region Datos Personales this.strTablaDpHTML = sDatos[0];//Datos Personales #endregion #region Datos Organizativos //if (sArbol[0] == "0") divDatosO.Style.Add("display", "none");//Datos Organizativos //else //{ this.strTablaDoHTML = sDatos[1];//Datos Organizativos //} #endregion #region Sinopsis //if (sArbol[10] == "0") divSinopsis.Style.Add("display", "none");//Sinopsis //else //{ this.strTablaSinopsHTML = sDatos[2];//Sinopsis //} #endregion #region Documentos Asociados al Profesional this.strTablaDAPHTML = sDatos[3]; //Documentos Asociados al Profesional #endregion #region Formacion //if (sArbol[2] == "0") //Si en el arbol Formacion no hay que mostrar no cargo las subsecciones // divForma.Style.Add("display", "none");//Formacion //else //{ #region Formacion Academica //bool? bTic = null; //if (sFiltros[7] != "") //{ // if (sFiltros[7].ToUpper()=="TRUE") // bTic=true; // else // bTic=false; //} ////if (sArbol[1] == "0") divFormaAcad.Style.Add("display", "none");//Formacion Academica //else //{ //string datos = TituloFicepi.MiCvTitulacionHTML(int.Parse(sFiltros[0]),//ficepi // int.Parse(sFiltros[2]),//Utilizar criterios // (sFiltros[3] == "") ? null : sFiltros[3],//t019_descripcion // (sFiltros[4] == "") ? null: (int?)int.Parse(sFiltros[4]),//t019_idCodTitulo // (sFiltros[5] == "") ? null : (int?)int.Parse(sFiltros[5]),//t019_tipo // bTic,//(sFiltros[7] == "") ? null : (byte?)byte.Parse(sFiltros[7]),//t019_tic // (sFiltros[6] == "") ? null : (int?)int.Parse(sFiltros[6])//t019_modalidad // ); string datosTit = TituloFicepi.MiCvTitulacionHTML(idFicepi, //ficepi 0, //Utilizar criterios null, //t019_descripcion null, //t019_idCodTitulo null, //t019_tipo null, //(sFiltros[7] == "") ? null : (byte?)byte.Parse(sFiltros[7]),//t019_tic null //t019_modalidad ); //Si no hay datos se oculta if (datosTit != "") { this.strTablaFormAcadHTML = datosTit; } else { divFormaAcad.Style.Add("display", "none"); } //} #endregion //} #endregion #region Experiencia Profesional //if (sArbol[7] == "0")//Si en el arbol Experiencia no hay que mostrar no cargo las subsecciones //{ // divExp.Style.Add("display", "none");//Experiencia profesional //} //else //{ #region Secciones Experiencia profesional #region Experiencia Profesional En Ibermatica //if (sArbol[9] == "0") divExpIber.Style.Add("display", "none");//Experiencia en Ibermatica //else //{ //string datos = EXPPROF.MiCVExpProfEnIbermaticaHTML(int.Parse(sFiltros[0]),//ficepi // int.Parse(sFiltros[2]),//Utilizar criterios // (sFiltros[13] == "") ? null : sFiltros[13].ToString(),//Nombrecuenta // (sFiltros[14] == "") ? null : (int?)int.Parse(sFiltros[14]),//idcuenta // (sFiltros[15] == "") ? null : (int?)int.Parse(sFiltros[15]),//t483_idsector // (sFiltros[16] == "") ? null : (int?)int.Parse(sFiltros[16]),//t035_codperfile // (sFiltros[17] == "") ? null : sFiltros[17].ToString()//Cadena IDs Entornos tecnologicos // ); string datosExpIb = EXPPROF.MiCVExpProfEnIbermaticaHTML(idFicepi, //ficepi 0, //Utilizar criterios null, //Nombrecuenta null, //idcuenta null, //t483_idsector null, //t035_codperfile null //Cadena IDs Entornos tecnologicos ); //Si no hay datos se oculta if (datosExpIb != "") { this.strTablaExpIberHTML = datosExpIb; } else { divExpIber.Style.Add("display", "none"); } //} #endregion #region Experiencia Profesional Fuera Ibermatica //if (sArbol[8] == "0") divExpFuera.Style.Add("display", "none");//Experiencia Fuera de Ibermatica //else //{ string datosExpF = EXPPROF.MiCVExpProfFueraIbermaticaHTML(idFicepi, //ficepi 0, //Utilizar criterios null, //Nombrecuenta null, //idcuenta null, //t483_idsector null, //t035_codperfile null //Cadena IDs Entornos tecnologicos ); //Si no hay datos se oculta if (datosExpF != "") { this.strTablaExpFueraHTML = datosExpF; } else { divExpFuera.Style.Add("display", "none"); } //} #endregion #endregion //} #endregion //if (sArbol[1] == "0") //Si en el arbol Formacion no hay que mostrar no cargo las subsecciones // divAccionesForma.Style.Add("display", "none");//Formacion //else //{ #region Cursos Recibidos //if (sArbol[3] == "0") divCurRec.Style.Add("display", "none");//Cursos Recibidos //else //{ string datosFRec = Curso.MiCVFormacionRecibidaHTML(idFicepi, //ficepi 0, //Utilizar criterios null //Cadena IDs Entornos tecnologicos ); //Si no hay datos se oculta if (datosFRec != "") { this.strTablaCurRecHTML = datosFRec; } else { divCurRec.Style.Add("display", "none"); } //} #endregion #region Cursos Impartidos //if (sArbol[4] == "0") divCurImp.Style.Add("display", "none");//Cursos Impartidos //else //{ string datosFImp = Curso.MiCVFormacionImpartidaHTML(idFicepi, //ficepi 0, //Utilizar criterios null //Cadena IDs Entornos tecnologicos ); //string datos = Curso.MiCVFormacionImpartidaHTML(int.Parse(sFiltros[0]),//ficepi // int.Parse(sFiltros[2]),//Utilizar criterios // (sFiltros[10] == "") ? null : sFiltros[10]//Cadena IDs Entornos tecnologicos // ); //Si no hay datos se oculta if (datosFImp != "") { this.strTablaCurImpHTML = datosFImp; } else { divCurImp.Style.Add("display", "none"); } //} #endregion //} #region Certificados/Examenes //if (sArbol[5] == "0" && sArbol[11] == "0") DivCEREXAM.Style.Add("display", "none");//Certificados/Examenes //else //{ string datosCertEx = Examen.MiCVFormacionCertExamHTML(idFicepi, //ficepi 0, //Utilizar criterios null, //IDs Certificado null, //Nombre certificado null, //Cadena IDs Entornos tecnologicos null //origenConsulta ); //Si no hay datos se oculta if (datosCertEx != "") { this.strTablaCertExamHTML = datosCertEx; } else { divCertExam.Style.Add("display", "none"); } //} #endregion #region Idiomas/Titulos Idiomas //if (sArbol[6] == "0") divIDIOM.Style.Add("display", "none");//Idiomas //else //{ string datosId = Idioma.MiCvIdiomasHTML(idFicepi, //ficepi 0, //Utilizar criterios null, //t020_IdCodIdioma null //nivelidioma ); //Si no hay datos se oculta if (datosId != "") { this.strTablaIdiomasHTML = datosId; } else { divIdiomas.Style.Add("display", "none"); } //} #endregion //Si todas las secciones de Formacion estan vacias se oculta la cabecera: // if ((this.strTablaFormAcadHTML == "") && (this.strTablaCurRecHTML == "") && (this.strTablaCurImpHTML == "") && (this.strTablaCertExamHTML == "") && (this.strTablaIdiomasHTML == "")) //if ( (this.strTablaCurRecHTML == "") && (this.strTablaCurImpHTML == "") ) // divAccionesForma.Style.Add("display", "none");//Acciones formativas } catch (Exception ex) { hdnErrores.Value = Errores.mostrarError("Error al cargar la pagina", ex); } } }