2860 lines
No EOL
144 KiB
C#
2860 lines
No EOL
144 KiB
C#
/*===========================================================================================================================
|
||
* Instituto Costarricense de Acueductos y Alcantarillados. - 2015
|
||
* Administración de la Seguridad
|
||
* Nombre de la Pantalla: frwBusquedaSolicitud.aspx
|
||
*
|
||
* Explicación de los contenidos del archivo
|
||
*===========================================================================================================================
|
||
* HISTORIAL
|
||
*
|
||
* PERSONA DIA – MES - AÑO DESCRIPCIÓN
|
||
* Esteban Gutierrez Rapso 20 – 04 - 2015 Se inicia con el diseño de la pagina
|
||
* …………………………………………………………
|
||
* …………………………………………………………
|
||
*===========================================================================================================================
|
||
* Derechos Reservados (C) 2015 AyA.
|
||
* ESTE CÓDIGO ES PROVEÍDO “TAL CUAL ES” SIN GARANTÍA ALGUNA
|
||
* DE NINGÚN TIPO, SEA IMPLICITA O EXPLICITA.
|
||
* NO SE PERMITE SU REPRODUCCIÓN PARCIAL O TOTAL, NI SU COMERCIALIZACIÓN
|
||
*===========================================================================================================================
|
||
*/
|
||
|
||
using System;
|
||
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using System.Data;
|
||
using System.Linq;
|
||
using System.Web;
|
||
using System.Web.UI;
|
||
using System.Web.UI.WebControls;
|
||
using System.Web.UI.HtmlControls;
|
||
|
||
using AyABL;
|
||
|
||
using AyABL.AUT.Autenticacion;
|
||
using AyABL.APL;
|
||
using AyADAL;
|
||
using System.Configuration;
|
||
using AyABL.RCS;
|
||
using AyABL.Tran;
|
||
using AyABL.Usuario;
|
||
using AyABL.AUT.Encripta;
|
||
using System.Globalization;
|
||
using AyABL.TRA;
|
||
using System.IO;
|
||
|
||
|
||
public partial class Forms_Trans_frwGestionTrabajo : General
|
||
{
|
||
|
||
#region Inicializar Formulario (R0)
|
||
|
||
override protected void OnInit(EventArgs e) //M0
|
||
{
|
||
try
|
||
{
|
||
base.OnInit(e);
|
||
|
||
InicializarFormulario();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R0M0", ex);
|
||
}
|
||
}
|
||
|
||
private void InicializarFormulario() //M1
|
||
{
|
||
try
|
||
{
|
||
Response.Cache.SetCacheability(HttpCacheability.NoCache);
|
||
|
||
|
||
construirGridView();
|
||
|
||
Javascript.CheckAllGridViewItems(Page);
|
||
|
||
cuwBusquedaList.Buscar += new _controlesusuario_Estandar_cuwBusquedaList.SearchEvent(Buscar);
|
||
cuwVentanaEmergenteDevolucion.AbrirVentanaEmergenteDevolucion += new ControlUsuario_cuwVentanaEmergenteDevolucion.SearchEvent(AbrirVentanaEmergenteDevolucion);
|
||
cuwVentanaEmergenteObservaciones.AbrirVentanaEmergenteObservaciones += new ControlUsuario_cuwVentanaEmergenteObservaciones.SearchEvent(AbrirVentanaEmergenteObservaciones);
|
||
cuwVentanaEmergenteObservaciones1.AbrirVentanaEmergenteObservaciones += new ControlUsuario_cuwVentanaEmergenteObservaciones.SearchEvent(AbrirVentanaEmergenteObservacionesAS);
|
||
cuwVentanaEmergenteObservaciones2.AbrirVentanaEmergenteObservaciones += new ControlUsuario_cuwVentanaEmergenteObservaciones.SearchEvent(AbrirVentanaEmergenteObservacionesAP);
|
||
cuwVentanaEmergenteRequisitos.AbrirVentanaEmergente += new ControlUsuario_cuwVentanaEmergenteRequisitos.SearchEvent(AbrirVentanaEmergente);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R0M1", ex);
|
||
}
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Variables (R1)
|
||
|
||
GridView grvListaDatosTemp;
|
||
//string strPKProgramacionSolicitudTMP = "";
|
||
#region variables del estandar
|
||
ArrayList arlCondicionesFiltroBusqueda = new ArrayList();
|
||
#endregion
|
||
|
||
solicitudBL objSolicitudBL;
|
||
//oficinaayaBL objDependenciaBL;
|
||
//regionBL objRegionBL;
|
||
solicitudBL objresponsableActividadBL;
|
||
int nPkSolicitud = 0;
|
||
|
||
#endregion
|
||
|
||
#region Eventos Formulario (R2)
|
||
|
||
protected void Page_Load(object sender, EventArgs e) //M0
|
||
{
|
||
try
|
||
{
|
||
lblMensajeConsulta.Visible = false;
|
||
if (ViewState["POPUP"] != null)
|
||
{
|
||
if (ViewState["POPUP"].ToString() == "VentanaEmergente")
|
||
{
|
||
EjecutarScript("VentanaAbrirActividades();");
|
||
ViewState["POPUP"] = null;
|
||
}
|
||
else
|
||
{
|
||
if (ViewState["POPUP"].ToString() == "VentanaEmergenteAP")
|
||
{
|
||
EjecutarScript("VentanaAbrirActividades();VentanaAbrirFormularioAP();");
|
||
ViewState["POPUP"] = null;
|
||
}
|
||
else
|
||
{
|
||
if (ViewState["POPUP"].ToString() == "VentanaEmergenteAS")
|
||
{
|
||
EjecutarScript("VentanaAbrirActividades();VentanaAbrirFormularioAS();");
|
||
ViewState["POPUP"] = null;
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
}
|
||
//else
|
||
//{
|
||
// if (Session["Pagina"] != null)
|
||
// {
|
||
// if (Request["d"] == "BackCartas")
|
||
// {
|
||
// int pkSolicitud = 0;
|
||
// int pkProgramacion = 0;
|
||
// if (Session["PKSOLICITUD"] != null)
|
||
// {
|
||
// pkSolicitud = int.Parse(Session["PKSOLICITUD"].ToString());
|
||
// }
|
||
// if (Session["PKPROGRAMACION"] != null && Session["PKPROGRAMACION"] != string.Empty)
|
||
// {
|
||
// pkProgramacion = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
// }
|
||
// EjecutarScript("VentanaAbrirActividades();");
|
||
// CargarImagenesSeguimientoActividades(pkProgramacion);
|
||
// }
|
||
// }
|
||
//}
|
||
//Session["Pagina"] = "frwCartaSolicitud.aspx";
|
||
if ((!IsPostBack) && (Session.Count > 0))
|
||
{
|
||
lblMensajeConsulta.Visible = true;
|
||
Session["NACTIVIDAD"] = string.Empty;
|
||
DateTime dteFechaInicio = new DateTime();
|
||
DateTime dteFechaFin = new DateTime();
|
||
|
||
dteFechaFin = DateTime.Now;
|
||
dteFechaInicio = dteFechaFin.AddMonths(-10);
|
||
|
||
AyABL.AyABL objBL = new AyABL.AyABL();
|
||
arlCondicionesFiltroBusqueda = objBL.buscarPorFechas(Tablas.insertasolicitud, dteFechaInicio, dteFechaFin, operadorLogico.AND);
|
||
|
||
llenarGridViewPendientes(true,10);
|
||
//llenarDDLActividades(true);
|
||
//llenarDDLEncargado(true);
|
||
arlCondicionesFiltroBusqueda = null;
|
||
mostrarFilaTabla(1);
|
||
ComandosxMenu();
|
||
limpiarCampos();
|
||
}
|
||
else
|
||
{
|
||
if (Session["PKPROGRAMACION"] != null && Session["PKPROGRAMACION"] != string.Empty)
|
||
CargarImagenesSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
}
|
||
if (Session.Count == 0)
|
||
Response.Redirect("../wfrLogin.aspx?sesion=expiro", false);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
Response.Redirect("../wfrLogin.aspx?sesion=expiro", false);
|
||
}
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Eventos Controles Web (R3)
|
||
|
||
/// <summary>
|
||
/// Metodo que se utiliza para extraer información del registro de la base de datos y ser mostrado en el acordeon de Controles
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
|
||
protected void grvListaDatos_RowCommand(object sender, GridViewCommandEventArgs e) //M0
|
||
{
|
||
try
|
||
{
|
||
Session["PaginaBack"] = "frwGestionarTrabajo.aspx";
|
||
if (e.CommandName == "editar")
|
||
{
|
||
EncriptaBL objEncripta = new EncriptaBL();
|
||
int i = Convert.ToInt32(e.CommandArgument);
|
||
GridViewRow selectedRow = grvListaDatos.Rows[i];
|
||
Session["PKSOLICITUD"] = selectedRow.Cells[11].Text;
|
||
Session["SOLICITUD"] = selectedRow.Cells[3].Text;
|
||
Session["PKPROGRAMACION"] = selectedRow.Cells[2].Text;
|
||
Session["FKREUTILIZA"] = selectedRow.Cells[12].Text;
|
||
Session["FKTIPOINSPECCION"] = selectedRow.Cells[13].Text;
|
||
Session["ESTADO"] = selectedRow.Cells[14].Text.Trim();
|
||
ArrayList arlCondicionesFiltroBusqueda = new ArrayList();
|
||
if (Session["PKPROGRAMACION"].ToString() != " ") //se verifica que existe la programacion de la solicitud
|
||
{
|
||
solicitudBL objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 1; //la actividad de Ingreso y asignacion de expediente
|
||
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(arlCondicionesFiltroBusqueda);
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0) //se verifica que ya se haya asignado la actividad 1
|
||
{
|
||
bool existe = false;
|
||
foreach (DataRow row in dsEncargadosActividades.Tables[0].Rows)
|
||
{
|
||
if (row["FKUSUARIOXDEPENDENCIA"].ToString().Trim() == Session["PKUSUARIOXDEPENDENCIA"].ToString().Trim())
|
||
existe = true;
|
||
}
|
||
if(existe)
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&d=ingresodatos");
|
||
else
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&d=deshabilitar");
|
||
|
||
}
|
||
else
|
||
{
|
||
MensajeAlerta("No se han programado las actividades relacionadas con esta solicitud");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MensajeAlerta("No se han programado las actividades relacionadas con esta solicitud");
|
||
}
|
||
|
||
}
|
||
if (e.CommandName == "asignar")
|
||
{
|
||
// ClientScript.RegisterStartupScript(this.GetType(), "AbripPopup", "<script>javascript: abrirPopup();</script>");
|
||
int i = Convert.ToInt32(e.CommandArgument);
|
||
GridViewRow selectedRow = grvListaDatos.Rows[i];
|
||
Session["PKPROGRAMACION"] = selectedRow.Cells[2].Text;
|
||
Session["SOLICITUD"] = selectedRow.Cells[3].Text;
|
||
Session["PKSOLICITUD"] = selectedRow.Cells[11].Text;
|
||
Session["FKREUTILIZA"] = selectedRow.Cells[12].Text;
|
||
Session["FKTIPOINSPECCION"] = selectedRow.Cells[13].Text;
|
||
Session["ESTADO"] = selectedRow.Cells[14].Text.Trim();
|
||
Session["FKDEPENDENCIASIGDD"] = selectedRow.Cells[15].Text;
|
||
int pkSolicitud = 0;
|
||
if (selectedRow.Cells[2].Text != " ")
|
||
{
|
||
pkSolicitud = int.Parse(selectedRow.Cells[2].Text);
|
||
llenarGridViewActividadesEncargado(pkSolicitud);
|
||
}
|
||
llenarDDLActividades(true);
|
||
llenarDDLEncargado(true);
|
||
EjecutarScript("VentanaAbrir();");
|
||
|
||
|
||
|
||
}
|
||
|
||
if (e.CommandName == "seguimiento")
|
||
{
|
||
|
||
int i = Convert.ToInt32(e.CommandArgument);
|
||
GridViewRow selectedRow = grvListaDatos.Rows[i];
|
||
Session["PKPROGRAMACION"] = selectedRow.Cells[2].Text;
|
||
Session["PKSOLICITUD"] = selectedRow.Cells[11].Text;
|
||
Session["FKREUTILIZA"] = selectedRow.Cells[12].Text;
|
||
Session["FKTIPOINSPECCION"] = selectedRow.Cells[13].Text;
|
||
Session["FKDEPENDENCIASIGDD"] = selectedRow.Cells[15].Text;
|
||
Session["ESTADO"] = selectedRow.Cells[14].Text.Trim();
|
||
int pkSolicitud = int.Parse(selectedRow.Cells[2].Text);
|
||
Session["SOLICITUD"] = selectedRow.Cells[3].Text;
|
||
EjecutarScript("VentanaAbrirActividades();");
|
||
CargarImagenesSeguimientoActividades(pkSolicitud);
|
||
lblNumeroSolicitud.Text = selectedRow.Cells[3].Text;
|
||
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M0", ex);
|
||
}
|
||
}
|
||
|
||
|
||
|
||
/// <summary>
|
||
/// Metodo que se utiliza para la paginación del Grid en caso de que el usuario desee ver mas registros
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
|
||
protected void grvListaDatos_PageIndexChanging(object sender, GridViewPageEventArgs e) //M1
|
||
{
|
||
try
|
||
{
|
||
grvListaDatos.PageIndex = e.NewPageIndex;
|
||
llenarGridViewPendientes(true,1000);
|
||
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M1", ex);
|
||
}
|
||
}
|
||
|
||
///<summary>
|
||
///Activar el botón de Refrescar
|
||
///</summary>
|
||
///<param name="sender"></param>
|
||
///<param name="e"></param>
|
||
|
||
protected void btnRefrescar_Click(object sender, System.Web.UI.ImageClickEventArgs e) //M2
|
||
{
|
||
try
|
||
{
|
||
llenarGridViewPendientes(true,1000);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M2" + MensajesAplicacion.RefrescarFallido.ToString(), ex);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Activa el evento del botón Buscar (binoculares)
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void btnBuscar_Click(object sender, System.Web.UI.ImageClickEventArgs e) //M3
|
||
{
|
||
try
|
||
{
|
||
llenarGridViewPendientes(true,1000);
|
||
}
|
||
catch(Exception ex)
|
||
{
|
||
MensajeError("Error en R3M3" + MensajesAplicacion.UsuarioInexistente.ToString(), ex);
|
||
}
|
||
}
|
||
|
||
|
||
|
||
|
||
/// <summary>
|
||
/// Buscar usuarios en el Active Directory.
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
|
||
protected void btnBuscar_Click(object sender, EventArgs e) //M4
|
||
{
|
||
try
|
||
{
|
||
llenarGridViewPendientes(true,1000);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M4" + MensajesAplicacion.BusquedaFallido.ToString(), ex);
|
||
}
|
||
}
|
||
/// <summary>
|
||
/// Salir del popup
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void btnSalirPopup_Click(object sender, EventArgs e) //M5
|
||
{
|
||
try
|
||
{
|
||
|
||
|
||
CargarImagenesSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
EjecutarScript("VentanaCerrar();VentanaAbrirActividades();");
|
||
//Session["PKPROGRAMACION"] = "";
|
||
|
||
limpiarCampos();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M5" + MensajesAplicacion.BusquedaFallido.ToString(), ex);
|
||
}
|
||
}
|
||
/// <summary>
|
||
/// Carga el combo de encargados
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void ddlActividades_SelectedIndexChanged(object sender, EventArgs e) //M6
|
||
{
|
||
try
|
||
{
|
||
llenarDDLEncargado(true);
|
||
EjecutarScript("VentanaAbrir();");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M6" + MensajesAplicacion.BusquedaFallido.ToString(), ex);
|
||
}
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// Asigna actividades a los usuarios
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void btnAsignarActividades_Click(object sender, EventArgs e) //M7
|
||
{
|
||
try
|
||
{
|
||
ViewState["MODO"] = "Nuevo";
|
||
AsignaActividadesUsuarios();
|
||
|
||
llenarGridViewActividadesEncargado(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
EjecutarScript("VentanaAbrir();");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M7" + MensajesAplicacion.GuardadoFallido.ToString(), ex);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Metodo utilizado para eliminar las actividades asignadas al encargado
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void grvListaAsignaciones_RowCommand(object sender, GridViewCommandEventArgs e) //M8
|
||
{
|
||
try
|
||
{
|
||
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.”";
|
||
|
||
|
||
if (e.CommandName == "borrar")
|
||
{
|
||
int i = Convert.ToInt32(e.CommandArgument);
|
||
GridViewRow selectedRow = grvListaAsignaciones.Rows[i];
|
||
Session["PKACTIVIDAD"] = selectedRow.Cells[1].Text;
|
||
|
||
EliminarActividadesUsuarios(int.Parse(Session["PKACTIVIDAD"].ToString()));
|
||
|
||
llenarGridViewActividadesEncargado(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
|
||
Session["PKACTIVIDAD"] = "";
|
||
EjecutarScript("VentanaAbrir();");
|
||
}
|
||
if (e.CommandName == "renotificar")
|
||
{
|
||
int i = Convert.ToInt32(e.CommandArgument);
|
||
GridViewRow selectedRow = grvListaAsignaciones.Rows[i];
|
||
AyABL.TRA.correoBL objcorreoBL = new AyABL.TRA.correoBL();
|
||
objcorreoBL.objcorreoEL.FKNUMSOLICITUD = int.Parse(Session["PKSOLICITUD"].ToString());
|
||
// objcorreoBL.objcorreoEL.CORREO = dsActividad.Tables[0].Rows[0]["LOGINUSUARIO"].ToString() + "@aya.go.cr";
|
||
objcorreoBL.objcorreoEL.ASUNTO = "Asignación de actividades - SIGDD";
|
||
objcorreoBL.objcorreoEL.CONTENIDO = "La solicitud de disponibilidad " + Session["SOLICITUD"].ToString() + " fue enviada para que se continúe con el proceso de " + selectedRow.Cells[2].Text + ", ingrese al sistema <a href=http://" + HttpContext.Current.Request.Url.Authority + "/Forms/wfrLogin> SIGDD</a>" + strPiePagina;
|
||
objcorreoBL.objcorreoEL.FKUSUARIO = Convert.ToInt32(selectedRow.Cells[4].Text);
|
||
objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||
|
||
int nValorRetornado = objcorreoBL.insertarCorreo();
|
||
#region actualizar actividad
|
||
GuardarDatosActividad(verificarTarea2());
|
||
#endregion
|
||
EjecutarScript("VentanaAbrir();toastr.success('Se envió la notificación al responsable', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
|
||
MensajeError("Error en R3M8", ex);
|
||
}
|
||
}
|
||
|
||
protected void grvListaDatos_RowDataBound(object sender, GridViewRowEventArgs e) //M9
|
||
{
|
||
try
|
||
{
|
||
|
||
if (e.Row.DataItem != null)
|
||
{
|
||
Session["ESTADO"] = e.Row.Cells[15].Text.Trim();
|
||
e.Row.Cells[1].ToolTip = "Solicitud de disponibilidad";
|
||
//e.Row.Cells[16].ToolTip = "Asignar actividades";
|
||
e.Row.Cells[16].ToolTip = "Gestionar actividades";
|
||
e.Row.Cells[11].Text = e.Row.Cells[11].Text.Replace(",", "</br>");
|
||
//if (!consultarActividadProgramacion(int.Parse(e.Row.Cells[2].Text)))
|
||
//{
|
||
// e.Row.Cells[16].Enabled = false;
|
||
// e.Row.Cells[16].Attributes.CssStyle.Add("opacity", "0.5");
|
||
|
||
//}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Se produjo un error al realizar la consulta.", ex);
|
||
}
|
||
|
||
}
|
||
protected void btnSalirActividades_Click(object sender, EventArgs e) //M10
|
||
{
|
||
try
|
||
{
|
||
Session["PKPROGRAMACION"] = "";
|
||
EjecutarScript("VentanaCerrarActividades();");
|
||
limpiarCampos();
|
||
ViewState["POPUP"] = "";
|
||
EjecutarScript("VentanaAbrirActividades();");
|
||
CargarImagenesSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M5" + MensajesAplicacion.BusquedaFallido.ToString(), ex);
|
||
}
|
||
}
|
||
protected void Image2_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
try
|
||
{
|
||
CargarSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()), 1,"Ingreso y asignación de expedientes");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error al mostrar el detalle de la actividad seleccionada", ex);
|
||
}
|
||
}
|
||
protected void Image6_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
try
|
||
{
|
||
CargarSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()), 2,"Programación de trabajo");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error al mostrar el detalle de la actividad seleccionada", ex);
|
||
}
|
||
}
|
||
protected void Image3_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
try
|
||
{
|
||
CargarSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()), 3,"Confección del Criterio técnico de agua potable");
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error al mostrar el detalle de la actividad seleccionada", ex);
|
||
}
|
||
}
|
||
protected void Image7_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
try
|
||
{
|
||
CargarSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()), 4, "Confección del Criterio técnico de alcantarillado sanitario");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error al mostrar el detalle de la actividad seleccionada", ex);
|
||
}
|
||
}
|
||
protected void Image9_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
try
|
||
{
|
||
CargarSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()), 5,"Confección de constancias");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error al mostrar el detalle de la actividad seleccionada", ex);
|
||
}
|
||
}
|
||
protected void Image11_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
try
|
||
{
|
||
CargarSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()), 6,"Validación y firma");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error al mostrar el detalle de la actividad seleccionada", ex);
|
||
}
|
||
}
|
||
protected void Image13_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
try
|
||
{
|
||
CargarSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()), 7,"Notificación al usuario");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error al mostrar el detalle de la actividad seleccionada", ex);
|
||
}
|
||
}
|
||
|
||
protected void grvListaAsignaciones_PageIndexChanging(object sender, GridViewPageEventArgs e)
|
||
{
|
||
try
|
||
{
|
||
EjecutarScript("VentanaAbrir();");
|
||
grvListaAsignaciones.PageIndex = e.NewPageIndex;
|
||
llenarGridViewActividadesEncargado(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M1", ex);
|
||
|
||
}
|
||
}
|
||
protected void imgFormularioAP_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
solicitudBL objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 1;//se valida la tarea 1 ingreso y asignacion de expediente debido a que no se puede crear las constancias sin la informacion que se encuentra en el este formulario
|
||
objSolicitudBL.objSolicitudEL.FKESTADO = 5;
|
||
objSolicitudBL.objSolicitudEL.FKESTADO2 = 8;
|
||
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||
{
|
||
if (Session["SOLICITUD"] != null && Session["PKUSUARIOXDEPENDENCIA"] != null)
|
||
EjecutarScript("VentanaAbrirFormularioAP();");
|
||
else
|
||
Response.Redirect("../wfrLogin.aspx?sesion=expiro", false);
|
||
}
|
||
else
|
||
{
|
||
string p_strMensaje = "No se ha finalizado el ingreso y asignación del expediente de donde se obtienen los datos necesarios para crear las contancias.";
|
||
EjecutarScript("VentanaAbrirActividades();toastr.success('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
|
||
}
|
||
}
|
||
|
||
protected void imgFormularioAS_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
solicitudBL objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 1;//se valida la tarea 1 ingreso y asignacion de expediente debido a que no se puede crear las constancias sin la informacion que se encuentra en el este formulario
|
||
objSolicitudBL.objSolicitudEL.FKESTADO = 5;
|
||
objSolicitudBL.objSolicitudEL.FKESTADO2 = 8;
|
||
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||
{
|
||
if (Session["SOLICITUD"] != null && Session["PKUSUARIOXDEPENDENCIA"] != null)
|
||
EjecutarScript("VentanaAbrirFormularioAS();");
|
||
else
|
||
Response.Redirect("../wfrLogin.aspx?sesion=expiro", false);
|
||
}
|
||
else
|
||
{
|
||
//MensajeAlerta("No se ha finalizado el ingreso de y asignación del expediente de donde se obtienen los datos necesarios para crear las contancias.");
|
||
string p_strMensaje = "No se ha finalizado el ingreso de y asignación del expediente de donde se obtienen los datos necesarios para crear las contancias.";
|
||
EjecutarScript("VentanaAbrirActividades();toastr.success('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
}
|
||
protected void imgConstancias_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
solicitudBL objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 1;//se valida la tarea 1 ingreso y asignacion de expediente debido a que no se puede crear las constancias sin la informacion que se encuentra en el este formulario
|
||
objSolicitudBL.objSolicitudEL.FKESTADO = 5;
|
||
objSolicitudBL.objSolicitudEL.FKESTADO2 = 8;
|
||
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
int nTipoInspeccion = int.Parse(dsEncargadosActividades.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString()) ;
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||
{
|
||
if (Session["SOLICITUD"] != null && Session["PKUSUARIOXDEPENDENCIA"] != null)
|
||
{
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 3;//se valida la tarea 3 confeccion de criterio tecnico ap debido a que no se puede crear las constancias sin la informacion que se encuentra en el este formulario
|
||
dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0 || nTipoInspeccion == 2)
|
||
{
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 4;//se valida la tarea 4 confeccion de criterio tecnico as debido a que no se puede crear las constancias sin la informacion que se encuentra en el este formulario
|
||
dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0 || nTipoInspeccion == 1)
|
||
{
|
||
EncriptaBL objEncripta = new EncriptaBL();
|
||
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 5;//se valida la tarea 5 confeccion de la constancia para deshabilitar el boton de editar
|
||
dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)// || nTipoInspeccion == 1)
|
||
{
|
||
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&c=confeccion&f=finalizado&d=constancia");
|
||
|
||
|
||
}
|
||
else
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&c=confeccion&d=constancia");
|
||
|
||
|
||
}
|
||
else
|
||
{
|
||
//MensajeAlerta("No se ha finalizado la confección de criterio técnico as de donde se obtienen los datos necesarios para crear las contancias.");
|
||
string p_strMensaje = "No se ha finalizado la confección de criterio técnico de alcantarillado sanitario de donde se obtienen los datos necesarios para crear las contancias.";
|
||
EjecutarScript("VentanaAbrirActividades();toastr.warning('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//MensajeAlerta("No se ha finalizado la confección de criterio técnico ap de donde se obtienen los datos necesarios para crear las contancias.");
|
||
string p_strMensaje = "No se ha finalizado la confección de criterio técnico agua potable de donde se obtienen los datos necesarios para crear las contancias.";
|
||
EjecutarScript("VentanaAbrirActividades();toastr.warning('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
}
|
||
else
|
||
Response.Redirect("../wfrLogin.aspx?sesion=expiro", false);
|
||
}
|
||
else
|
||
{
|
||
//MensajeAlerta("No se ha finalizado el ingreso y asignación del expediente de donde se obtienen los datos necesarios para crear las contancias.");
|
||
string p_strMensaje = "No se ha finalizado el ingreso y asignación del expediente de donde se obtienen los datos necesarios para crear las contancias.";
|
||
EjecutarScript("VentanaAbrirActividades();toastr.warning('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
}
|
||
protected void btnSalirCriterioAP_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
EjecutarScript("VentanaCerrarFormularioAP();VentanaAbrirActividades();");
|
||
|
||
//CargarImagenesSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
EjecutarScript("window.parent.VentanaCerrarFormularioASSesion();");
|
||
}
|
||
}
|
||
protected void btnSalirCriterioAS_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
EjecutarScript("VentanaCerrarFormularioAS();VentanaAbrirActividades();");
|
||
//CargarImagenesSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
EjecutarScript("window.parent.VentanaCerrarFormularioASSesion();");
|
||
}
|
||
}
|
||
protected void btnSalirNotificacionCliente_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
|
||
//string pdfPathDocumentos = ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\" + Session["SOLICITUD"].ToString().Trim();
|
||
//if (Directory.Exists(pdfPathDocumentos))
|
||
// Directory.Delete(pdfPathDocumentos, true);
|
||
EjecutarScript("VentanaCerrarNotificacionCliente();VentanaAbrirActividades();");
|
||
//CargarImagenesSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
EjecutarScript("window.parent.VentanaCerrarNotificacionClienteSesion();");
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region Metodos Personalizados (R4)
|
||
|
||
/// <summary>
|
||
/// Oculta las filas que lo requieran
|
||
/// </summary>
|
||
/// <param name="p_intFila"></param>
|
||
private void mostrarFilaTabla(int p_intFila) //M0
|
||
{
|
||
try
|
||
{
|
||
divDatosSuperiores.Visible = true;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Metodo que se utiliza para contruir el Grid al inicio de la pantalla
|
||
/// </summary>
|
||
private void construirGridView() //M1
|
||
{
|
||
try
|
||
{
|
||
grvListaDatosTemp = (GridView)tdLista.FindControl("grvListaDatos");
|
||
|
||
|
||
GridViewBoundField bdfPkProgramacion = new GridViewBoundField("PKPROGRAMACIONSOLICITUD", "PK", false, false, false);
|
||
GridViewBoundField bdfNumSolicitud = new GridViewBoundField("NUMEROSOLICITUDSOLICITUD", "Número solicitud", true, false, true);
|
||
GridViewBoundField bdfFechaBitacora = new GridViewBoundField("FECHAINSERTASOLICITUD", "Fecha", true, true, true);
|
||
GridViewBoundField bdfPropietario = new GridViewBoundField("DESCRIPCIONTIPODISPONIBILIDAD", "Tipo de trámite", true, false, true);
|
||
GridViewBoundField bdfCedulaProp = new GridViewBoundField("CEDULACLIENTESOLICITUD", "Identificación propietario", true, false, true);
|
||
GridViewBoundField bdfNombreProp = new GridViewBoundField("NOMBRECLIENTESOLICITUD", "Nombre propietario", true, false, true);
|
||
GridViewBoundField bdfFolio = new GridViewBoundField("PKFOLIO", "Folio", true, false, true);
|
||
GridViewBoundField bdfPlano = new GridViewBoundField("NUMEROTERRENO", "Inmueble", true, false, true);
|
||
|
||
//GridViewBoundField bdfCedulaSolic = new GridViewBoundField("CEDULASOLICITANTESOLICITUD", "Identificación solicitante", false, false, false);
|
||
//GridViewBoundField bdfNombreSolic = new GridViewBoundField("NOMBRECOMPLETOSOLICITANTE", "Nombre solicitante", false, false,false);
|
||
GridViewBoundField bdfDescripcion = new GridViewBoundField("DESCRIPCIONPROYECTO", "Propósito", true, false, true);
|
||
//GridViewBoundField bdfEstado = new GridViewBoundField("ACTIVIDADESSOLICITUD", "Estado actividad", true, false, true);
|
||
GridViewBoundField bdfPkSolicitud = new GridViewBoundField("PKSOLICITUD", "PK", false, false, false);
|
||
GridViewBoundField bdfFkReutiliza = new GridViewBoundField("FKREUTILIZA", "FK", false, false, false);
|
||
GridViewBoundField bdfFkTipoInspeccion = new GridViewBoundField("FKTIPOINSPECCION", "FK", false, false, false);
|
||
GridViewBoundField bdfEstadoProgramacion = new GridViewBoundField("DESCRIPCIONESTADOPROGRAMACION", "Estado", true, false, false);
|
||
GridViewBoundField bdfFkDependenciaSIGDD = new GridViewBoundField("FKDEPENDENCIASIGDD", "FK", false, false, false);
|
||
|
||
//bdfEstado.HtmlEncode = true;
|
||
|
||
grvListaDatosTemp.Columns.Add(bdfPkProgramacion);
|
||
grvListaDatosTemp.Columns.Add(bdfNumSolicitud);
|
||
grvListaDatosTemp.Columns.Add(bdfFechaBitacora);
|
||
grvListaDatosTemp.Columns.Add(bdfPropietario);
|
||
grvListaDatosTemp.Columns.Add(bdfCedulaProp);
|
||
grvListaDatosTemp.Columns.Add(bdfNombreProp);
|
||
grvListaDatosTemp.Columns.Add(bdfPlano);
|
||
grvListaDatosTemp.Columns.Add(bdfFolio);
|
||
grvListaDatosTemp.Columns.Add(bdfDescripcion);
|
||
//grvListaDatosTemp.Columns.Add(bdfEstado);
|
||
grvListaDatosTemp.Columns.Add(bdfPkSolicitud);
|
||
grvListaDatosTemp.Columns.Add(bdfFkReutiliza);
|
||
grvListaDatosTemp.Columns.Add(bdfFkTipoInspeccion);
|
||
grvListaDatosTemp.Columns.Add(bdfEstadoProgramacion);
|
||
grvListaDatosTemp.Columns.Add(bdfFkDependenciaSIGDD);
|
||
|
||
grvListaDatosTemp.Columns[0].ItemStyle.Width = 25;
|
||
grvListaDatosTemp.Columns[1].ItemStyle.Width = 25;
|
||
grvListaDatosTemp.Columns[5].ItemStyle.Width = 200;
|
||
grvListaDatosTemp.Columns[4].ItemStyle.Width = 200;
|
||
grvListaDatosTemp.Columns[7].ItemStyle.Width = 200;
|
||
grvListaDatosTemp.Columns[9].ItemStyle.Width = 200;
|
||
grvListaDatosTemp.Columns[10].ItemStyle.Width = 200;
|
||
|
||
cuwBusquedaList.LlenarCHKLBusqueda(grvListaDatosTemp);
|
||
//ButtonField bf = new ButtonField();
|
||
//bf.ButtonType= ButtonType.Image;
|
||
//bf.Text = "Asignar actividades";
|
||
|
||
//bf.HeaderText = "Acciones";
|
||
//bf.ImageUrl = "~/Images/MiniBotones/Asignar.png";
|
||
//bf.CommandName = "asignar";
|
||
//grvListaDatosTemp.Columns.Add(bf);
|
||
|
||
ButtonField bfActividades = new ButtonField();
|
||
bfActividades.ButtonType = ButtonType.Image;
|
||
bfActividades.Text = "Seguimiento";
|
||
bfActividades.HeaderText = "Acciones";
|
||
bfActividades.ImageUrl = "~/Images/MiniBotones/realizaractividad.png";
|
||
bfActividades.CommandName = "seguimiento";
|
||
grvListaDatosTemp.Columns.Add(bfActividades);
|
||
//grvListaDatosTemp.RowDataBound += new GridViewRowEventHandler(grvListaDatos_RowDataBound);
|
||
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// Metodo que se encarga de agregar el filtro de busqueda seleccionado por el usuario
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private void condicionesBusqueda() //M2
|
||
{
|
||
AyABL.AyABL objBL = new AyABL.AyABL();
|
||
CondicionDAL condicion;
|
||
DateTime dteFechaInicio = new DateTime();
|
||
DateTime dteFechaFin = new DateTime();
|
||
ListItem li = new ListItem();
|
||
string p_parametros;
|
||
p_parametros = this.cuwBusquedaList.getValorBusqueda();
|
||
try
|
||
{
|
||
if (p_parametros != "")
|
||
{
|
||
//aqui se construye el listItem con los datos que vienen del control en formato {valor : texto , valor : texto}
|
||
char[] separadorTuplas = { ',' };
|
||
char[] separadorValores = { ':' };
|
||
string[] arrayTupla = p_parametros.Split(separadorTuplas);
|
||
|
||
for (int i = 0; i <= (arrayTupla.Length - 1); i++)
|
||
{
|
||
if (arrayTupla[i].ToString() != "")
|
||
{
|
||
string[] arrayValores = arrayTupla[i].ToString().Split(separadorValores);
|
||
li = new ListItem(arrayValores[1], arrayValores[0]);
|
||
|
||
if (li.Value.Contains("FECHA") && li.Text != string.Empty)
|
||
{
|
||
|
||
if (li.Value.Contains("INICIO"))
|
||
{
|
||
dteFechaInicio = Convert.ToDateTime(li.Text.ToString());
|
||
dteFechaFin = DateTime.Now;
|
||
}
|
||
if (li.Value.Contains("FIN"))
|
||
{
|
||
dteFechaFin = Convert.ToDateTime(li.Text.ToString());
|
||
|
||
if (dteFechaFin != null || dteFechaInicio != null)
|
||
if (dteFechaInicio < dteFechaFin || dteFechaFin == dteFechaInicio)
|
||
{
|
||
objBL = new AyABL.AyABL();
|
||
arlCondicionesFiltroBusqueda = objBL.buscarPorFechas(Tablas.insertasolicitud, dteFechaInicio, dteFechaFin, operadorLogico.AND, arlCondicionesFiltroBusqueda);
|
||
}
|
||
else
|
||
MensajeInformativo(AyABL.BASESDEDATOS.ADS + "Interfaz: " + "Verifique que la Fecha de Inicio sea menor que la Fecha Final" + "M2");
|
||
else
|
||
MensajeInformativo(AyABL.BASESDEDATOS.ADS + "Interfaz: " + "Verifique que los campos de las fechas no estén vacíos" + "M2");
|
||
}
|
||
else
|
||
{
|
||
objBL = new AyABL.AyABL();
|
||
arlCondicionesFiltroBusqueda = objBL.buscarPorFechas(Tablas.insertasolicitud, dteFechaInicio, dteFechaFin, operadorLogico.AND, arlCondicionesFiltroBusqueda);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if (li.Value.Contains("booleano") && li.Text != "2")
|
||
{
|
||
condicion = new CondicionDAL();
|
||
char[] separadorColumna = { '|' };
|
||
string[] strColumna = li.Value.Split(separadorColumna);
|
||
condicion.valorIzquierdo = strColumna[1].ToString();
|
||
condicion.operadorGeneral = operadorGeneral.EQUAL;
|
||
condicion.operadorLogico = operadorLogico.AND;
|
||
condicion.valorDerecho = li.Text.Trim();
|
||
arlCondicionesFiltroBusqueda.Add(condicion);
|
||
}
|
||
else
|
||
{
|
||
if (li.Text != string.Empty && !li.Value.Contains("booleano"))
|
||
{
|
||
condicion = new CondicionDAL();
|
||
condicion.valorIzquierdo = li.Value;
|
||
condicion.operadorGeneral = operadorGeneral.LIKEALL;
|
||
condicion.operadorLogico = operadorLogico.AND;
|
||
condicion.valorDerecho = "%" + li.Text.Trim() + "%";
|
||
arlCondicionesFiltroBusqueda.Add(condicion);
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// Metodo que se utiliza con el buscador de la parte superior de la pantalla, y hace que se despliegue la información de acuerdo
|
||
/// a lo solicitado
|
||
/// </summary>|
|
||
private void Buscar() //M3
|
||
{
|
||
try
|
||
{
|
||
llenarGridViewPendientes(true,1000);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
private void AbrirVentanaEmergente()
|
||
{
|
||
int nContador = 0;
|
||
foreach (GridViewRow row in grvListaDatos.Rows)
|
||
{
|
||
HtmlInputCheckBox chkTemp = (HtmlInputCheckBox)row.Controls[0].Controls[1];
|
||
if (chkTemp != null)
|
||
{
|
||
// si el registro esta marcado
|
||
if (chkTemp.Checked)
|
||
{
|
||
nContador += 1;
|
||
if (nContador == 1)
|
||
{
|
||
Session["PKPROGRAMACION"] = row.Cells[2].Text;
|
||
Session["PKSOLICITUD"] = row.Cells[11].Text;
|
||
Session["SOLICITUD"] = row.Cells[3].Text;
|
||
|
||
}
|
||
//else
|
||
// break;
|
||
|
||
|
||
}
|
||
}
|
||
|
||
}
|
||
if (nContador == 0)
|
||
MensajeAlerta("Debe seleccionar una solicitud");
|
||
if (nContador > 1)
|
||
MensajeAlerta("Solo se puede mostrar el detalle de una solicitud a la vez");
|
||
if (nContador == 1)
|
||
EjecutarScript("VentanaEmergenteAbrir('frwRequisitosSolicitud.aspx');");
|
||
//
|
||
|
||
}
|
||
private void AbrirVentanaEmergenteObservaciones()
|
||
{
|
||
//if (Session["NACTIVIDAD"] == null || Session["NACTIVIDAD"] == "")
|
||
//{
|
||
// //MensajeAlerta("Debe seleccionar una actividad.");
|
||
// string p_strMensaje = "Debe seleccionar una actividad.";
|
||
// EjecutarScript("VentanaAbrirActividades();toastr.warning('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
//}
|
||
//else
|
||
{
|
||
if (Session["NACTIVIDAD"] == null)
|
||
Session["NACTIVIDAD"] = string.Empty;
|
||
EjecutarScript("VentanaCerrarFormularioAS();VentanaCerrarFormularioAP();VentanaAbrirActividades();VentanaEmergenteAbrirObservaciones('frwObservacionesActividadesSolicitud.aspx');");
|
||
ViewState["POPUP"] = "VentanaEmergente";
|
||
}
|
||
|
||
CargarImagenesSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
EjecutarScript("VentanaAbrirActividades();");
|
||
}
|
||
|
||
private void AbrirVentanaEmergenteObservacionesAP()
|
||
{
|
||
|
||
{
|
||
EjecutarScript("VentanaCerrarFormularioAS();VentanaCerrarFormularioAP();VentanaAbrirActividades();VentanaEmergenteAbrirObservaciones('frwObservacionesActividadesSolicitud.aspx');");
|
||
ViewState["POPUP"] = "VentanaEmergenteAP";
|
||
}
|
||
|
||
CargarImagenesSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
EjecutarScript("VentanaAbrirActividades();");
|
||
}
|
||
private void AbrirVentanaEmergenteObservacionesAS()
|
||
{
|
||
|
||
{
|
||
EjecutarScript("VentanaCerrarFormularioAS();VentanaCerrarFormularioAP();VentanaAbrirActividades();VentanaEmergenteAbrirObservaciones('frwObservacionesActividadesSolicitud.aspx');");
|
||
ViewState["POPUP"] = "VentanaEmergenteAS";
|
||
}
|
||
|
||
CargarImagenesSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
EjecutarScript("VentanaAbrirActividades();");
|
||
}
|
||
private void AbrirVentanaEmergenteDevolucion()
|
||
{
|
||
if (Session["NACTIVIDAD"] == null || Session["NACTIVIDAD"] == "")
|
||
{
|
||
//MensajeAlerta("Debe seleccionar una actividad.");
|
||
string p_strMensaje = "Debe seleccionar una actividad.";
|
||
EjecutarScript("VentanaAbrirActividades();toastr.warning('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
|
||
else
|
||
{
|
||
EjecutarScript("VentanaAbrirActividades();VentanaEmergenteAbrirDevolucion('frwDevolucionActividadesSolicitud.aspx');");
|
||
// EjecutarScript("VentanaAbrirActividades();VentanaEmergenteAbrirDevolucion('frwDevolucionActividadesSolicitud.aspx');");
|
||
ViewState["POPUP"] = "VentanaEmergente";
|
||
|
||
|
||
}
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// Metodo que se utiliza para el despliegue de los botones
|
||
/// </summary>
|
||
private void ComandosxMenu() //M4
|
||
{
|
||
try
|
||
{
|
||
DataSet dsComandos = getComandos();
|
||
|
||
if (dsComandos != null)
|
||
{
|
||
foreach (DataRow drTemp in dsComandos.Tables[0].Rows)
|
||
{
|
||
switch (drTemp["NOMBRECOMANDO"].ToString().ToUpper())
|
||
{
|
||
case "NUEVO":
|
||
|
||
break;
|
||
|
||
case "MODIFICA":
|
||
//Inicio de variable tipo VIEWSTATE
|
||
ViewState["PUEDEMODIFICAR"] = true;
|
||
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Limpia los campos
|
||
/// </summary>
|
||
private void limpiarCampos()
|
||
{
|
||
lblTituloActividad.Text = "Seleccione una actividad";
|
||
lblEstadoA1.Text = "Sin asignar";
|
||
lblFechaIngresoA1.Text = "Sin asignar";
|
||
lblFechaResolucionA1.Text = "Sin asignar";
|
||
lblResponsableA1.Items.Clear();
|
||
lblResponsableA1.Items.Add("Sin asignar");
|
||
imgFormularioAS.Visible = false;
|
||
imgFormularioAP.Visible = false;
|
||
imgConstancias.Visible = false;
|
||
imgAsignacionExpediente.Visible = false;
|
||
imgAsignarActividad.Visible = false;
|
||
|
||
|
||
}
|
||
#endregion
|
||
|
||
#region Metodos Controles a Datos (R5)
|
||
|
||
private int AsignaActividadesUsuarios() //M0
|
||
{
|
||
ActividadesBL objActividadesBL = new ActividadesBL();
|
||
int nValorRetornado = 0;
|
||
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.”";
|
||
try
|
||
{
|
||
string strModo = ViewState["MODO"].ToString();
|
||
|
||
if (ddlActividades.SelectedValue != "-1")
|
||
{
|
||
if (ddlEncargado.SelectedValue != "-1")
|
||
{
|
||
|
||
objresponsableActividadBL = new solicitudBL();
|
||
objresponsableActividadBL.objresponsableActividadEL.FECHAASIGNACION = DateTime.Now;
|
||
objresponsableActividadBL.objresponsableActividadEL.FECHARECIBIDO = DateTime.Now.AddDays(-1);
|
||
objresponsableActividadBL.objresponsableActividadEL.FECHADEVOLUCION = DateTime.Now.AddDays(-1);
|
||
objresponsableActividadBL.objresponsableActividadEL.VALIDACIONFIRMA = false;
|
||
objresponsableActividadBL.objresponsableActividadEL.FKPROGRAMACIONSOLICITUD = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objresponsableActividadBL.objresponsableActividadEL.FKACTIVIDAD = int.Parse(ddlActividades.SelectedValue);
|
||
objresponsableActividadBL.objresponsableActividadEL.FKUSUARIOXDEPENDENCIA = int.Parse(ddlEncargado.SelectedValue);
|
||
objresponsableActividadBL.objresponsableActividadEL.FKESTADO = 1;//asignada
|
||
|
||
objresponsableActividadBL.objresponsableActividadEL.ASTATE = true;
|
||
|
||
if (strModo == "Nuevo")
|
||
{
|
||
|
||
|
||
objActividadesBL.objactividadesEL.Activo = true;
|
||
objActividadesBL.objactividadesEL.PK = int.Parse(ddlActividades.SelectedValue);
|
||
objActividadesBL.objactividadesEL.FK = int.Parse(ddlEncargado.SelectedValue);
|
||
|
||
|
||
DataSet dsActividad = objActividadesBL.dsListaActividad(arlCondicionesFiltroBusqueda);
|
||
|
||
arlCondicionesFiltroBusqueda = new ArrayList();
|
||
condicionesBusqueda();
|
||
objSolicitudBL = new solicitudBL();
|
||
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.FKACTIVIDAD = int.Parse(ddlActividades.SelectedValue);
|
||
objSolicitudBL.objSolicitudEL.FKUSUARIOXDEPENDENCIA = int.Parse(ddlEncargado.SelectedValue);
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(arlCondicionesFiltroBusqueda);
|
||
|
||
//bool bAsignarActividad = false;
|
||
|
||
//if (int.Parse(Session["FKTIPOINSPECCION"].ToString()) == 3)//ambos
|
||
// bAsignarActividad = true;
|
||
//else
|
||
//{
|
||
// if (int.Parse(Session["FKTIPOINSPECCION"].ToString()) == 2 && objSolicitudBL.objSolicitudEL.FKACTIVIDAD != 3)//alcantarillado sanitario
|
||
// bAsignarActividad = true;
|
||
// else
|
||
// {
|
||
// if (int.Parse(Session["FKTIPOINSPECCION"].ToString()) == 1 && objSolicitudBL.objSolicitudEL.FKACTIVIDAD != 4)//agua potable
|
||
// bAsignarActividad = true;
|
||
// }
|
||
//}
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count == 0)
|
||
{
|
||
nValorRetornado = objresponsableActividadBL.insertarAsignacionActividadEncargado();
|
||
|
||
|
||
if (nValorRetornado > 0)
|
||
{
|
||
#region actualizar actividad
|
||
GuardarDatosActividad(verificarTarea2());
|
||
#endregion
|
||
|
||
#region Envio de notificacion
|
||
notificacionBL objNotificacionBL = new notificacionBL();
|
||
|
||
objNotificacionBL.objnotificacionEL.FK_DEPARTAMENTO = Session["DEPENDENCIA"].ToString();
|
||
objNotificacionBL.objnotificacionEL.FK_TIPO_DOCUMENTO = "Memorando";
|
||
|
||
objNotificacionBL.objnotificacionEL.HECHO_POR_USUARIO = Session["LOGIN"].ToString();
|
||
objNotificacionBL.objnotificacionEL.HECHO_POR_NOMBRE = Session["NOMBREEMPLEADO"].ToString();
|
||
objNotificacionBL.objnotificacionEL.HECHO_POR_CORREO = Session["LOGIN"].ToString() + "@aya.go.cr";
|
||
|
||
//obtener los datos del encargado
|
||
arlCondicionesFiltroBusqueda = new ArrayList();
|
||
|
||
|
||
objActividadesBL.objactividadesEL.Activo = true;
|
||
objActividadesBL.objactividadesEL.PK = int.Parse(ddlActividades.SelectedValue);
|
||
objActividadesBL.objactividadesEL.FK = int.Parse(ddlEncargado.SelectedValue);
|
||
|
||
dsActividad = objActividadesBL.dsListaActividad(arlCondicionesFiltroBusqueda);
|
||
|
||
if (dsActividad.Tables[0].Rows.Count != 0)
|
||
{
|
||
objNotificacionBL.objnotificacionEL.PARA_USUARIO = dsActividad.Tables[0].Rows[0]["LOGINUSUARIO"].ToString();
|
||
objNotificacionBL.objnotificacionEL.PARA_NOMBRE = dsActividad.Tables[0].Rows[0]["NOMBRECOMPLETO"].ToString();
|
||
objNotificacionBL.objnotificacionEL.PARA_CORREO = dsActividad.Tables[0].Rows[0]["LOGINUSUARIO"].ToString() + "@aya.go.cr";
|
||
|
||
}
|
||
else
|
||
return 0;
|
||
|
||
objNotificacionBL.objnotificacionEL.ID_DOCUMENTO = Session["SOLICITUD"].ToString() + " - " + ddlActividades.SelectedItem.Text + " - " + objNotificacionBL.objnotificacionEL.PARA_USUARIO;
|
||
|
||
objNotificacionBL.objnotificacionEL.ASUNTO = "Atraso en la actividad " + ddlActividades.SelectedItem.Text;
|
||
objNotificacionBL.objnotificacionEL.CUERPO = "La solicitud " + Session["SOLICITUD"].ToString() + " no ha sido atendida en el plazo establecido.</BR></BR>Este es un mensaje generado de forma automática por la cual NO DEBE SER RESPONDIDO. </BR></BR> Ingrese al sistema <a href=http://" + HttpContext.Current.Request.Url.Authority + "/Forms/wfrLogin.> SIGDD</a>" + strPiePagina;
|
||
objNotificacionBL.objnotificacionEL.ESTADO = 1;//Estado : En proceso
|
||
|
||
//calcular la fecha en base a la actividad, tipo de proyecto,
|
||
|
||
objActividadesBL.objactividadesEL.NUMEROSOLICITUD = Session["SOLICITUD"].ToString();
|
||
DataSet dsActividadTiempo = objActividadesBL.dsListaTiempoActividadxProyecto(arlCondicionesFiltroBusqueda);
|
||
if (dsActividadTiempo.Tables[0].Rows.Count != 0)
|
||
{
|
||
Double nCantidadDias = Double.Parse(dsActividadTiempo.Tables[0].Rows[0]["TIEMPO"].ToString());
|
||
DateTime dtFechaVence = DateTime.Now.AddDays(nCantidadDias + 1);
|
||
objNotificacionBL.objnotificacionEL.FECHA_VENCE = dtFechaVence.ToShortDateString();
|
||
}
|
||
|
||
objNotificacionBL.objnotificacionEL.TIPO_PERIOCIDAD = "DD";
|
||
objNotificacionBL.objnotificacionEL.VALOR_PERIOCIDAD = 1;
|
||
objNotificacionBL.objnotificacionEL.status = "00";
|
||
objNotificacionBL.objnotificacionEL.message = "OK";
|
||
nValorRetornado = objNotificacionBL.insertarNotificacion(objNotificacionBL.objnotificacionEL);
|
||
#endregion
|
||
|
||
#region Envio de correo
|
||
|
||
//arlCondicionesFiltroBusqueda = new ArrayList();
|
||
//condicionesBusqueda();
|
||
//objSolicitudBL = new solicitudBL();
|
||
|
||
//objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
|
||
//{
|
||
|
||
// dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(arlCondicionesFiltroBusqueda);
|
||
// if (dsEncargadosActividades.Tables.Count > 0)
|
||
// {
|
||
// nPkSolicitud = Convert.ToInt32(dsEncargadosActividades.Tables[0].Rows[0][1].ToString());//AQUI INSERTAMOS LA PK DE LA SOLICITUD
|
||
|
||
// }
|
||
//}
|
||
|
||
//AyABL.TRA.correoBL objcorreoBL = new AyABL.TRA.correoBL();
|
||
//objcorreoBL.objcorreoEL.FKNUMSOLICITUD = nPkSolicitud;
|
||
//// objcorreoBL.objcorreoEL.CORREO = dsActividad.Tables[0].Rows[0]["LOGINUSUARIO"].ToString() + "@aya.go.cr";
|
||
//objcorreoBL.objcorreoEL.ASUNTO = "Asignación de actividades - SIGDD";
|
||
//objcorreoBL.objcorreoEL.CONTENIDO = "La solicitud de disponibilidad " + Session["SOLICITUD"].ToString() + " fue enviada para que se continúe con el proceso de " + ddlActividades.SelectedItem.Text + ", ingrese al sistema <a href=http://" + HttpContext.Current.Request.Url.Authority + "/Forms/wfrLogin> SIGDD</a>" + strPiePagina;
|
||
//objcorreoBL.objcorreoEL.FKUSUARIO = Convert.ToInt32(dsActividad.Tables[0].Rows[0]["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
//objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||
|
||
//nValorRetornado = objcorreoBL.insertarCorreo();
|
||
|
||
#endregion
|
||
|
||
|
||
}
|
||
|
||
|
||
GuardarEventoBitacora(
|
||
Session["LOGIN"].ToString(),
|
||
AccionBitacora.INSERT.ToString(),
|
||
MensajesBitacora.IngresarRegistro + ": Se ha ingresado la actividad " + ddlActividades.Text.Trim() + " de la solicitud " + Session["SOLICITUD"].ToString(),
|
||
"frwGestionarTrabajo.aspx",
|
||
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||
);
|
||
|
||
}
|
||
else
|
||
{
|
||
//MensajeAlerta("El usuario ya tiene asignada la actividad.");
|
||
string p_strMensaje = "El usuario ya tiene asignada la actividad.";
|
||
EjecutarScript("VentanaAbrir();toastr.success('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//MensajeAlerta("Debe seleccionar el usuario encargado antes de continuar ");
|
||
string p_strMensaje = "Debe seleccionar el usuario encargado antes de continuar.";
|
||
EjecutarScript("VentanaAbrir();toastr.success('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
ddlEncargado.Focus();
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//MensajeAlerta("Debe seleccionar la actividad antes de continuar");
|
||
string p_strMensaje = "Debe seleccionar la actividad antes de continuar.";
|
||
EjecutarScript("VentanaAbrir();toastr.success('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
ddlActividades.Focus();
|
||
}
|
||
}
|
||
|
||
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
return nValorRetornado;
|
||
}
|
||
|
||
/// <summary>
|
||
/// guarda y modifica registros en la tabla.
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
///
|
||
private int GuardarDatosActividad(string p_accion)
|
||
{
|
||
int nValorRetornado = 0;
|
||
|
||
try
|
||
{
|
||
|
||
//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 = 2;
|
||
|
||
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 finaliza la actividad programación de trabajo del formulario" + Session["SOLICITUD"].ToString() + " por parte del usuario" + 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
|
||
|
||
foreach (DataRow row in dsEncargadosActividades.Tables[0].Rows)
|
||
{
|
||
|
||
objSolicitud.objresponsableActividadEL.PK = int.Parse(row["PKRESPONSABLEACTIVIDAD"].ToString());
|
||
objSolicitud.objresponsableActividadEL.FECHADEVOLUCION = DateTime.Now;
|
||
if (p_accion == "aprobar")
|
||
{
|
||
|
||
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 programación de trabajo 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";
|
||
|
||
|
||
|
||
nResultadoActualizar = objSolicitud.actualizarActividadSolicitud();
|
||
if (nResultadoActualizar > 0)
|
||
{
|
||
#region Envio de correo
|
||
|
||
AyABL.TRA.correoBL objcorreoBL = new AyABL.TRA.correoBL();
|
||
|
||
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 = "Estado de actividad - SIGDD";
|
||
objcorreoBL.objcorreoEL.CONTENIDO = strMensajeContenido;
|
||
objcorreoBL.objcorreoEL.FKUSUARIO = Convert.ToInt32(row["FKUSUARIOXDEPENDENCIA"].ToString());
|
||
objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||
|
||
nValorRetornado = objcorreoBL.insertarCorreo();
|
||
|
||
|
||
#endregion
|
||
|
||
////poner la siguiente actividad en pendiente
|
||
|
||
//objSolicitudBL = new solicitudBL();
|
||
//objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
//objSolicitudBL.objSolicitudEL.ORDEN = 3;
|
||
|
||
//DataSet dsEncargadosActividadesSiguiente = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
//foreach (DataRow row6 in dsEncargadosActividadesSiguiente.Tables[0].Rows)
|
||
//{
|
||
|
||
// objSolicitud.objresponsableActividadEL.PK = int.Parse(row6["PKRESPONSABLEACTIVIDAD"].ToString()); ;
|
||
// objSolicitud.objresponsableActividadEL.FKESTADO = 3;//pendiente t_sgm_estadoactividad
|
||
// objSolicitud.objresponsableActividadEL.FECHARECIBIDO = DateTime.Now;
|
||
// nResultadoActualizar = objSolicitud.actualizarActividadSolicitudSiguiente();
|
||
|
||
// objcorreoBL.objcorreoEL.ASUNTO = strAsuntoCorreo;
|
||
// objcorreoBL.objcorreoEL.CONTENIDO = strMensajeContenido;
|
||
// objcorreoBL.objcorreoEL.FKUSUARIO = Convert.ToInt32(row6["FKUSUARIOXDEPENDENCIA"].ToString());
|
||
// objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||
|
||
// nValorRetornado = objcorreoBL.insertarCorreo();
|
||
//}
|
||
|
||
////poner la siguiente actividad en pendiente
|
||
|
||
//objSolicitudBL = new solicitudBL();
|
||
//objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
//objSolicitudBL.objSolicitudEL.ORDEN = 4;
|
||
|
||
//dsEncargadosActividadesSiguiente = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
//foreach (DataRow row6 in dsEncargadosActividadesSiguiente.Tables[0].Rows)
|
||
//{
|
||
|
||
// objSolicitud.objresponsableActividadEL.PK = int.Parse(row6["PKRESPONSABLEACTIVIDAD"].ToString()); ;
|
||
// objSolicitud.objresponsableActividadEL.FKESTADO = 3;//pendiente t_sgm_estadoactividad
|
||
// objSolicitud.objresponsableActividadEL.FECHARECIBIDO = DateTime.Now;
|
||
// nResultadoActualizar = objSolicitud.actualizarActividadSolicitudSiguiente();
|
||
|
||
// objcorreoBL.objcorreoEL.ASUNTO = strAsuntoCorreo;
|
||
// objcorreoBL.objcorreoEL.CONTENIDO = strMensajeContenido;
|
||
// objcorreoBL.objcorreoEL.FKUSUARIO = Convert.ToInt32(row6["FKUSUARIOXDEPENDENCIA"].ToString());
|
||
// objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||
|
||
// nValorRetornado = objcorreoBL.insertarCorreo();
|
||
//}
|
||
|
||
//cancelar notificacion
|
||
notificacionBL objNotificacionBL = new notificacionBL();
|
||
|
||
objNotificacionBL.objnotificacionEL.ID_DOCUMENTO = Session["SOLICITUD"].ToString() + " - Programación de trabajo";
|
||
objNotificacionBL.objnotificacionEL.status = "00";
|
||
objNotificacionBL.objnotificacionEL.message = "OK";
|
||
nValorRetornado = objNotificacionBL.cancelarNotificacion(objNotificacionBL.objnotificacionEL);
|
||
GuardarEventoBitacora(
|
||
Session["LOGIN"].ToString(),
|
||
AccionBitacora.INSERT.ToString(),
|
||
MensajesBitacora.IngresarRegistro + ": La actividad programación de trabajo de la solicitud N° " + Session["SOLICITUD"].ToString() + " ha sido finalizada por parte del encargado de la actividad: " + Session["NOMBREEMPLEADO"].ToString().Trim(),
|
||
Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath),
|
||
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||
);
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
if (p_accion == "pendiente")
|
||
{
|
||
//Poner la actividad 2 programacion en pendiente(3)
|
||
objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 2;
|
||
|
||
dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
foreach (DataRow row in dsEncargadosActividades.Tables[0].Rows)
|
||
{
|
||
|
||
objSolicitud.objresponsableActividadEL.PK = int.Parse(row["PKRESPONSABLEACTIVIDAD"].ToString()); ;
|
||
objSolicitud.objresponsableActividadEL.FKESTADO = 3;//pendiente t_sgm_estadoactividad
|
||
nResultadoActualizar = objSolicitud.actualizarActividadSolicitud();
|
||
}
|
||
}
|
||
|
||
|
||
}
|
||
}
|
||
|
||
//GuardarEventoBitacora(
|
||
// Session["LOGIN"].ToString(),
|
||
// AccionBitacora.INSERT.ToString(),
|
||
// MensajesBitacora.IngresarRegistro + ": Se ingreso una nueva observacion por el estado de la actividad: La actividad 2 ha sido asignada por: " + Session["NOMBREEMPLEADO"].ToString().Trim(),
|
||
// "frwObservacionesActividades.aspx",
|
||
// Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||
// );
|
||
|
||
|
||
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
|
||
return nValorRetornado;
|
||
}
|
||
|
||
private int GuardarDatosActividadAPAS(string p_accion)
|
||
{
|
||
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 + " el formulario por parte del encargado de la revisión: " + 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 == "aprueba")
|
||
{
|
||
|
||
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() + " - Confección del Criterio técnico de agua potable";
|
||
objNotificacionBL.objnotificacionEL.status = "00";
|
||
objNotificacionBL.objnotificacionEL.message = "OK";
|
||
nValorRetornado = objNotificacionBL.cancelarNotificacion(objNotificacionBL.objnotificacionEL);
|
||
|
||
}
|
||
else
|
||
{
|
||
objSolicitud.objresponsableActividadEL.FKESTADO = 4;//reinspeccion t_sgm_estadoactividad
|
||
strMensajeContenido = "La actividad " + Session["DESCRIPCIONACTIVIDAD"].ToString() + " de la solicitud N° " + Session["SOLICITUD"].ToString() + " no ha sido aprobada para ver los detalles, ingrese al sistema <a href=http://" + HttpContext.Current.Request.Url.Authority + "/Forms/wfrLogin.> SIGDD</a>" + strPiePagina;
|
||
strAsuntoCorreo = "Reinspección de actividad - SIGDD";
|
||
}
|
||
nResultadoActualizar = objSolicitud.actualizarActividadSolicitud();
|
||
if (nResultadoActualizar > 0)
|
||
{
|
||
if (objSolicitud.objresponsableActividadEL.FKESTADO == 8 || objSolicitud.objresponsableActividadEL.FKESTADO == 5)
|
||
{
|
||
objcorreoBL = new AyABL.TRA.correoBL();
|
||
//poner la siguiente actividad en pendiente
|
||
|
||
objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 5;
|
||
|
||
DataSet dsEncargadosActividadesSiguiente = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
foreach (DataRow row6 in dsEncargadosActividadesSiguiente.Tables[0].Rows)
|
||
{
|
||
|
||
objSolicitud.objresponsableActividadEL.PK = int.Parse(row6["PKRESPONSABLEACTIVIDAD"].ToString()); ;
|
||
objSolicitud.objresponsableActividadEL.FKESTADO = 3;//pendiente t_sgm_estadoactividad
|
||
objSolicitud.objresponsableActividadEL.FECHARECIBIDO = DateTime.Now;
|
||
nResultadoActualizar = objSolicitud.actualizarActividadSolicitudSiguiente();
|
||
|
||
objcorreoBL.objcorreoEL.ASUNTO = strAsuntoCorreo;
|
||
objcorreoBL.objcorreoEL.CONTENIDO = strMensajeContenido;
|
||
objcorreoBL.objcorreoEL.FKUSUARIO = Convert.ToInt32(row6["FKUSUARIOXDEPENDENCIA"].ToString());
|
||
objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||
|
||
//nValorRetornado = objcorreoBL.insertarCorreo();
|
||
}
|
||
GuardarEventoBitacora(
|
||
Session["LOGIN"].ToString(),
|
||
AccionBitacora.INSERT.ToString(),
|
||
MensajesBitacora.IngresarRegistro + ": La actividad " + Session["DESCRIPCIONACTIVIDAD"].ToString() + " de la solicitud N° " + Session["SOLICITUD"].ToString() + " ha sido finalizada por parte del encargado de la actividad: " + Session["NOMBREEMPLEADO"].ToString().Trim(),
|
||
Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath),
|
||
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||
);
|
||
}
|
||
if (objSolicitud.objresponsableActividadEL.FKESTADO == 4)//no aprobo en la revision
|
||
{
|
||
GuardarEventoBitacora(
|
||
Session["LOGIN"].ToString(),
|
||
AccionBitacora.INSERT.ToString(),
|
||
MensajesBitacora.IngresarRegistro + ": La actividad " + Session["DESCRIPCIONACTIVIDAD"].ToString() + " de la solicitud N° " + Session["SOLICITUD"].ToString() + " no ha sido aprobada en la revisión por parte del encargado de la actividad: " + Session["NOMBREEMPLEADO"].ToString().Trim(),
|
||
Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath),
|
||
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||
);
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
if (p_accion == "deniega")
|
||
{
|
||
//Poner la actividad 2 programacion en pendiente(3)
|
||
objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 2;
|
||
|
||
dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
foreach (DataRow row in dsEncargadosActividades.Tables[0].Rows)
|
||
{
|
||
|
||
objSolicitud.objresponsableActividadEL.PK = int.Parse(row["PKRESPONSABLEACTIVIDAD"].ToString()); ;
|
||
objSolicitud.objresponsableActividadEL.FKESTADO = 3;//pendiente t_sgm_estadoactividad
|
||
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);
|
||
//objcorreoBL = new AyABL.TRA.correoBL();
|
||
//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();
|
||
// }
|
||
//}
|
||
////se envia correo a los encargados de la actividad 2 para reprogramar la tarea
|
||
//objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
//objSolicitudBL.objSolicitudEL.ORDEN = 2;
|
||
//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 = "Conclusión de actividad - SIGDD";
|
||
// objcorreoBL.objcorreoEL.CONTENIDO = strMensajeContenido;
|
||
// objcorreoBL.objcorreoEL.FKUSUARIO = Convert.ToInt32(row["FKUSUARIOXDEPENDENCIA"].ToString());
|
||
// objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||
|
||
// nValorRetornado = objcorreoBL.insertarCorreo();
|
||
// }
|
||
//}
|
||
|
||
////se envia correo a los encargados de la actividad 5 para iniciar la tarea de constancia de actividad
|
||
//objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
//objSolicitudBL.objSolicitudEL.ORDEN = 5;
|
||
//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 = "Conclusión de actividad - SIGDD";
|
||
// objcorreoBL.objcorreoEL.CONTENIDO = strMensajeContenido;
|
||
// objcorreoBL.objcorreoEL.FKUSUARIO = Convert.ToInt32(row["FKUSUARIOXDEPENDENCIA"].ToString());
|
||
// objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||
|
||
// nValorRetornado = objcorreoBL.insertarCorreo();
|
||
// }
|
||
//}
|
||
|
||
#endregion
|
||
}
|
||
}
|
||
//if (p_accion == "aprueba")
|
||
//{
|
||
// GuardarEventoBitacora(
|
||
// Session["LOGIN"].ToString(),
|
||
// AccionBitacora.INSERT.ToString(),
|
||
// MensajesBitacora.IngresarRegistro + ": Se aprueba el formulario de " + Session["DESCRIPCIONACTIVIDAD"].ToString() + " por parte del encargado de la revisión: " + Session["NOMBREEMPLEADO"].ToString().Trim() + " de la solicitud " + Session["SOLICITUD"].ToString(),
|
||
// Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath),
|
||
// Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||
// );
|
||
//}
|
||
|
||
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
|
||
return nValorRetornado;
|
||
}
|
||
|
||
private string verificarTarea2()
|
||
{
|
||
string strValorRetornado = "pendiente";
|
||
|
||
bool bActividad1 = false;
|
||
bool bActividad2 = false;
|
||
bool bActividad3 = false;
|
||
bool bActividad4 = false;
|
||
bool bActividad5 = false;
|
||
bool bActividad6 = false;
|
||
bool bActividad7 = false;
|
||
try
|
||
{
|
||
solicitudBL objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
//objSolicitudBL.objSolicitudEL.ORDEN = 2;
|
||
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
foreach (DataRow row in dsEncargadosActividades.Tables[0].Rows)
|
||
{
|
||
int nActividad = int.Parse(row["ORDENACTIVIDAD"].ToString());
|
||
if (nActividad == 1)
|
||
bActividad1 = true;
|
||
|
||
if (nActividad == 2)
|
||
bActividad2 = true;
|
||
|
||
if (nActividad == 3 || int.Parse(row["FKTIPOINSPECCION"].ToString()) == 2)
|
||
bActividad3 = true;
|
||
|
||
if (nActividad == 4 || int.Parse(row["FKTIPOINSPECCION"].ToString()) == 1)
|
||
bActividad4 = true;
|
||
|
||
if (nActividad == 5)
|
||
bActividad5 = true;
|
||
|
||
if (nActividad == 6)
|
||
bActividad6 = true;
|
||
|
||
if (nActividad == 7)
|
||
bActividad7 = true;
|
||
|
||
}
|
||
if (bActividad1 == true &&
|
||
bActividad2 == true &&
|
||
bActividad3 == true &&
|
||
bActividad4 == true &&
|
||
bActividad5 == true &&
|
||
bActividad6 == true &&
|
||
bActividad7 == true)
|
||
strValorRetornado = "aprobar";
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
return strValorRetornado;
|
||
}
|
||
|
||
private int EliminarActividadesUsuarios(int n_pPkActividadUsuario) //M0
|
||
{
|
||
int nValorRetornado = 0;
|
||
|
||
try
|
||
{
|
||
ObservacionesActividadesBL objObservacionesBL = new ObservacionesActividadesBL();
|
||
objObservacionesBL.objobservacionesEL.PKSOLICITUD = int.Parse(Session["PKSOLICITUD"].ToString());
|
||
objObservacionesBL.objobservacionesEL.PKPROGRAMACIONSOLICITUD = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
//objObservacionesBL.objobservacionesEL.PKACTIVIDAD = int.Parse(Session["NACTIVIDAD"].ToString());
|
||
//objObservacionesBL.objobservacionesEL.ORDEN = int.Parse(Session["NACTIVIDAD"].ToString());
|
||
objObservacionesBL.objobservacionesEL.PKRESPONSABLEACTIVIDAD = n_pPkActividadUsuario;
|
||
|
||
DataSet dsObservaciones = objObservacionesBL.dsListarObservacionesActividades(null);
|
||
|
||
if (dsObservaciones.Tables[0].Rows.Count == 0)
|
||
{
|
||
objresponsableActividadBL = new solicitudBL();
|
||
objresponsableActividadBL.objresponsableActividadEL.PK = n_pPkActividadUsuario;
|
||
nValorRetornado = objresponsableActividadBL.eliminarAsignacionActividadEncargado();
|
||
|
||
GuardarEventoBitacora(
|
||
Session["LOGIN"].ToString(),
|
||
AccionBitacora.INSERT.ToString(),
|
||
MensajesBitacora.IngresarRegistro + ": Se ha elimindo la actividad " + n_pPkActividadUsuario.ToString(),
|
||
"frwGestionarTrabajo.aspx",
|
||
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||
);
|
||
}
|
||
else
|
||
{
|
||
//MensajeAlerta("El registro no puede ser eliminado ya que esta asociado a otro flujo de la solicitud");
|
||
string p_strMensaje = "El registro no puede ser eliminado ya que esta asociado a otro flujo de la solicitud.";
|
||
EjecutarScript("VentanaAbrir();toastr.success('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
}
|
||
|
||
|
||
catch (Exception ex)
|
||
{
|
||
string p_strMensaje = "Se produjo un error al intentar eliminar un registro.";
|
||
EjecutarScript("VentanaAbrir();toastr.error('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
throw ex;
|
||
}
|
||
return nValorRetornado;
|
||
}
|
||
|
||
/// <summary>
|
||
/// guarda y modifica registros en la tabla.
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
///
|
||
|
||
|
||
private int GuardarDatosActividad(string p_accion, string strDocumento, int p_nOrden)
|
||
{
|
||
int nValorRetornado = 0;
|
||
|
||
try
|
||
{
|
||
|
||
|
||
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.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = p_nOrden;//5:Confeccion de constancias 6:Validacion y firma
|
||
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||
{
|
||
if (int.Parse(dsEncargadosActividades.Tables[0].Rows[0]["PKUSUARIOXDEPENDENCIA"].ToString()) == int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString()) && int.Parse(dsEncargadosActividades.Tables[0].Rows[0]["FKESTADO"].ToString()) != 5
|
||
&& int.Parse(dsEncargadosActividades.Tables[0].Rows[0]["FKESTADO"].ToString()) != 8)
|
||
{
|
||
string strEncargadoActividad = dsEncargadosActividades.Tables[0].Rows[0]["PKRESPONSABLEACTIVIDAD"].ToString();
|
||
|
||
ObservacionesActividadesBL objObservacionesBL = new ObservacionesActividadesBL();
|
||
|
||
objObservacionesBL.objobservacionesEL.DESCRIPCION = "\n" + DateTime.Now.ToString()+ " - " + Session["NOMBREEMPLEADO"].ToString() + " - Se " + p_accion + " el documento " + strDocumento + " del formulario " + Session["SOLICITUD"].ToString() + " por parte del usuario " + 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;//1:observaciones 2:devolucion
|
||
|
||
nValorRetornado = objObservacionesBL.insertarObservacionActividad();
|
||
|
||
|
||
if (nValorRetornado != 0)
|
||
{
|
||
solicitudBL objSolicitud = new solicitudBL();
|
||
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());
|
||
|
||
|
||
objSolicitudBL.objSolicitudEL.ORDEN = p_nOrden;//5:Confeccion de constancias 6:Validacion y firma
|
||
|
||
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 programacion de trabajo 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";
|
||
|
||
|
||
|
||
nResultadoActualizar = objSolicitud.actualizarActividadSolicitud();
|
||
#region Envio de correo
|
||
|
||
AyABL.TRA.correoBL objcorreoBL = new AyABL.TRA.correoBL();
|
||
|
||
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();
|
||
|
||
//poner la siguiente actividad en pendiente
|
||
|
||
objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = p_nOrden + 1;
|
||
|
||
DataSet dsEncargadosActividadesSiguiente = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
foreach (DataRow row6 in dsEncargadosActividadesSiguiente.Tables[0].Rows)
|
||
{
|
||
|
||
objSolicitud.objresponsableActividadEL.PK = int.Parse(row6["PKRESPONSABLEACTIVIDAD"].ToString()); ;
|
||
objSolicitud.objresponsableActividadEL.FKESTADO = 3;//pendiente t_sgm_estadoactividad
|
||
nResultadoActualizar = objSolicitud.actualizarActividadSolicitud();
|
||
|
||
objcorreoBL.objcorreoEL.ASUNTO = strAsuntoCorreo;
|
||
objcorreoBL.objcorreoEL.CONTENIDO = strMensajeContenido;
|
||
objcorreoBL.objcorreoEL.FKUSUARIO = Convert.ToInt32(row6["FKUSUARIOXDEPENDENCIA"].ToString());
|
||
objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||
|
||
nValorRetornado = objcorreoBL.insertarCorreo();
|
||
}
|
||
//cancelar notificacion
|
||
notificacionBL objNotificacionBL = new notificacionBL();
|
||
|
||
objNotificacionBL.objnotificacionEL.ID_DOCUMENTO = Session["SOLICITUD"].ToString() + " - Validación y firma";
|
||
objNotificacionBL.objnotificacionEL.status = "00";
|
||
objNotificacionBL.objnotificacionEL.message = "OK";
|
||
nValorRetornado = objNotificacionBL.cancelarNotificacion(objNotificacionBL.objnotificacionEL);
|
||
#endregion
|
||
}
|
||
}
|
||
|
||
|
||
//if (p_accion == "edita")
|
||
//{
|
||
// //Poner la actividad 6 programacion en pendiente(3)
|
||
// objSolicitudBL = new solicitudBL();
|
||
// objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
// objSolicitudBL.objSolicitudEL.ORDEN = p_nOrden + 1;
|
||
|
||
// dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
// foreach (DataRow row in dsEncargadosActividades.Tables[0].Rows)
|
||
// {
|
||
|
||
// objSolicitud.objresponsableActividadEL.PK = int.Parse(row["PKRESPONSABLEACTIVIDAD"].ToString()); ;
|
||
// objSolicitud.objresponsableActividadEL.FKESTADO = 3;//pendiente t_sgm_estadoactividad
|
||
// nResultadoActualizar = objSolicitud.actualizarActividadSolicitud();
|
||
// }
|
||
//}
|
||
|
||
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
|
||
return nValorRetornado;
|
||
}
|
||
#endregion
|
||
|
||
#region Metodos Datos a Controles (R6)
|
||
/// <summary>
|
||
/// Carga el grid principal
|
||
/// </summary>
|
||
/// <param name="p_Llenar"></param>
|
||
private void llenarGridView(bool p_Llenar) //M0
|
||
{
|
||
try
|
||
{
|
||
if (!IsPostBack || p_Llenar)
|
||
{
|
||
arlCondicionesFiltroBusqueda = new ArrayList();
|
||
condicionesBusqueda();
|
||
objSolicitudBL = new solicitudBL();
|
||
|
||
|
||
|
||
int nAccesoInformacion = 0;
|
||
|
||
if (Session["ACCESOINSORMACION"] != null)
|
||
nAccesoInformacion = int.Parse(Session["ACCESOINSORMACION"].ToString());
|
||
|
||
if (nAccesoInformacion == 1 ) //1:region -- 0:Todo
|
||
objSolicitudBL.objSolicitudEL.FKREGION = int.Parse(Session["REGION"].ToString());
|
||
|
||
if (nAccesoInformacion == 2 )//2:Dependencia -- 0:Todo
|
||
{
|
||
//objSolicitudBL.objSolicitudEL.FKREGION = int.Parse(Session["REGION"].ToString());
|
||
//objSolicitudBL.objSolicitudEL.FKDEPENDENCIA = int.Parse(Session["DEPENDENCIA"].ToString());
|
||
objSolicitudBL.objSolicitudEL.LISTADODEPENDENCIAS = Session["LISTADEPENDENCIAS"].ToString();
|
||
}
|
||
|
||
objSolicitudBL.objSolicitudEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
|
||
|
||
if (arlCondicionesFiltroBusqueda.Count > 0)
|
||
{
|
||
DataSet ds = objSolicitudBL.dsListaSolicitudGestion(arlCondicionesFiltroBusqueda);
|
||
General.detalleGridView(ds, grvListaDatosTemp, lblTotalDatos);
|
||
}
|
||
else
|
||
{
|
||
MensajeAlerta("Debe agregar filtros para la busqueda");
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
|
||
|
||
/// <summary>
|
||
/// Carga el grid principal
|
||
/// </summary>
|
||
/// <param name="p_Llenar"></param>
|
||
private void llenarGridViewPendientes(bool p_Llenar, int nCantidadFilas) //M0
|
||
{
|
||
try
|
||
{
|
||
if (!IsPostBack || p_Llenar)
|
||
{
|
||
//arlCondicionesFiltroBusqueda = new ArrayList();
|
||
condicionesBusqueda();
|
||
objSolicitudBL = new solicitudBL();
|
||
|
||
int nAccesoInformacion = 0;
|
||
|
||
if (Session["ACCESOINSORMACION"] != null)
|
||
nAccesoInformacion = int.Parse(Session["ACCESOINSORMACION"].ToString());
|
||
|
||
if (nAccesoInformacion == 1) //1:region -- 0:Todo
|
||
objSolicitudBL.objSolicitudEL.FKREGION = int.Parse(Session["REGION"].ToString());
|
||
|
||
//if (nAccesoInformacion == 2)//2:Dependencia -- 0:Todo
|
||
//{
|
||
// objSolicitudBL.objSolicitudEL.FKREGION = int.Parse(Session["REGION"].ToString());
|
||
// objSolicitudBL.objSolicitudEL.FKDEPENDENCIA = int.Parse(Session["DEPENDENCIA"].ToString());
|
||
//}
|
||
if (nAccesoInformacion == 2)//2:Dependencia -- 0:Todo
|
||
{
|
||
//objSolicitudBL.objSolicitudEL.FKREGION = int.Parse(Session["REGION"].ToString());
|
||
//objSolicitudBL.objSolicitudEL.FKDEPENDENCIA = int.Parse(Session["DEPENDENCIA"].ToString());
|
||
objSolicitudBL.objSolicitudEL.LISTADODEPENDENCIAS = Session["LISTADEPENDENCIAS"].ToString();
|
||
}
|
||
//objSolicitudBL.objSolicitudEL.TEMPORAL = true;
|
||
objSolicitudBL.objSolicitudEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
{
|
||
DataSet ds = objSolicitudBL.dsListaSolicitudGestionGrid(arlCondicionesFiltroBusqueda,nCantidadFilas);
|
||
General.detalleGridView(ds, grvListaDatosTemp, lblTotalDatos);
|
||
|
||
|
||
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Carga el grid principal
|
||
/// </summary>
|
||
/// <param name="p_Llenar"></param>
|
||
private void llenarDDLActividades(bool p_Llenar) //M0
|
||
{
|
||
try
|
||
{
|
||
if (!IsPostBack || p_Llenar)
|
||
{
|
||
ddlActividades.Items.Clear();
|
||
arlCondicionesFiltroBusqueda = new ArrayList();
|
||
ActividadesBL objActividadesBL = new ActividadesBL();
|
||
if (Session["PKSOLICITUD"] != null)
|
||
objActividadesBL.objactividadesEL.PKSOLICITUD = int.Parse(Session["PKSOLICITUD"].ToString());
|
||
objActividadesBL.objactividadesEL.ASTATE = true;
|
||
objActividadesBL.objactividadesEL.FKTIPOINSPECCION = int.Parse(Session["FKTIPOINSPECCION"].ToString());
|
||
|
||
DataSet dsActividad = objActividadesBL.dsListarActividad(arlCondicionesFiltroBusqueda);
|
||
|
||
if (dsActividad.Tables[0].Rows.Count != 0)
|
||
{
|
||
ddlActividades.DataSource = dsActividad;
|
||
ddlActividades.DataTextField = dsActividad.Tables[0].Columns["DESCRIPCIONACTIVIDAD"].ColumnName;
|
||
ddlActividades.DataValueField = dsActividad.Tables[0].Columns["PKACTIVIDAD"].ColumnName;
|
||
ddlActividades.DataBind();
|
||
|
||
|
||
ddlActividades.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||
}
|
||
else
|
||
ddlActividades.Items.Insert(0, new ListItem("----- No existen opciones -----", "-1"));
|
||
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Carga el grid principal
|
||
/// </summary>
|
||
/// <param name="p_Llenar"></param>
|
||
private void llenarDDLEncargado(bool p_Llenar) //M0
|
||
{
|
||
try
|
||
{
|
||
ddlEncargado.Items.Clear();
|
||
arlCondicionesFiltroBusqueda = new ArrayList();
|
||
ActividadesBL objActividadesBL = new ActividadesBL();
|
||
|
||
objActividadesBL.objactividadesEL.Activo = true;
|
||
objActividadesBL.objactividadesEL.PK = int.Parse(ddlActividades.SelectedValue);
|
||
objActividadesBL.objactividadesEL.FKDEPENDENCIA = int.Parse(Session["FKDEPENDENCIASIGDD"].ToString());
|
||
|
||
DataSet dsActividad = objActividadesBL.dsListaActividad(arlCondicionesFiltroBusqueda);
|
||
|
||
if (dsActividad.Tables[0].Rows.Count != 0)
|
||
{
|
||
ddlEncargado.DataSource = dsActividad;
|
||
ddlEncargado.DataTextField = dsActividad.Tables[0].Columns["NOMBRECOMPLETO"].ColumnName;
|
||
ddlEncargado.DataValueField = dsActividad.Tables[0].Columns["PKUSUARIOXDEPENDENCIA"].ColumnName;
|
||
ddlEncargado.DataBind();
|
||
|
||
|
||
ddlEncargado.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||
}
|
||
else
|
||
ddlEncargado.Items.Insert(0, new ListItem("----- No existen opciones -----", "-1"));
|
||
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Carga el grid de tareas
|
||
/// </summary>
|
||
/// <param name="p_Llenar"></param>
|
||
private void llenarGridViewActividadesEncargado(int n_pProgramacionSolicitud) //M0
|
||
{
|
||
try
|
||
{
|
||
|
||
arlCondicionesFiltroBusqueda = new ArrayList();
|
||
condicionesBusqueda();
|
||
objSolicitudBL = new solicitudBL();
|
||
|
||
objSolicitudBL.objSolicitudEL.PK = n_pProgramacionSolicitud;
|
||
grvListaAsignaciones.Columns[4].Visible = true;
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(arlCondicionesFiltroBusqueda);
|
||
{
|
||
|
||
|
||
if (dsEncargadosActividades.Tables.Count > 0)
|
||
{
|
||
nPkSolicitud = Convert.ToInt32(dsEncargadosActividades.Tables[0].Rows[0][1].ToString());//AQUI INSERTAMOS LA PK DE LA SOLICITUD
|
||
grvListaAsignaciones.DataSource = dsEncargadosActividades;
|
||
grvListaAsignaciones.DataBind();
|
||
General.detalleGridView(dsEncargadosActividades, grvListaAsignaciones, lblTotalDatos);
|
||
grvListaAsignaciones.Columns[4].Visible = false;
|
||
}
|
||
}
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// Carga el grid de tareas
|
||
/// </summary>
|
||
/// <param name="p_Llenar"></param>
|
||
private void CargarSeguimientoActividades(int n_pProgramacionSolicitud,int n_pActividad, string strDescripcionActividad) //M0
|
||
{
|
||
try
|
||
{
|
||
|
||
arlCondicionesFiltroBusqueda = new ArrayList();
|
||
//condicionesBusqueda();
|
||
objSolicitudBL = new solicitudBL();
|
||
|
||
objSolicitudBL.objSolicitudEL.PK = n_pProgramacionSolicitud;
|
||
objSolicitudBL.objSolicitudEL.ORDEN = n_pActividad;
|
||
objSolicitudBL.objSolicitudEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
|
||
imgAsignacionExpediente.Visible = false;
|
||
imgAsignarActividad.Visible = false;
|
||
imgFormularioAP.Visible = false;
|
||
imgFormularioAS.Visible = false;
|
||
imgConstancias.Visible = false;
|
||
imgValidacionFirma.Visible = false;
|
||
//cuwVentanaEmergenteDevolucion.Visible = false;
|
||
imgNotificacionUsuario.Visible = false;
|
||
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(arlCondicionesFiltroBusqueda);
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||
{
|
||
|
||
if (n_pActividad == 1)
|
||
imgAsignacionExpediente.Visible = true;
|
||
if (n_pActividad == 2)
|
||
{
|
||
imgAsignarActividad.Visible = true;
|
||
cuwVentanaEmergenteDevolucion.Visible = true;
|
||
}
|
||
if (n_pActividad == 3)
|
||
{
|
||
imgFormularioAP.Visible = true;
|
||
cuwVentanaEmergenteDevolucion.Visible = true;
|
||
}
|
||
if (n_pActividad == 4)
|
||
{
|
||
imgFormularioAS.Visible = true;
|
||
cuwVentanaEmergenteDevolucion.Visible = true;
|
||
}
|
||
if (n_pActividad == 5)
|
||
{
|
||
imgConstancias.Visible = true;
|
||
cuwVentanaEmergenteDevolucion.Visible = true;
|
||
}
|
||
if (n_pActividad == 6)
|
||
{
|
||
imgValidacionFirma.Visible = true;
|
||
cuwVentanaEmergenteDevolucion.Visible = true;
|
||
}
|
||
if (n_pActividad == 7)
|
||
{
|
||
imgNotificacionUsuario.Visible = true;
|
||
}
|
||
|
||
|
||
lblTituloActividad.Text = "Actividad N°" + n_pActividad.ToString();
|
||
lblEstadoA1.Text = dsEncargadosActividades.Tables[0].Rows[0]["DESCRIPCIONESTADO"].ToString();
|
||
lblFechaIngresoA1.Text = dsEncargadosActividades.Tables[0].Rows[0]["FECHAASIGNACIONRESPONSABLEACTIVIDAD"].ToString();
|
||
lblFechaResolucionA1.Text = dsEncargadosActividades.Tables[0].Rows[0]["FECHADEVOLUCIONRESPONSABLEACTIVIDAD"].ToString();
|
||
|
||
Session["NACTIVIDAD"] = n_pActividad;
|
||
Session["DESCRIPCIONACTIVIDAD"] = strDescripcionActividad;
|
||
Session["PKRESPONSABLEACTIVIDAD"] = dsEncargadosActividades.Tables[0].Rows[0]["PKRESPONSABLEACTIVIDAD"].ToString();
|
||
}
|
||
else
|
||
{
|
||
lblTituloActividad.Text = "Actividad N°" + n_pActividad.ToString();
|
||
lblEstadoA1.Text = "Sin asignar";
|
||
lblFechaIngresoA1.Text = "Sin asignar";
|
||
lblFechaResolucionA1.Text = "Sin asignar";
|
||
lblResponsableA1.Items.Add("Sin asignar");
|
||
Session["NACTIVIDAD"] = string.Empty;
|
||
Session["DESCRIPCIONACTIVIDAD"] = string.Empty;
|
||
Session["PKRESPONSABLEACTIVIDAD"] = string.Empty;
|
||
}
|
||
lblResponsableA1.Items.Clear();
|
||
foreach (DataRow row in dsEncargadosActividades.Tables[0].Rows)
|
||
{
|
||
string strNombreFormateado = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(row["NOMBRECOMPLETO"].ToString().ToLower());
|
||
lblResponsableA1.Items.Add(strNombreFormateado);
|
||
//lblResponsableA1.Text += strNombreFormateado + "\n";
|
||
}
|
||
EjecutarScript("VentanaAbrirActividades();");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
private bool consultarActividadProgramacion(int nPKProgramacion)
|
||
{
|
||
bool bRespuesta = false;
|
||
try
|
||
{
|
||
|
||
objSolicitudBL = new solicitudBL();
|
||
|
||
objSolicitudBL.objSolicitudEL.PK = nPKProgramacion;
|
||
objSolicitudBL.objSolicitudEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 6;//firma digital debe poder asignar el usuario a responder
|
||
|
||
|
||
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||
bRespuesta = true;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
return bRespuesta;
|
||
}
|
||
/// <summary>
|
||
/// Carga el grid de tareas
|
||
/// </summary>
|
||
/// <param name="p_Llenar"></param>
|
||
private void CargarImagenesSeguimientoActividades(int n_pProgramacionSolicitud) //M0
|
||
{
|
||
try
|
||
{
|
||
int nEstado = 0;
|
||
int nActividad = 0;
|
||
int nEstadoAnterior = 0;
|
||
int nActividadAnterior = 0;
|
||
arlCondicionesFiltroBusqueda = new ArrayList();
|
||
//condicionesBusqueda();
|
||
objSolicitudBL = new solicitudBL();
|
||
|
||
objSolicitudBL.objSolicitudEL.PK = n_pProgramacionSolicitud;
|
||
//objSolicitudBL.objSolicitudEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
|
||
imgActividad1.ImageUrl = "../../Images/Actividades/circulogris.jpg";
|
||
imgActividad2.ImageUrl = "../../Images/Actividades/circulogris.jpg";
|
||
imgActividad3.ImageUrl = "../../Images/Actividades/circulogris.jpg";
|
||
imgActividad4.ImageUrl = "../../Images/Actividades/circulogris.jpg";
|
||
imgActividad5.ImageUrl = "../../Images/Actividades/circulogris.jpg";
|
||
imgActividad6.ImageUrl = "../../Images/Actividades/circulogris.jpg";
|
||
imgActividad7.ImageUrl = "../../Images/Actividades/circulogris.jpg";
|
||
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(arlCondicionesFiltroBusqueda);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach(DataRow row in dsEncargadosActividades.Tables[0].Rows)
|
||
{
|
||
ImageButton Imagectr = new ImageButton();//)FindControl("imgActividad" + x.ToString());
|
||
|
||
|
||
|
||
|
||
nActividad = int.Parse(row["ORDENACTIVIDAD"].ToString());
|
||
if (nActividadAnterior != nActividad )
|
||
nEstado = int.Parse(row["FKESTADO"].ToString());
|
||
|
||
if (nActividadAnterior == nActividad && nEstadoAnterior != 5 && nEstadoAnterior != 8)
|
||
{
|
||
nEstado = int.Parse(row["FKESTADO"].ToString());
|
||
}
|
||
|
||
|
||
if (nActividadAnterior != nActividad || ( nEstadoAnterior != 5 && nActividadAnterior == nActividad))
|
||
{
|
||
if (nActividadAnterior != nActividad || (nEstadoAnterior != 8 && nActividadAnterior == nActividad))
|
||
{
|
||
switch (nEstado)
|
||
{
|
||
//Asignada
|
||
case 1: Imagectr.ImageUrl = "../../Images/Actividades/circuloamarillo.jpg"; break;
|
||
//No asignada
|
||
case 2: Imagectr.ImageUrl = "../../Images/Actividades/circulogris.jpg"; break;
|
||
//Pendiente
|
||
case 3: Imagectr.ImageUrl = "../../Images/Actividades/circuloamarillo.jpg"; break;
|
||
//Re inspeccion
|
||
case 4: Imagectr.ImageUrl = "../../Images/Actividades/circuloamarillo.jpg"; break;
|
||
//Finalizada
|
||
case 5: Imagectr.ImageUrl = "../../Images/Actividades/circuloverde.jpg"; break;
|
||
//Devolucion
|
||
case 6: Imagectr.ImageUrl = "../../Images/Actividades/circuloamarillo.jpg"; break;
|
||
//Finalizado fuera de tiempo
|
||
case 8: Imagectr.ImageUrl = "../../Images/Actividades/circulorojo.png"; break;
|
||
}
|
||
switch (nActividad)
|
||
{
|
||
case 1: imgActividad1.ImageUrl = Imagectr.ImageUrl; break;
|
||
case 2: imgActividad2.ImageUrl = Imagectr.ImageUrl; break;
|
||
case 3: imgActividad3.ImageUrl = Imagectr.ImageUrl; break;
|
||
case 4: imgActividad4.ImageUrl = Imagectr.ImageUrl; break;
|
||
case 5: imgActividad5.ImageUrl = Imagectr.ImageUrl; break;
|
||
case 6: imgActividad6.ImageUrl = Imagectr.ImageUrl; break;
|
||
case 7: imgActividad7.ImageUrl = Imagectr.ImageUrl; break;
|
||
|
||
}
|
||
nEstadoAnterior = int.Parse(row["FKESTADO"].ToString());
|
||
nActividadAnterior = int.Parse(row["ORDENACTIVIDAD"].ToString());
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
}
|
||
//imgActividad3.Enabled = false;
|
||
//imgActividad4.Enabled = false;
|
||
|
||
//if (dsEncargadosActividades.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString() == "1")
|
||
// imgActividad3.Enabled = true;
|
||
//if (dsEncargadosActividades.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString() == "2")
|
||
// imgActividad4.Enabled = true;
|
||
//if (dsEncargadosActividades.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString() == "3")
|
||
//{
|
||
// imgActividad3.Enabled = true;
|
||
// imgActividad4.Enabled = true;
|
||
//}
|
||
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
protected void imgAsignacionExpediente_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
try
|
||
{
|
||
EncriptaBL objEncripta = new EncriptaBL();
|
||
//int i = Convert.ToInt32(e.CommandArgument);
|
||
//GridViewRow selectedRow = grvListaDatos.Rows[i];
|
||
//Session["PKSOLICITUD"] = selectedRow.Cells[12].Text;
|
||
//Session["SOLICITUD"] = selectedRow.Cells[3].Text;
|
||
//Session["PKPROGRAMACION"] = selectedRow.Cells[2].Text;
|
||
|
||
ArrayList arlCondicionesFiltroBusqueda = new ArrayList();
|
||
if (Session["PKPROGRAMACION"].ToString() != " ") //se verifica que existe la programcicion de la solicitud
|
||
{
|
||
solicitudBL objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 1; //la activida de Ingreso y asignacion de expediente
|
||
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(arlCondicionesFiltroBusqueda);
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0) //se verifica que ya se haya asignado la actividad 1
|
||
{
|
||
bool existe = false;
|
||
foreach (DataRow row in dsEncargadosActividades.Tables[0].Rows)
|
||
{
|
||
if (row["FKUSUARIOXDEPENDENCIA"].ToString().Trim() == Session["PKUSUARIOXDEPENDENCIA"].ToString().Trim())
|
||
existe = true;
|
||
}
|
||
if (existe)
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&d=ingresodatos");
|
||
else
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&d=deshabilitar");
|
||
|
||
}
|
||
else
|
||
{
|
||
MensajeAlerta("No se han programado las actividades relacionadas con esta solicitud");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MensajeAlerta("No se han programado las actividades relacionadas con esta solicitud");
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Se produjo un error con la opción seleccionada", ex);
|
||
}
|
||
}
|
||
protected void imgAsignarActividad_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
try
|
||
{
|
||
if (Session["SOLICITUD"] != null && Session["PKUSUARIOXDEPENDENCIA"] != null)
|
||
{
|
||
solicitudBL objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 5;//se valida la tarea 5 constancias ya que no se puede firmar y validar las constancias sin la informacion que se encuentra en el este formulario
|
||
objSolicitudBL.objSolicitudEL.FKESTADO = 5;
|
||
objSolicitudBL.objSolicitudEL.FKESTADO2 = 8;
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||
{
|
||
btnAsignarActividades.Enabled = false;
|
||
ddlActividades.Enabled = false;
|
||
ddlEncargado.Enabled = false;
|
||
}
|
||
else
|
||
{
|
||
btnAsignarActividades.Enabled = true;
|
||
ddlActividades.Enabled = true;
|
||
ddlEncargado.Enabled = true;
|
||
}
|
||
|
||
int pkSolicitud = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
llenarGridViewActividadesEncargado(pkSolicitud);
|
||
llenarDDLActividades(true);
|
||
llenarDDLEncargado(true);
|
||
EjecutarScript("VentanaCerrarActividades();VentanaAbrir();");
|
||
}
|
||
else
|
||
Response.Redirect("../wfrLogin.aspx?sesion=expiro", false);
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Se produjo un error con la opción seleccionada", ex);
|
||
}
|
||
}
|
||
protected void imgValidacionFirma_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
solicitudBL objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 5;//se valida la tarea 5 constancias ya que no se puede firmar y validar las constancias sin la informacion que se encuentra en el este formulario
|
||
objSolicitudBL.objSolicitudEL.FKESTADO = 5;
|
||
objSolicitudBL.objSolicitudEL.FKESTADO2 = 8;
|
||
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||
{
|
||
if (Session["SOLICITUD"] != null && Session["PKUSUARIOXDEPENDENCIA"] != null)
|
||
{
|
||
EncriptaBL objEncripta = new EncriptaBL();
|
||
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 6;//se valida la tarea 6 validacion y firma para deshabilitar el boton de editar y firma
|
||
dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0 )
|
||
{
|
||
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&c=confeccion&f=finalizado");
|
||
|
||
|
||
}
|
||
else
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&c=confeccion&d=firmar");
|
||
|
||
|
||
}
|
||
else
|
||
Response.Redirect("../wfrLogin.aspx?sesion=expiro", false);
|
||
}
|
||
else
|
||
{
|
||
//MensajeAlerta("No se ha finalizado la confección de constancias de donde salen los documentos a firmar.");
|
||
string p_strMensaje = "No se ha finalizado la confección de constancias de donde se generan los documentos a firmar y validar.";
|
||
EjecutarScript("VentanaAbrirActividades();toastr.warning('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
}
|
||
|
||
protected void imgNotificacionUsuario_Click(object sender, ImageClickEventArgs e)
|
||
{
|
||
solicitudBL objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 6;//se valida la tarea 6 validacion y firma se haya finalizado
|
||
objSolicitudBL.objSolicitudEL.FKESTADO = 5;
|
||
objSolicitudBL.objSolicitudEL.FKESTADO2 = 8;
|
||
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||
{
|
||
if (Session["SOLICITUD"] != null && Session["PKUSUARIOXDEPENDENCIA"] != null)
|
||
{
|
||
EjecutarScript("VentanaAbrirNotificacionCliente();");
|
||
var s = "qweqweqwe";
|
||
}
|
||
else
|
||
Response.Redirect("../wfrLogin.aspx?sesion=expiro", false);
|
||
}
|
||
else
|
||
{
|
||
//MensajeAlerta("No se ha finalizado la confección de constancias de donde salen los documentos a firmar.");
|
||
string p_strMensaje = "No se ha finalizado la confección de constancias de donde se generan los documentos a firmar y validar.";
|
||
EjecutarScript("VentanaAbrirActividades();toastr.warning('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
}
|
||
|
||
|
||
protected void grvListaAsignaciones_RowDataBound(object sender, GridViewRowEventArgs e)
|
||
{
|
||
try
|
||
{
|
||
//GridViewRow selectedRow = e.Row;
|
||
|
||
|
||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||
{
|
||
e.Row.Cells[4].ToolTip = "Seguimiento de Disponibilidades";
|
||
// if (e.Row.Cells[12].Text.Trim() == "Asignada")
|
||
// selectedRow.BackColor = System.Drawing.Color.Yellow;
|
||
|
||
// if (e.Row.Cells[12].Text.Trim() == "Finalizada")
|
||
// selectedRow.BackColor = System.Drawing.Color.Green;
|
||
|
||
// if (e.Row.Cells[12].Text.Trim() == "Bloqueada")
|
||
// selectedRow.BackColor = System.Drawing.Color.Gray;
|
||
}
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Se produjo un error al realizar la consulta.", ex);
|
||
}
|
||
}
|
||
protected void btnFinalizarAP_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
//limpiarCampos();
|
||
|
||
string strNombreCarta = Session["SOLICITUD"].ToString();
|
||
string pdfPathCriterioAP = ConfigurationManager.AppSettings["DocumentosPDF"].ToString() + @"\" + strNombreCarta + @"\" + strNombreCarta + "-AP.pdf";
|
||
string ruta = ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\" + strNombreCarta;
|
||
|
||
|
||
//se carga el archivo y el registro a vision 2020
|
||
Documento oDoc = new Documento();
|
||
string Archivo = strNombreCarta + "-AP.pdf";
|
||
string strAlmacenado = "";
|
||
if (File.Exists(@"C:\fileproyectos\FileDesarrollo\WCF-PDF\" + Archivo))
|
||
{
|
||
strAlmacenado = "EXISTE";
|
||
}
|
||
|
||
//string strAlmacenado = oDoc.Visor_Documento(strNombreCarta.ToString().Trim() + "|" + "Criterio técnico AP", strNombreCarta.ToString().Trim(), pdfPathCriterioAP, strNombreCarta + "-AP.pdf");
|
||
string p_strMensaje = string.Empty;
|
||
|
||
if (strAlmacenado != string.Empty && strAlmacenado != "No existe")
|
||
{
|
||
inspeccionapBL objInspeccionBL = new inspeccionapBL();
|
||
objInspeccionBL.objinspeccionapEL.FKSOLICITUD = int.Parse(Session["PKSOLICITUD"].ToString());
|
||
objInspeccionBL.objinspeccionapEL.FKESTADOINSPECCION = 1;//ASIGNADA
|
||
DataSet dsInspeccionBL = objInspeccionBL.listarInspecciones(null);
|
||
|
||
if (dsInspeccionBL.Tables[0].Rows.Count > 0)
|
||
{
|
||
GuardarDatosActividadAPAS("aprueba");
|
||
p_strMensaje = "Finalizó con éxito la actividad 3 Confección del Criterio Técnico AP.";
|
||
EjecutarScript("VentanaAbrirFormularioAP();;toastr.success('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
else
|
||
{
|
||
p_strMensaje = "No se han generado inspecciones para esta solicitud.";
|
||
EjecutarScript("VentanaAbrirFormularioAP();toastr.warning('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
p_strMensaje = "No se han generado los documentos en formato pdf de los criterios técnicos por favor ingrese de nuevo al formulario presione exportar.";
|
||
EjecutarScript("VentanaAbrirFormularioAP();toastr.warning('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
EjecutarScript("VentanaAbrirFormularioAP();toastr.warning('Se presentó un error al finalizar la actividad.', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
}
|
||
protected void btnFinalizarAS_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
string strNombreCarta = Session["SOLICITUD"].ToString();
|
||
|
||
|
||
string pdfPathCriterioAP = ConfigurationManager.AppSettings["DocumentosPDF"].ToString() + @"\" + strNombreCarta + @"\" + strNombreCarta + "-AS.pdf";
|
||
string ruta = ConfigurationManager.AppSettings["RutaPdfAdjuntosSql"].ToString() + @"\" + strNombreCarta;
|
||
|
||
|
||
//se carga el archivo y el registro a vision 2020
|
||
Documento oDoc = new Documento();
|
||
|
||
string Archivo = strNombreCarta + "-AP.pdf";
|
||
string strAlmacenado = "";
|
||
if (File.Exists(@"C:\fileproyectos\FileDesarrollo\WCF-PDF\" + Archivo))
|
||
{
|
||
strAlmacenado = "EXISTE";
|
||
}
|
||
//string strAlmacenado = oDoc.Visor_Documento(strNombreCarta.ToString().Trim() + "|" + "Criterio técnico AS", strNombreCarta.ToString().Trim(), pdfPathCriterioAP, strNombreCarta + "-AS.pdf");
|
||
string p_strMensaje = string.Empty;
|
||
|
||
if (strAlmacenado != string.Empty && strAlmacenado != "No existe")
|
||
{
|
||
inspeccionasBL objInspeccionasBL = new inspeccionasBL();
|
||
objInspeccionasBL.objinspeccionasEL.FKSOLICITUD = int.Parse(Session["PKSOLICITUD"].ToString());
|
||
objInspeccionasBL.objinspeccionasEL.FKESTADOINSPECCION = 1;//ASIGNADA
|
||
DataSet dsInspeccionBL = objInspeccionasBL.listarInspeccionesAS(null);
|
||
|
||
if (dsInspeccionBL.Tables[0].Rows.Count > 0)
|
||
{
|
||
GuardarDatosActividadAPAS("aprueba");
|
||
p_strMensaje = "Finalizó con éxito la actividad 4 Confección del Criterio Técnico AS.";
|
||
EjecutarScript("VentanaAbrirFormularioAS();toastr.success('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
|
||
}
|
||
else
|
||
{
|
||
p_strMensaje = "No se han generado inspecciones para esta solicitud.";
|
||
EjecutarScript("VentanaAbrirFormularioAS();toastr.warning('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
|
||
}
|
||
}
|
||
else
|
||
{
|
||
p_strMensaje = "No se han generado los documentos en formato pdf de los criterios técnicos por favor ingrese de nuevo al formulario presione exportar.";
|
||
EjecutarScript("VentanaAbrirFormularioAS();toastr.warning('" + p_strMensaje + "', 'Información',toastr.options ={closeButton: true})");
|
||
}
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
EjecutarScript("VentanaAbrirFormularioAS();toastr.warning('Se presentó un error al finalizar la actividad.', 'Información',toastr.options ={closeButton: true})");
|
||
|
||
}
|
||
}
|
||
} |