protected void btnProcesar_Click(object sender, EventArgs e) { lblNoRegs.Visible = false; txtFiltro.Text = txtFiltro.Text.Trim(); if (Page.IsValid && txtFiltro.Text.Length >= 3) { BLOperaciones obj = new BLOperaciones(); System.Data.DataTable Resultados = new System.Data.DataTable(); Resultados = obj.BuscarDocumentosAAE(txtFiltro.Text); if (Resultados.TableName != "Error") { grdDatos.DataSource = Resultados; grdDatos.DataBind(); if (grdDatos.Rows.Count == 0) { lblNoRegs.Visible = true; } else { lblNoRegs.Visible = false; } } else { DatosGenerales.EnviaMensaje(Resultados.Rows[0][0].ToString(), "Error al realizar búsqueda", DatosGenerales.TiposMensaje.Error); } } else { DatosGenerales.EnviaMensaje("Debe ingresar por lo menos 3 caracteres como filtro de búsqueda.", "Advertencia", DatosGenerales.TiposMensaje.Advertencia); } }
protected void btnProcesar_Click(object sender, EventArgs e) { if (Page.IsValid) { int NumeroPrestamo = 0; int.TryParse(txtNumeroPrestamo.Text, out NumeroPrestamo); if (!DatosGenerales.EsFecha(txtFechaDocumento.Text)) { MsgBoxU.AddMessage("Fecha de documento errónea", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); return; } if (!DatosGenerales.EsFecha(txtFechaFirmaEscritura.Text)) { MsgBoxU.AddMessage("Fecha de firma errónea", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); return; } if (!DatosGenerales.EsFecha(txtFechaVigencia.Text)) { MsgBoxU.AddMessage("Fecha de vigencia errónea", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); return; } if (NumeroPrestamo <= 0) { MsgBoxU.AddMessage("Número de préstamo incorrecto", YaBu.MessageBox.uscMsgBox.enmMessageType.Attention); return; } string Archivo = DatosGenerales.GeneraNombreArchivoRnd("Carta_", "pdf"); Archivo = Path.Combine(Server.MapPath("../Reportes/" + DatosGenerales.RutaLocalReportesDinamicos), Archivo); Archivo = Convertir_HTMLaPDF(Archivo, ArmarCadena()); if (!Archivo.Contains("Error")) { BLOperaciones obj = new BLOperaciones(); string Referencia = ""; hddArchivoSencillo.Value = Path.GetFileName(Archivo); hddArchivo.Value = DatosGenerales.RutaReportesDinamicos + Path.GetFileName(Archivo); Referencia = obj.RegistrarCarta(Session["UserNameLogin"].ToString(), DatosGenerales.ObtieneFecha(txtFechaDocumento.Text), Convert.ToInt32(txtNumeroPrestamo.Text), txtAcreditado.Text, File.ReadAllBytes(Archivo)); if (Referencia.Length == 16 && !Referencia.Contains("Error")) { lblReferencia.Text = "Se ha generado la carta asociada a la referencia: " + Referencia + ". " + hddConvenio.Value; btnArchivo.Enabled = true; } else { lblReferencia.Text = Referencia; btnArchivo.Enabled = false; } mp2.Show(); } else { DatosGenerales.EnviaMensaje("Error al generar la carta", "Generar carta", DatosGenerales.TiposMensaje.Informacion); } } }
protected void CargaCatalogos() { BLOperaciones objOp = new BLOperaciones(); objOp.ListaTiposFiltroCartasSHF(ref ddlFiltro, false); }