Requerimiento 11 Completado KLB
git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C537
This commit is contained in:
parent
d2cd28a661
commit
45d2898d48
4 changed files with 629 additions and 5 deletions
|
|
@ -1265,6 +1265,7 @@ public partial class Forms_Trans_frwBusquedaSolicitud : General
|
|||
GridViewBoundField bdfOficina = new GridViewBoundField("DESCRIPCIONDEPENDENCIASIGDD", "Oficina", true, false, true);
|
||||
GridViewBoundField bdfPlano = new GridViewBoundField("NUMEROTERRENO", "Inmueble", true, false, true);
|
||||
GridViewBoundField bdfFolio = new GridViewBoundField("NUMEROFOLIO", "Folio", true, false, true);
|
||||
|
||||
GridViewBoundField bdfUbicacion = new GridViewBoundField("UBICACION", "Prov/Canton/Dist", true, false, true);
|
||||
GridViewBoundField bdfCedula = new GridViewBoundField("CEDULACLIENTESOLICITUD", "Cédula", true, false, true);
|
||||
GridViewBoundField bdfEstado = new GridViewBoundField("DESCRIPCIONESTADOPROGRAMACION", "Estado", true,false, true);
|
||||
|
|
@ -1273,6 +1274,8 @@ public partial class Forms_Trans_frwBusquedaSolicitud : General
|
|||
GridViewBoundField bdfFkTipoInspeccion = new GridViewBoundField("FKTIPOINSPECCION", "FK", false, false, false);
|
||||
GridViewBoundField bdfFechaInspeccion = new GridViewBoundField("FECHAINSERTASOLICITUD", "Fecha", true, false, true);
|
||||
GridViewBoundField bdfTiempoEjecucion = new GridViewBoundField("TIEMPOEJECUCION", "Duración/dias", true, false, true);
|
||||
//Requerimiento 11
|
||||
GridViewBoundField bdfPaso = new GridViewBoundField("PASO", "Paso", true, false, true);
|
||||
|
||||
grvListaDatosTemp.Columns.Add(bdfPkProgramacion);
|
||||
grvListaDatosTemp.Columns.Add(bdfPkSolicitud);
|
||||
|
|
@ -1298,7 +1301,7 @@ public partial class Forms_Trans_frwBusquedaSolicitud : General
|
|||
//grvListaDatosTemp.Columns[15].ItemStyle.BackColor = System.Drawing.Color.Gray;
|
||||
//grvListaDatosTemp.Columns[16].ItemStyle.BackColor = System.Drawing.Color.Blue;
|
||||
grvListaDatosTemp.Columns[17].ItemStyle.HorizontalAlign = HorizontalAlign.Center;
|
||||
|
||||
|
||||
cuwBusquedaList.LlenarCHKLBusqueda(grvListaDatosTemp);
|
||||
|
||||
ButtonField bfActividades = new ButtonField();
|
||||
|
|
@ -1309,6 +1312,8 @@ public partial class Forms_Trans_frwBusquedaSolicitud : General
|
|||
bfActividades.ImageUrl = "~/Images/MiniBotones/Seguimiento.png";
|
||||
bfActividades.CommandName = "seguimiento";
|
||||
grvListaDatosTemp.Columns.Add(bfActividades);
|
||||
//Requerimiento 11 - Se modifico la vista v_obtenersolicitud_grid
|
||||
grvListaDatosTemp.Columns.Add(bdfPaso);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -433,6 +433,8 @@
|
|||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<asp:Button ID="btnEnviarRevision" runat="server" CssClass="botones" OnClick="btnEnviarRevision_Click" Text="Enviar" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ using System.IO;
|
|||
using AyABL.TRA;
|
||||
using iTextSharp.text;
|
||||
using iTextSharp.text.pdf;
|
||||
using Ionic.Zip;
|
||||
public partial class Forms_Trans_frwCartaSolicitud : General
|
||||
{
|
||||
|
||||
|
|
@ -90,6 +91,8 @@ public partial class Forms_Trans_frwCartaSolicitud : General
|
|||
cartaBL objCartaBL;
|
||||
DropDownList ddlTemporal, ddlTemporal2;
|
||||
string strNumSolicitudTMP = string.Empty;
|
||||
int nNumeroSolicitudCFIA = 0;
|
||||
|
||||
#region variable firma digital
|
||||
int nNumSolicitudTMP = 0;
|
||||
int nPKReutilizaTMP = 0;
|
||||
|
|
@ -460,6 +463,347 @@ public partial class Forms_Trans_frwCartaSolicitud : General
|
|||
|
||||
#region Eventos Controles Web (R3)
|
||||
|
||||
protected void btnEnviarRevision_Click(object sender, EventArgs e) //M0
|
||||
{
|
||||
try
|
||||
{
|
||||
//if (ddlTipoRevision.SelectedValue != "3" || (ddlTipoRevision.SelectedValue == "3" && File.Exists(ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\" + lblNumSolicitud.Text.Trim() + @"\DocumentosREQ\" + lblNumSolicitud.Text.Trim() + "_DF" + ".pdf")))
|
||||
//{
|
||||
string strRutaArchivosAdjuntos = string.Empty;
|
||||
int nNumSolicitudTMP = int.Parse(Session["PKSOLICITUD"].ToString());
|
||||
|
||||
strRutaArchivosAdjuntos = obtenerCartaSolicitud(nNumSolicitudTMP);
|
||||
//MensajeInformativo("llego7");
|
||||
if (validarTamañoArchivos(strRutaArchivosAdjuntos))
|
||||
{
|
||||
|
||||
if (txtDestinatario.Text != string.Empty)
|
||||
{
|
||||
notificacionClienteBL objNotificacionCliente = new notificacionClienteBL();
|
||||
objNotificacionCliente.objnotificacionClienteEL.DESTINATARIO = txtDestinatario.Text;
|
||||
objNotificacionCliente.objnotificacionClienteEL.OBSERVACIONES = txtObservaciones.Text;
|
||||
objNotificacionCliente.objnotificacionClienteEL.FECHAENVIO = DateTime.Now;
|
||||
objNotificacionCliente.objnotificacionClienteEL.FKTIPONOTIFICACION = int.Parse(ddlTipoRevision.SelectedValue.ToString());
|
||||
objNotificacionCliente.objnotificacionClienteEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||||
objNotificacionCliente.objnotificacionClienteEL.FKSOLICITUD = int.Parse(Session["PKSOLICITUD"].ToString());
|
||||
objNotificacionCliente.objnotificacionClienteEL.ASTATE = true;
|
||||
|
||||
int nPKNotificacion = objNotificacionCliente.insertarNotificacionCliente();
|
||||
|
||||
if (nPKNotificacion > 0)
|
||||
{
|
||||
GuardarEventoBitacora(
|
||||
Session["LOGIN"].ToString(),
|
||||
AccionBitacora.INSERT.ToString(),
|
||||
MensajesBitacora.IngresarRegistro + ": Se ha registrado la notificacion al cliente en la solicitud " + strNumSolicitudTMP,
|
||||
"frwNotificacionCliente.aspx",
|
||||
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||||
);
|
||||
if (ddlTipoRevision.SelectedValue == "1" || ddlTipoRevision.SelectedValue == "3")
|
||||
{
|
||||
|
||||
#region Envio de correo externo
|
||||
//System.Drawing.Image img = System.Drawing.Image.FromFile(ConfigurationManager.AppSettings["Imagenes"].ToString());
|
||||
//string imgStr = imageToByteArray(img);
|
||||
|
||||
string p_strDocHtml = "<img alt='' src='cid:logoAyA.png' style='width: 100px; height: 82px;' />";
|
||||
|
||||
//string strImage64Bits = "data:image/jpg;base64," + imgStr;
|
||||
|
||||
//p_strDocHtml = p_strDocHtml.Replace("/logoAyA.png", strImage64Bits);
|
||||
|
||||
string strCuerpo = "El Instituto Costarricense de Acueductos y Alcantarillados le comunica que su trámite de Disponibilidad de Servicios ha sido concluido el " + DateTime.Now.ToLongDateString() + ".</BR>Estamos para servirle, en nuestro horario de atención de 7:00 AM a 3:00 PM en las oficinas de AyA, si tiene alguna duda por favor contáctenos al teléfono " + Session["TELEFONODEPENDENCIA"].ToString() + " o al 800-737-6783.</BR></BR>" + p_strDocHtml + "</BR></BR>Este es un mensaje generado de forma automática a la dirección de correo electrónico que usted ha suministrado por la cual NO DEBE SER RESPONDIDO. Base legal para esta alerta: Artículo Artículo 239 y siguientes de la Ley General de la Administración Pública.";
|
||||
|
||||
string strPiePagina = "</BR> </BR></BR>AVISO DE CONFIDENCIALIDAD: este mensaje y la información incluida en él es confidencial y está dirigida únicamente al destinatario. Puede contener información privilegiada, confidencial, amparada por el secreto profesional o que no debe ser revelada. Si usted ha recibido este correo por error, por favor comunicarlo inmediatamente vía correo y tener la amabilidad de eliminarlo de su sistema. Queda notificado que no deberá copiar este mensaje, ni utilizar, divulgar, publicar o distribuir su contenido de modo alguno. Todo mensaje enviado a esta dirección de correo electrónico puede ser sujeto a inspección por alguien distinto de su receptor originario. La transmisión de correos no garantiza que el correo electrónico sea seguro o libre de error. Por consiguiente, se advierte que esta información pueda estar incompleta o ser poco precisa ya que toda información está sujeta a alterarse sin previo aviso.”";
|
||||
string strAsunto = "Resolución de Trámite de Disponibilidad de Servicios";
|
||||
AyABL.TRA.correoExternoBL objcorreoExternoBL = new AyABL.TRA.correoExternoBL();
|
||||
objcorreoExternoBL.objcorreoExternoEL.p_recipients = txtDestinatario.Text;
|
||||
objcorreoExternoBL.objcorreoExternoEL.p_copy = "";
|
||||
objcorreoExternoBL.objcorreoExternoEL.p_subject = strAsunto;
|
||||
objcorreoExternoBL.objcorreoExternoEL.p_body = strCuerpo + strPiePagina;
|
||||
objcorreoExternoBL.objcorreoExternoEL.P_PRIORIDAD = "High";
|
||||
objcorreoExternoBL.objcorreoExternoEL.p_format = "html";
|
||||
|
||||
#region adjuntar constancias
|
||||
|
||||
objcorreoExternoBL.objcorreoExternoEL.p_file_attachments = strRutaArchivosAdjuntos;//obtenerCartaSolicitud(nNumSolicitudTMP);
|
||||
#endregion
|
||||
|
||||
|
||||
int nValorRetornado = objcorreoExternoBL.EnviarCorreoExterno();
|
||||
objcorreoExternoBL.objcorreoExternoEL.p_recipients = Session["LOGIN"].ToString() + "@aya.go.cr";
|
||||
nValorRetornado = objcorreoExternoBL.EnviarCorreoExterno();
|
||||
|
||||
GuardarEventoBitacora(
|
||||
Session["LOGIN"].ToString(),
|
||||
AccionBitacora.INSERT.ToString(),
|
||||
MensajesBitacora.IngresarRegistro + ": Se envió el correo de notificación a la dirección " + txtDestinatario.Text,
|
||||
"frwNotificacionCliente.aspx",
|
||||
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||||
);
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
//llenarGridNotificacionClientes();
|
||||
limpiarCampos();
|
||||
btnFinalizar.Enabled = true;
|
||||
chkNotificacion.Enabled = false;
|
||||
MensajeInformativo("Se ha enviado la notificación al cliente.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MensajeAlerta("Debe digitar el teléfono o correo del destinatario.");
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// MensajeAlerta("Debe adjuntar el documento fisico de respuesta al cliente.");
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//Trace.Write(ex.Message.ToString());
|
||||
MensajeError("Error en R3M0 Error al registrar la notificación al cliente", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private string obtenerCartaSolicitud(int nNumSolicitud) //M2
|
||||
{
|
||||
string strResultado = string.Empty;
|
||||
string pdfPathConstancia = string.Empty;
|
||||
string pdfPathCriterioAP = string.Empty;
|
||||
string pdfPathCriterioAS = string.Empty;
|
||||
string pdfPathAdjuntos = string.Empty;
|
||||
string strNombreCarta = string.Empty;
|
||||
string targetURL = string.Empty;
|
||||
string ruta = string.Empty;
|
||||
try
|
||||
{
|
||||
#region constancias
|
||||
//Instancia el objeto
|
||||
cartaBL objCartaBL = new cartaBL();
|
||||
//Trace.Write("Paso 0");
|
||||
//Asigna un valor al atributo de referencia del objeto
|
||||
objCartaBL.objCartaEL.FKNUMSOLICITUD = nNumSolicitud;
|
||||
objCartaBL.objCartaEL.NOMBREDOCUMENTO = string.Empty;
|
||||
//objCartaBL.objCartaEL.FKREUTILIZA = nPKReutiliza;
|
||||
//Carga en un dataset la información
|
||||
DataSet ds = objCartaBL.listarCartas();
|
||||
|
||||
if (ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
string pdfPath = "";
|
||||
//ViewState["MODO"] = "Modificar";
|
||||
|
||||
foreach (DataRow row in ds.Tables[0].Rows)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
if (row["DESCRIPCIONESTADOCARTA"].ToString() == "Activo")
|
||||
{
|
||||
|
||||
char delimitador = '-';
|
||||
string[] arrayNombre = row["NOMBREDOCUMENTOCARTA"].ToString().Split(delimitador);
|
||||
pdfPath = ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\" + arrayNombre[1].ToString() + "-" + arrayNombre[2].ToString() + "-" + arrayNombre[3].ToString() + @"\" + row["NOMBREDOCUMENTOCARTA"].ToString() + ".pdf";
|
||||
ruta = ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\" + arrayNombre[1].ToString() + "-" + arrayNombre[2].ToString() + "-" + arrayNombre[3].ToString();
|
||||
|
||||
if (!File.Exists(pdfPath))
|
||||
{
|
||||
//MensajeInformativo("llego5");no entro
|
||||
//obtener la constancia y ponerla en la carpeta compartida para el envio de correo
|
||||
|
||||
//se el registro de vision 2020
|
||||
Documento oDoc = new Documento();
|
||||
|
||||
string strAlmacenado = oDoc.Visor_Documento(strNumSolicitudTMP.ToString().Trim() + "|" + "Constancia", strNumSolicitudTMP.ToString().Trim(), pdfPath, row["NOMBREDOCUMENTOCARTA"].ToString() + ".pdf");
|
||||
if (strAlmacenado != string.Empty && strAlmacenado != "No existe")
|
||||
strResultado += pdfPath + ";";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
strResultado += pdfPath + ";";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exp)
|
||||
{
|
||||
MensajeError(exp.ToString(), exp);
|
||||
}
|
||||
}
|
||||
strResultado += ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\logoAyA.png;";
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
//Trace.Write("Paso 1");
|
||||
#region formulario agua potable
|
||||
//limpiarCampos();
|
||||
|
||||
strNombreCarta = strNumSolicitudTMP;
|
||||
|
||||
|
||||
pdfPathCriterioAP = ConfigurationManager.AppSettings["DocumentosPDF"].ToString() + @"\" + strNumSolicitudTMP + @"\" + strNombreCarta + "-AP.pdf";
|
||||
ruta = ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\" + strNumSolicitudTMP;
|
||||
if (!File.Exists(pdfPathCriterioAP))
|
||||
{
|
||||
|
||||
//se carga el archivo y el registro a vision 2020
|
||||
Documento oDoc = new Documento();
|
||||
|
||||
|
||||
string strAlmacenado = oDoc.Visor_Documento(strNumSolicitudTMP.ToString().Trim() + "|" + "Criterio técnico AP", strNumSolicitudTMP.ToString().Trim(), pdfPathCriterioAP, strNombreCarta + "-AP.pdf");
|
||||
if (strAlmacenado != string.Empty && strAlmacenado != "No existe")
|
||||
strResultado += pdfPathCriterioAP + ";"; ;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//EjecutarScript("alert('" + pdfPathCriterioAP + "-" + ruta + @"\" + strNombreCarta + "-AP.pdf" + "');");
|
||||
// File.Copy(pdfPathCriterioAP, ruta + @"\" + strNombreCarta + "-AP.pdf", true);
|
||||
strResultado += (ruta + @"\" + strNombreCarta + "-AP.pdf" + ";");
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
//Trace.Write("Paso 2");
|
||||
#region formulario alcantarillado sanitario
|
||||
//limpiarCampos();
|
||||
|
||||
strNombreCarta = strNumSolicitudTMP;
|
||||
|
||||
|
||||
pdfPathCriterioAS = ConfigurationManager.AppSettings["DocumentosPDF"].ToString() + @"\" + strNumSolicitudTMP + @"\" + strNombreCarta + "-AS.pdf";
|
||||
ruta = ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\" + strNumSolicitudTMP;
|
||||
targetURL = "'../../DocumentosPDF/" + strNumSolicitudTMP + "/" + strNombreCarta + "-AS.pdf'";
|
||||
if (!File.Exists(pdfPathCriterioAS))
|
||||
{
|
||||
|
||||
//se carga el archivo y el registro a vision 2020
|
||||
Documento oDoc = new Documento();
|
||||
|
||||
string strAlmacenado = oDoc.Visor_Documento(strNumSolicitudTMP.ToString().Trim() + "|" + "Criterio técnico AS", strNumSolicitudTMP.ToString().Trim(), pdfPathCriterioAS, strNombreCarta + "-AS.pdf");
|
||||
if (strAlmacenado != string.Empty && strAlmacenado != "No existe")
|
||||
strResultado += pdfPathCriterioAS + ";"; ;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//File.Copy(pdfPathCriterioAS, ruta + @"\" + strNombreCarta + "-AS.pdf", true);
|
||||
strResultado += (ruta + @"\" + strNombreCarta + "-AS.pdf" + ";");
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
//Trace.Write("Paso 3");
|
||||
#region adjuntos
|
||||
// recorro el grid
|
||||
foreach (GridViewRow row in grvListaAdjuntos.Rows)
|
||||
{
|
||||
HtmlInputCheckBox chkTemp = (HtmlInputCheckBox)row.Controls[0].Controls[1];
|
||||
if (chkTemp != null)
|
||||
{
|
||||
// si el registro esta marcado
|
||||
if (chkTemp.Checked)
|
||||
{
|
||||
string strNombreDocumento = row.Cells[2].Text;
|
||||
ruta = ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\" + lblNumSolicitud.Text.Trim() + @"\DocumentosREQ\";
|
||||
pdfPathAdjuntos = ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\" + lblNumSolicitud.Text.Trim() + @"\DocumentosREQ\" + strNombreDocumento;
|
||||
if (!File.Exists(pdfPathAdjuntos))
|
||||
{
|
||||
//obtener la constancia y ponerla en la carpeta compartida para el envio de correo
|
||||
|
||||
//se el registro de vision 2020
|
||||
Documento oDoc = new Documento();
|
||||
string strAlmacenado = oDoc.Visor_Documento(strNumSolicitudTMP.ToString().Trim() + "|" + "Otros", strNumSolicitudTMP.ToString().Trim(), pdfPathAdjuntos, strNombreDocumento);
|
||||
if (strAlmacenado != string.Empty && strAlmacenado != "No existe")//si el documento es adjuntado al correo desde vision 2020
|
||||
{
|
||||
strResultado += pdfPathAdjuntos + ";"; ;
|
||||
AyABL.Tran.adjuntoBL objdocumentoBL = new AyABL.Tran.adjuntoBL();
|
||||
objdocumentoBL.objadjuntoEL.PK = int.Parse(row.Cells[1].Text);
|
||||
int nPKDocumento = objdocumentoBL.modificarEnvioCorreoAdjunto();//pone el adjunto como enviado en el correo
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (File.Exists(pdfPathAdjuntos))//si el documento es adjuntado al correo desde la ruta fisica
|
||||
{
|
||||
strResultado += pdfPathAdjuntos + ";"; ;
|
||||
AyABL.Tran.adjuntoBL objdocumentoBL = new AyABL.Tran.adjuntoBL();
|
||||
objdocumentoBL.objadjuntoEL.PK = int.Parse(row.Cells[1].Text);
|
||||
int nPKDocumento = objdocumentoBL.modificarEnvioCorreoAdjunto();//pone el adjunto como enviado en el correo
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Trace.Write("Paso 4");
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//EjecutarScript("alert('" + ex.Message.ToString() + "');");
|
||||
throw ex;
|
||||
}
|
||||
return strResultado;
|
||||
}
|
||||
|
||||
public bool validarTamañoArchivos(string strRutaArchivos)
|
||||
{
|
||||
bool bResultado = false;
|
||||
int nMaximoTamañoCorreo = int.Parse(ConfigurationManager.AppSettings["TamañoArchivosBytes"].ToString());
|
||||
long nSumTamañoAdjuntos = 0;
|
||||
string strInfoArchivos = string.Empty;
|
||||
try
|
||||
{
|
||||
char[] separadorAdjuntos = { ';' };
|
||||
string[] strArrayAdjuntos = strRutaArchivos.Split(separadorAdjuntos);
|
||||
for (int i = 0; i <= (strArrayAdjuntos.Length - 1); i++)
|
||||
{
|
||||
if (strArrayAdjuntos[i] != string.Empty)
|
||||
{
|
||||
|
||||
if (File.Exists(strArrayAdjuntos[i].ToString()))
|
||||
{
|
||||
FileInfo file = new FileInfo(strArrayAdjuntos[i].ToString());
|
||||
|
||||
nSumTamañoAdjuntos += file.Length;
|
||||
if (nSumTamañoAdjuntos < nMaximoTamañoCorreo)
|
||||
bResultado = true;
|
||||
else
|
||||
bResultado = false;
|
||||
|
||||
decimal dResultado = decimal.Divide(decimal.Parse(file.Length.ToString()), decimal.Parse("1048576"));
|
||||
strInfoArchivos += file.Name + " - " + dResultado.ToString("N2") + " MB</BR>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (bResultado == false)
|
||||
{
|
||||
MensajeAlerta("El tamaño de los archivos excede el limite permitido " + (int.Parse(ConfigurationManager.AppSettings["TamañoArchivosBytes"].ToString()) / 1048576).ToString() + " MB.</BR>" + strInfoArchivos);//conversion a megabytes
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
return bResultado;
|
||||
}
|
||||
|
||||
|
||||
protected void chkNotificacion_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
|
|
@ -467,6 +811,7 @@ public partial class Forms_Trans_frwCartaSolicitud : General
|
|||
if (chkNotificacion.Checked)
|
||||
{
|
||||
divNotificacion.Visible = true;
|
||||
btnFinalizar.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -474,6 +819,8 @@ public partial class Forms_Trans_frwCartaSolicitud : General
|
|||
txtDestinatario.Text = "";
|
||||
txtObservaciones.Text = "";
|
||||
chkCFIA.Checked = false;
|
||||
btnFinalizar.Enabled = true;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -2331,7 +2678,7 @@ public partial class Forms_Trans_frwCartaSolicitud : General
|
|||
}
|
||||
|
||||
protected void btnFinalizar_Click(object sender, EventArgs e)
|
||||
{
|
||||
{
|
||||
try
|
||||
{
|
||||
int nActividad = 5;//confeccion de constancia
|
||||
|
|
@ -2419,6 +2766,51 @@ public partial class Forms_Trans_frwCartaSolicitud : General
|
|||
objNotificacionBL.objnotificacionEL.message = "OK";
|
||||
int nValorRetornado = objNotificacionBL.cancelarNotificacion(objNotificacionBL.objnotificacionEL);
|
||||
}
|
||||
|
||||
#region Notificacion
|
||||
if (chkNotificacion.Checked)
|
||||
{
|
||||
if (VerificarNotificacion())
|
||||
{
|
||||
int nNumSolicitudTMP = int.Parse(Session["PKSOLICITUD"].ToString());
|
||||
if (File.Exists(ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\" + lblNumSolicitud.Text))
|
||||
Directory.Delete(ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\" + lblNumSolicitud.Text,true);
|
||||
//GuardarDocumentoVision2020(nNumSolicitudTMP);
|
||||
programacionsolicitudBL objprogramacionsolicitudBL = new programacionsolicitudBL();
|
||||
objprogramacionsolicitudBL.objprogramacionsolicitudEL.FKESTADOPROGRAMACION = 3;
|
||||
objprogramacionsolicitudBL.objprogramacionsolicitudEL.FKSOLICITUD = int.Parse(Session["PKSOLICITUD"].ToString());
|
||||
objprogramacionsolicitudBL.objprogramacionsolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||||
int nPKProgramacionSolicitud = objprogramacionsolicitudBL.modificarprogramacionsolicitud();
|
||||
|
||||
if (nPKProgramacionSolicitud == objprogramacionsolicitudBL.objprogramacionsolicitudEL.FKSOLICITUD)
|
||||
{
|
||||
GuardarDatosActividad("finalizó");
|
||||
|
||||
|
||||
|
||||
|
||||
MensajeInformativo("Finalizó con éxito la actividad 7 Notificación al usuario.");
|
||||
//cancelar notificacion
|
||||
notificacionBL objNotificacionBL = new notificacionBL();
|
||||
|
||||
objNotificacionBL.objnotificacionEL.ID_DOCUMENTO = Session["SOLICITUD"].ToString() + " - Notificación al usuario";
|
||||
objNotificacionBL.objnotificacionEL.status = "00";
|
||||
objNotificacionBL.objnotificacionEL.message = "OK";
|
||||
int nValorRetornado = objNotificacionBL.cancelarNotificacion(objNotificacionBL.objnotificacionEL);
|
||||
}
|
||||
else
|
||||
{
|
||||
MensajeAlerta("Se presento un problema al finalizar la actividad por favor intente de nuevo.");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
MensajeAlerta("Falta finalizar la notificación al usuario.");
|
||||
}
|
||||
|
||||
#endregion
|
||||
//ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>javascript: MensajeInformativo('Se ha generado el documento PDF. ');</script>");
|
||||
}
|
||||
|
||||
|
|
@ -2601,6 +2993,231 @@ public partial class Forms_Trans_frwCartaSolicitud : General
|
|||
}
|
||||
return bValorRetornado;
|
||||
}
|
||||
private bool VerificarNotificacion()
|
||||
{
|
||||
bool bValor = false;
|
||||
try
|
||||
{
|
||||
if (chkCFIA.Checked == false)
|
||||
{
|
||||
notificacionClienteBL objNotificacionClienteBL = new notificacionClienteBL();
|
||||
objNotificacionClienteBL.objnotificacionClienteEL.FKSOLICITUD = int.Parse(Session["PKSOLICITUD"].ToString());
|
||||
DataSet ds = objNotificacionClienteBL.listarNotificacionCliente();
|
||||
|
||||
if (ds.Tables[0].Rows.Count != 0)
|
||||
{
|
||||
bValor = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string strRutaArchivosAdjuntos = string.Empty;
|
||||
int nNumSolicitudTMP = int.Parse(Session["PKSOLICITUD"].ToString());
|
||||
strRutaArchivosAdjuntos = obtenerCartaSolicitud(nNumSolicitudTMP);
|
||||
|
||||
//crear documento zip con los archivos adjuntos
|
||||
string strRutaDocumentos = ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\" + lblNumSolicitud.Text;
|
||||
DirectoryInfo diCarpeta = new DirectoryInfo(strRutaDocumentos);
|
||||
ZipFile zip = new ZipFile();
|
||||
foreach (FileInfo fi in diCarpeta.GetFiles())
|
||||
{
|
||||
if (fi.Extension == ".pdf")
|
||||
zip.AddFile(strRutaDocumentos + @"\" + fi.Name, "");
|
||||
}
|
||||
string strRutaDocZip = strRutaDocumentos + @"\" + lblNumSolicitud.Text + ".zip";
|
||||
zip.Save(strRutaDocZip);
|
||||
|
||||
//ser verifica el resultado de la solicitud
|
||||
solicitudBL objSolicitudBL = new solicitudBL();
|
||||
objSolicitudBL.objSolicitudEL.PK = int.Parse(strPKSolicitudTMP);
|
||||
|
||||
DataSet dsSolicitud = objSolicitudBL.dsExisteSolicitud(null);
|
||||
|
||||
if (dsSolicitud.Tables[0].Rows.Count > 0 && dsSolicitud.Tables[0].Rows[0]["DESCRIPCIONDESCRIPCIONCFIA"].ToString() != "N/A" && dsSolicitud.Tables[0].Rows[0]["DESCRIPCIONDESCRIPCIONCFIA"].ToString() != string.Empty)
|
||||
{
|
||||
nNumeroSolicitudCFIA = int.Parse(dsSolicitud.Tables[0].Rows[0]["DESCRIPCIONDESCRIPCIONCFIA"].ToString());
|
||||
}
|
||||
|
||||
//enviar notificacion a CFIA con el servicio de respuesta
|
||||
if (File.Exists(strRutaDocZip) && nNumeroSolicitudCFIA != 0)
|
||||
{
|
||||
APCR_WCF_Respuesta.ServicioClient wcfCfia = new APCR_WCF_Respuesta.ServicioClient();
|
||||
APCR_WCF_Respuesta.Respuestas respuestaAPCR;
|
||||
byte[] bRespuestaZip = System.IO.File.ReadAllBytes(strRutaDocZip);
|
||||
respuestaAPCR = wcfCfia.RespuestaSolicitud(nNumeroSolicitudCFIA, txtObservaciones.Text, 3, Session["LOGIN"].ToString(), bRespuestaZip, 3, ConfigurationManager.AppSettings["LLAVEAPCR"].ToString());
|
||||
if (respuestaAPCR.Respuesta == true)
|
||||
{
|
||||
bValor = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bValor = false;
|
||||
MensajeAlerta("Se presento el siguiente problema a la hora de notificar al CFIA: " + respuestaAPCR.DescripcionError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
return bValor;
|
||||
}
|
||||
private int GuardarDatosActividad(string p_accion) //M0
|
||||
{
|
||||
int nValorRetornado = 0;
|
||||
|
||||
try
|
||||
{
|
||||
AyABL.TRA.correoBL objcorreoBL = new AyABL.TRA.correoBL();
|
||||
//string strModo = ViewState["MODO"].ToString();
|
||||
int nPkSolicitud = 0;
|
||||
int nResultadoActualizar = 0;
|
||||
string strMensajeContenido = "";
|
||||
string strAsuntoCorreo = "";
|
||||
string strPiePagina = "</BR> </BR></BR>AVISO DE CONFIDENCIALIDAD: este mensaje y la información incluida en él es confidencial y está dirigida únicamente al destinatario. Puede contener información privilegiada, confidencial, amparada por el secreto profesional o que no debe ser revelada. Si usted ha recibido este correo por error, por favor comunicarlo inmediatamente vía correo y tener la amabilidad de eliminarlo de su sistema. Queda notificado que no deberá copiar este mensaje, ni utilizar, divulgar, publicar o distribuir su contenido de modo alguno. Todo mensaje enviado a esta dirección de correo electrónico puede ser sujeto a inspección por alguien distinto de su receptor originario. La transmisión de correos no garantiza que el correo electrónico sea seguro o libre de error. Por consiguiente, se advierte que esta información pueda estar incompleta o ser poco precisa ya que toda información está sujeta a alterarse sin previo aviso.”";
|
||||
|
||||
solicitudBL objSolicitudBL = new solicitudBL();
|
||||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||||
objSolicitudBL.objSolicitudEL.ORDEN = int.Parse(Session["NACTIVIDAD"].ToString());
|
||||
|
||||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||||
|
||||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
string strEncargadoActividad = dsEncargadosActividades.Tables[0].Rows[0]["PKRESPONSABLEACTIVIDAD"].ToString();
|
||||
|
||||
ObservacionesActividadesBL objObservacionesBL = new ObservacionesActividadesBL();
|
||||
//objObservacionesBL.objobservacionesEL.FKNUMSOLICITUD = strNumSolicitudTMP;
|
||||
objObservacionesBL.objobservacionesEL.DESCRIPCION = "\n" + DateTime.Now.ToString() + " - " + Session["NOMBREEMPLEADO"].ToString() + " - Se " + p_accion + " la notificación al usuario por parte del encargado : " + Session["NOMBREEMPLEADO"].ToString();
|
||||
objObservacionesBL.objobservacionesEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||||
objObservacionesBL.objobservacionesEL.PKRESPONSABLEACTIVIDAD = int.Parse(strEncargadoActividad);
|
||||
objObservacionesBL.objobservacionesEL.Fecha = DateTime.Now;
|
||||
objObservacionesBL.objobservacionesEL.TIPO = 1;
|
||||
//objObservacionesBL.objobservacionesEL.FKSOLICITUD = nPKSolicitud;
|
||||
//objObservacionesBL.objobservacionesEL.USUARIO = Session["LOGIN"].ToString();
|
||||
|
||||
nValorRetornado = objObservacionesBL.insertarObservacionActividad();
|
||||
|
||||
|
||||
if (nValorRetornado != 0)
|
||||
{
|
||||
solicitudBL objSolicitud = new solicitudBL();
|
||||
//objSolicitud.objresponsableActividadEL.PK = int.Parse(Session["PKRESPONSABLEACTIVIDAD"].ToString());
|
||||
//poner la actividad actual en estado correspondiente
|
||||
objSolicitud.objresponsableActividadEL.FECHADEVOLUCION = DateTime.Now;
|
||||
|
||||
foreach (DataRow row in dsEncargadosActividades.Tables[0].Rows)
|
||||
{
|
||||
|
||||
objSolicitud.objresponsableActividadEL.PK = int.Parse(row["PKRESPONSABLEACTIVIDAD"].ToString());
|
||||
if (p_accion == "finalizó")
|
||||
{
|
||||
|
||||
decimal nTiempoActividad = 0;
|
||||
if (row["CLASIFICACIONSOLICITUD"].ToString() == "Crecimiento vegetativo")
|
||||
nTiempoActividad = decimal.Parse(row["TIEMPOCVACTIVIDAD"].ToString());
|
||||
if (row["CLASIFICACIONSOLICITUD"].ToString() == "Desarrollo urbanistico")
|
||||
nTiempoActividad = decimal.Parse(row["TIEMPODUACTIVIDAD"].ToString());
|
||||
|
||||
char[] separadorColumna = { '.' };
|
||||
string[] strArrayTiempo = nTiempoActividad.ToString().Replace(",", ".").Split(separadorColumna);
|
||||
|
||||
DateTime dtFechaRecibido = DateTime.Parse(row["FECHAASIGNACIONRESPONSABLEACTIVIDAD"].ToString()).AddDays(double.Parse(strArrayTiempo[0].ToString()));
|
||||
if (double.Parse(strArrayTiempo[1].ToString()) > 0)
|
||||
dtFechaRecibido = dtFechaRecibido.AddHours(4);
|
||||
|
||||
|
||||
|
||||
|
||||
if (dtFechaRecibido > DateTime.Now)
|
||||
objSolicitud.objresponsableActividadEL.FKESTADO = 5;//finalizada a tiempo t_sgm_estadoactividad
|
||||
else
|
||||
objSolicitud.objresponsableActividadEL.FKESTADO = 8;//finalizada fuera de tiempo t_sgm_estadoactividad
|
||||
|
||||
strMensajeContenido = "La actividad " + Session["DESCRIPCIONACTIVIDAD"].ToString() + " de la solicitud N° " + Session["SOLICITUD"].ToString() + " ha sido concluida para ver los detalles, ingrese al sistema <a href=http://" + HttpContext.Current.Request.Url.Authority + "/Forms/wfrLogin.> SIGDD</a>" + strPiePagina;
|
||||
strAsuntoCorreo = "Conclusión de actividad - SIGDD";
|
||||
|
||||
//cancelar notificacion
|
||||
notificacionBL objNotificacionBL = new notificacionBL();
|
||||
|
||||
objNotificacionBL.objnotificacionEL.ID_DOCUMENTO = Session["SOLICITUD"].ToString() + " - Notificación al usuario";
|
||||
objNotificacionBL.objnotificacionEL.status = "00";
|
||||
objNotificacionBL.objnotificacionEL.message = "OK";
|
||||
nValorRetornado = objNotificacionBL.cancelarNotificacion(objNotificacionBL.objnotificacionEL);
|
||||
|
||||
}
|
||||
|
||||
nResultadoActualizar = objSolicitud.actualizarActividadSolicitud();
|
||||
|
||||
|
||||
}
|
||||
|
||||
#region Envio de correo
|
||||
|
||||
|
||||
|
||||
|
||||
int nActividad = int.Parse(Session["NACTIVIDAD"].ToString());
|
||||
//if (nActividad > 2)
|
||||
// nActividad = 2;//SE ENVIA PARA REPROGRAMAR11
|
||||
//else
|
||||
// nActividad = 1;
|
||||
|
||||
|
||||
//se envia correo a los encargados de la actividad 3
|
||||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||||
objSolicitudBL.objSolicitudEL.ORDEN = nActividad;
|
||||
dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||||
|
||||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow row in dsEncargadosActividades.Tables[0].Rows)
|
||||
{
|
||||
nPkSolicitud = Convert.ToInt32(row[1].ToString());//AQUI INSERTAMOS LA PK DE LA SOLICITUD
|
||||
|
||||
objcorreoBL.objcorreoEL.FKNUMSOLICITUD = nPkSolicitud;
|
||||
// objcorreoBL.objcorreoEL.CORREO = dsActividad.Tables[0].Rows[0]["LOGINUSUARIO"].ToString() + "@aya.go.cr";
|
||||
objcorreoBL.objcorreoEL.ASUNTO = strAsuntoCorreo;
|
||||
objcorreoBL.objcorreoEL.CONTENIDO = strMensajeContenido;
|
||||
objcorreoBL.objcorreoEL.FKUSUARIO = Convert.ToInt32(row["FKUSUARIOXDEPENDENCIA"].ToString());
|
||||
objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||||
|
||||
nValorRetornado = objcorreoBL.insertarCorreo();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
GuardarEventoBitacora(
|
||||
Session["LOGIN"].ToString(),
|
||||
AccionBitacora.INSERT.ToString(),
|
||||
MensajesBitacora.IngresarRegistro + "Se finaliza la notificación al usuario por parte del encargado: " + Session["NOMBREEMPLEADO"].ToString().Trim() + " para la solicitud N° " + Session["SOLICITUD"].ToString(),
|
||||
Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath),
|
||||
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
GuardarEventoBitacora(
|
||||
Session["LOGIN"].ToString(),
|
||||
AccionBitacora.INSERT.ToString(),
|
||||
MensajesBitacora.IngresarRegistro + ": Se ingreso una nueva observacion: Se finaliza la notificación al usuario por parte del encargado: " + Session["NOMBREEMPLEADO"].ToString().Trim(),
|
||||
Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath),
|
||||
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||||
);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
|
||||
return nValorRetornado;
|
||||
}
|
||||
|
||||
|
||||
private void AbrirVentanaEmergenteDevolucion()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -77,9 +77,9 @@
|
|||
<!--<add name="ADS" connectionString="Data Source=AYA-VSRV-BD;Initial Catalog=ADSv2;Persist Security Info=True;User ID=useradsv2;Password=us3radsv2" providerName="System.Data.SqlClient" />-->
|
||||
<!--<add name="SIGDD" connectionString="Data Source=AYA-VSRV-BD;Initial Catalog=SIGPC;Persist Security Info=True;User ID=usersigpc;Password=us3rsigpc" providerName="System.Data.SqlClient" />-->
|
||||
<add name="ADS" connectionString="Data Source=192.168.20.13\ULTIMUSDEV8;Initial Catalog=ADSv2;Persist Security Info=True;User ID=useradsv2;Password=useradsv2" providerName="System.Data.SqlClient"/>
|
||||
<add name="SIGDD" connectionString="Data Source=192.168.20.13\ULTIMUSDEV8;initial catalog=SIGPC;persist security info=True;user id=db_proyectos;password=Atesa$2020" providerName="System.Data.SqlClient"/>
|
||||
<add name="NOTIFICACIONES" connectionString="Data Source=192.168.20.13\ULTIMUSDEV8;;Initial Catalog=NOTIFICACIONES;Persist Security Info=True;User id=db_proyectos;password=Atesa$2020" providerName="System.Data.SqlClient"/>
|
||||
<add name="SDAAConnectionString" connectionString="Data Source=192.168.20.13\ULTIMUSDEV8;Initial Catalog=SIGPC;Persist Security Info=True;user id=db_proyectos;password=Atesa$2020" providerName="System.Data.SqlClient"/>
|
||||
<add name="SIGDD" connectionString="Data Source=192.168.20.13\ULTIMUSDEV8;initial catalog=SIGPC;persist security info=True;user id=db_proyectos;password=$Atesa21" providerName="System.Data.SqlClient"/>
|
||||
<add name="NOTIFICACIONES" connectionString="Data Source=192.168.20.13\ULTIMUSDEV8;;Initial Catalog=NOTIFICACIONES;Persist Security Info=True;User id=db_proyectos;password=$Atesa21" providerName="System.Data.SqlClient"/>
|
||||
<add name="SDAAConnectionString" connectionString="Data Source=192.168.20.13\ULTIMUSDEV8;Initial Catalog=SIGPC;Persist Security Info=True;user id=db_proyectos;password=$Atesa21" providerName="System.Data.SqlClient"/>
|
||||
</connectionStrings>
|
||||
<!--
|
||||
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue