protected void BtnEnviar_Click(object sender, EventArgs e) { try{ validar(); String vUrge = DDLUrgencia.SelectedValue == "0" ? "" : DDLUrgencia.SelectedItem.Text; String vUser = Session["USUARIO"].ToString(); String vQuery = "RSP_Sugerencias 1," + DDLMotivo.SelectedValue + "," + vUser + ",'" + TxMensaje.Text + "','" + vUrge + "'"; int vInfo = vConexion.ejecutarSql(vQuery); if (vInfo == 1) { enviarCorreo(); Mensaje(DDLMotivo.SelectedItem.Text + " enviada con éxito!", WarningType.Success); } else { Mensaje("Hubo un error al enviar su mensaje.", WarningType.Danger); } limpiarForm(); cargarDatos(); UpdatePanel1.Update(); UPBuzonGeneral.Update(); }catch (Exception ex) { Mensaje(ex.Message, WarningType.Danger); } }
protected void BtnConfirmar_Click(object sender, EventArgs e) { try{ DataTable vDatos = (DataTable)Session["CONSTANCIAS_GENERAL"]; if (HttpContext.Current.Session["CONSTANCIA_ELIMINAR"] == null) { String vId = HttpContext.Current.Session["CONSTANCIA_ID"] != null ? Session["CONSTANCIA_ID"].ToString() : Session["SOLICITUD_RESPUESTA"].ToString(); String vEstado = HttpContext.Current.Session["CONSTANCIA_ID"] != null ? "2" : "1"; String vMensaje = vEstado == "2" ? "Solicitud eliminada con éxito." : "Constancia aprobada con éxito."; String vQuery = "[RSP_Constancias] 10" + "," + vId + "," + vEstado; int vInfo = vConexion.ejecutarSql(vQuery); if (vInfo == 1) { for (int i = 0; i < vDatos.Rows.Count; i++) { if (vDatos.Rows[i]["idSolicitud"].ToString() == vId && vDatos.Rows[i]["Destino"].ToString() == "Visa para capacitacion") { CargarConstancia(vDatos, i); } } Mensaje(vMensaje, WarningType.Success); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "closeModal();", true); } else { Mensaje("Solicitud no fue eliminada, comuníquese con sistemas.", WarningType.Danger); } } else { String vId = Session["CONSTANCIA_ELIMINAR"].ToString(); String vQuery = "[RSP_Constancias] 10," + vId + ",4"; int vInfo = vConexion.ejecutarSql(vQuery); if (vInfo == 1) { Mensaje("Solicitud eliminada con éxito.", WarningType.Success); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "closeModal();", true); } else { Mensaje("Solicitud no fue eliminada, comuníquese con sistemas.", WarningType.Danger); } } cargarDatos(); UpdatePanel1.Update(); UPBuzonGeneral.Update(); }catch (Exception Ex) { ScriptManager.RegisterClientScriptBlock(this.Page, typeof(Page), "text", "infatlan.showNotification('top','center','" + Ex.Message + "','" + WarningType.Danger.ToString().ToLower() + "')", true); }finally { CerrarModal("ModalConfirmar"); } }
protected void BtnEnviar_Click(object sender, EventArgs e) { try{ validarDatos(); String vTipo = DDLTipoConstancia.SelectedValue; String vQuery = ""; DataTable vDatos = new DataTable(); String vCat = DDLCategoria.SelectedValue == "0" ? "null" : DDLCategoria.SelectedValue; String vDest = DDLDestinoCL.SelectedValue == "" ? "null" : DDLDestinoCL.SelectedValue; int vInfo = 0; vQuery = "[RSP_Constancias] 2" + "," + Session["USUARIO"].ToString() + "," + vTipo + "," + vCat + "," + vDest; vDatos = vConexion.obtenerDataTable(vQuery); if (vTipo == "2") { if (vDatos.Rows.Count > 0) { String vIdSolicitud = vDatos.Rows[0][0].ToString(); // xml xml vMaestro = new xml(); Object[] vDatosMaestro = new object[8]; vDatosMaestro[0] = TxDest1.Text; vDatosMaestro[1] = TxMont1.Text; vDatosMaestro[2] = TxDest2.Text; vDatosMaestro[3] = TxMont2.Text; vDatosMaestro[4] = TxDest3.Text; vDatosMaestro[5] = TxMont3.Text; vDatosMaestro[6] = TxDest4.Text; vDatosMaestro[7] = TxMont4.Text; String vXML = vMaestro.ObtenerMaestroString(vDatosMaestro); vXML = vXML.Replace("<?xml version=\"1.0\" encoding=\"utf-16\"?>", ""); vQuery = "[RSP_Constancias] 3" + "," + vIdSolicitud + ",'" + TxMonto.Text + "'" + ",'" + TxPlazo.Text + "'" + ",'" + vXML + "'"; vInfo = vConexion.ejecutarSql(vQuery); if (vInfo == 1) { Mensaje("Solicitud creada con éxito.", WarningType.Success); } else { Mensaje("Solicitud no completada, favor comuníquese con sistemas.", WarningType.Success); } limpiarFormulario(); } } else { if (vDatos.Rows.Count > 0) { Boolean vDA = true; String vIdSolicitud = vDatos.Rows[0][0].ToString(); if (vDest == "6") { vQuery = "[RSP_Constancias] 4" + "," + vIdSolicitud + ",'" + TxAval.Text + "'" + ",'" + DDLParentezco.SelectedItem + "'"; vInfo = vConexion.ejecutarSql(vQuery); } else if (vDest == "11") { vQuery = "[RSP_Constancias] 5" + "," + vIdSolicitud + ",'" + TxEmbajada.Text + "'" + ",'" + TxFechaCita.Text + "'"; vInfo = vConexion.ejecutarSql(vQuery); } else if (vDest == "12") { vQuery = "[RSP_Constancias] 6" + "," + vIdSolicitud + ",'" + DDLFirmante.SelectedValue + "'" + ",'" + TxFecha.Text + "'" + ",'" + TxPasaporte.Text + "'" + ",'" + TxRTN.Text + "'" + ",'" + TxDomicilio1.Text + "'" + ",'" + TxDomicilio2.Text + "'" + ",'" + TxContacto.Text + "'" + ",'" + TxLugar.Text + "'" + ",'" + TxTelefono.Text + "'" + ",'" + TxEvento.Text + "'" + ",'" + TxFechaInicio.Text + "'" + ",'" + TxFechaFin.Text + "'" + ",'" + TxConsulado.Text + "'" + ",'" + TxDirConsul.Text + "'" + ",'" + TxPais.Text + "'" + ",'" + TxCiudad.Text + "'"; vInfo = vConexion.ejecutarSql(vQuery); } else { vDA = false; } if (vDA) { if (vInfo == 1) { MensajeLoad("Constancia solicitada con éxito.", WarningType.Success); } else { MensajeLoad("Solicitud no completada, favor comuníquese con sistemas.", WarningType.Success); } } else { MensajeLoad("Constancia solicitada con éxito.", WarningType.Success); } } else { MensajeLoad("Solicitud no completada, favor comuníquese con sistemas.", WarningType.Warning); } limpiarFormulario(); } cargarDatos(); UPBuzonGeneral.Update(); UpdatePanel1.Update(); }catch (Exception ex) { MensajeLoad(ex.Message, WarningType.Danger); } }