2241 lines
No EOL
109 KiB
C#
2241 lines
No EOL
109 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 AyABL.TRA;
|
||
using System.Globalization;
|
||
|
||
|
||
|
||
|
||
public partial class Forms_Trans_frwBusquedaSolicitud : 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);
|
||
//cuwVentanaEmergenteRequisitos.AbrirVentanaEmergente += new ControlUsuario_cuwVentanaEmergenteRequisitos.SearchEvent(AbrirVentanaEmergente);
|
||
cuwVentanaEmergenteObservaciones.AbrirVentanaEmergenteObservaciones += new ControlUsuario_cuwVentanaEmergenteObservaciones.SearchEvent(AbrirVentanaEmergenteObservaciones);
|
||
cuwVentanaEmergenteDevolucion.AbrirVentanaEmergenteDevolucion += new ControlUsuario_cuwVentanaEmergenteDevolucion.SearchEvent(AbrirVentanaEmergenteDevolucion);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R0M1", ex);
|
||
}
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Variables (R1)
|
||
|
||
GridView grvListaDatosTemp;
|
||
|
||
#region variables del estandar
|
||
ArrayList arlCondicionesFiltroBusqueda = new ArrayList();
|
||
#endregion
|
||
|
||
solicitudBL objSolicitudBL;
|
||
oficinaayaBL objDependenciaBL;
|
||
regionBL objRegionBL;
|
||
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;
|
||
}
|
||
}
|
||
|
||
if ((!IsPostBack) && (Session.Count > 0))
|
||
{
|
||
AyABL.AyABL objBL = new AyABL.AyABL();
|
||
arlCondicionesFiltroBusqueda = objBL.buscarPorFechas(Tablas.insertasolicitud, DateTime.Now.AddDays(-10), DateTime.Now.AddDays(1), operadorLogico.AND, arlCondicionesFiltroBusqueda);
|
||
lblMensajeConsulta.Visible = true;
|
||
if (Request["f"] != null)
|
||
{
|
||
|
||
llenarGridViewPendientes(true, "10000");
|
||
//MensajeAlerta("El folio tiene solicitudes asociadas.");
|
||
}
|
||
else
|
||
//llenarGridView(true);
|
||
llenarGridViewPendientes(true,"10");
|
||
arlCondicionesFiltroBusqueda = null;
|
||
//llenarDDLTipoBusqueda();
|
||
//llenarDDLMes();
|
||
//llenarDDLAño();
|
||
mostrarFilaTabla(1);
|
||
ComandosxMenu();
|
||
txtConsulta.Focus();
|
||
|
||
}
|
||
if (Session.Count == 0)
|
||
Response.Redirect("../wfrLogin.aspx?sesion=expiro", false);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R2M0", ex);
|
||
}
|
||
}
|
||
|
||
#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
|
||
{
|
||
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.”";
|
||
|
||
Session["PaginaBack"] = "frwBusquedaSolicitud.aspx";
|
||
if (e.CommandName == "editar")
|
||
{
|
||
EncriptaBL objEncripta = new EncriptaBL();
|
||
int i = Convert.ToInt32(e.CommandArgument);
|
||
GridViewRow selectedRow = grvListaDatos.Rows[i];
|
||
Session["PKPROGRAMACION"] = selectedRow.Cells[2].Text;
|
||
Session["PKSOLICITUD"] = selectedRow.Cells[3].Text;
|
||
Session["SOLICITUD"] = selectedRow.Cells[4].Text;
|
||
Session["FKREUTILIZA"] = selectedRow.Cells[13].Text;
|
||
Session["ESTADO"] = selectedRow.Cells[12].Text.Trim();
|
||
ArrayList arlCondicionesFiltroBusqueda = new ArrayList();
|
||
|
||
if (selectedRow.Cells[12].Text != "Finalizada" && selectedRow.Cells[12].Text != "Cancelada")
|
||
{
|
||
solicitudBL objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 1; //la activida de Ingreso y asignacion de expediente
|
||
objSolicitudBL.objSolicitudEL.FKDEPENDENCIA = int.Parse(Session["DEPENDENCIA"].ToString());
|
||
|
||
//verificar si alguien de la oficina tiene asignada la tarea 1
|
||
//si la tiene se le da acceso para modificar
|
||
//si no se le debe crear la tarea 1 al que esta accediendo
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(arlCondicionesFiltroBusqueda);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0 || Session["ROL"].ToString() == "Administrador") //se verifica que ya se haya asignado la actividad 1
|
||
{
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&d=ingresodatos");
|
||
|
||
}
|
||
else
|
||
{
|
||
if (Session["PKPROGRAMACION"].ToString() != " ")
|
||
{
|
||
solicitudBL objresponsableActividadBL = new solicitudBL();
|
||
objresponsableActividadBL.objresponsableActividadEL.FECHAASIGNACION = DateTime.Now;
|
||
objresponsableActividadBL.objresponsableActividadEL.FECHARECIBIDO = DateTime.Now;
|
||
objresponsableActividadBL.objresponsableActividadEL.FECHADEVOLUCION = DateTime.Now.AddDays(-1);
|
||
objresponsableActividadBL.objresponsableActividadEL.VALIDACIONFIRMA = false;
|
||
|
||
objresponsableActividadBL.objresponsableActividadEL.FKACTIVIDAD = 1;
|
||
objresponsableActividadBL.objresponsableActividadEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
objresponsableActividadBL.objresponsableActividadEL.FKESTADO = 1;//asignada
|
||
|
||
objresponsableActividadBL.objresponsableActividadEL.ASTATE = true;
|
||
objresponsableActividadBL.objresponsableActividadEL.FKPROGRAMACIONSOLICITUD = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
int nValorRetornado = objresponsableActividadBL.insertarAsignacionActividadEncargado();
|
||
|
||
if (nValorRetornado > 0)
|
||
{
|
||
|
||
#region Envio de correo
|
||
|
||
arlCondicionesFiltroBusqueda = new ArrayList();
|
||
// condicionesBusqueda();
|
||
solicitudBL 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 = "Se ha finalizado la actividad de Ingreso y asignación de expedientes de la solicitud de disponibilidad " + Session["SOLICITUD"].ToString() + ", para ver mas detalles ingrese al sistema <a href=http://" + HttpContext.Current.Request.Url.Authority + "/Forms/wfrLogin> SIGDD</a>" + strPiePagina;
|
||
objcorreoBL.objcorreoEL.FKUSUARIO = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||
|
||
nValorRetornado = objcorreoBL.insertarCorreo();
|
||
|
||
#endregion
|
||
}
|
||
}
|
||
}
|
||
}
|
||
if (Session["PKPROGRAMACION"].ToString() != " ") //se verifica que ya se haya asignado la actividad 1
|
||
{
|
||
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 actividad");
|
||
}
|
||
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()));
|
||
|
||
|
||
}
|
||
if (e.CommandName == "seguimiento")
|
||
{
|
||
|
||
int i = Convert.ToInt32(e.CommandArgument);
|
||
GridViewRow selectedRow = grvListaDatos.Rows[i];
|
||
Session["PKPROGRAMACION"] = selectedRow.Cells[2].Text;
|
||
Session["FKTIPOINSPECCION"] = selectedRow.Cells[15].Text;
|
||
Session["FKREUTILIZA"] = selectedRow.Cells[13].Text;
|
||
Session["ESTADO"] = selectedRow.Cells[12].Text.Trim();
|
||
if (Session["PKPROGRAMACION"].ToString() != " ") //se verifica que existe la programcicion de la solicitud
|
||
{
|
||
int pkProgramacionSolicitud = int.Parse(selectedRow.Cells[2].Text);
|
||
Session["SOLICITUD"] = selectedRow.Cells[4].Text;
|
||
Session["PKSOLICITUD"] = selectedRow.Cells[3].Text;
|
||
EjecutarScript("VentanaAbrirActividades();");
|
||
lblNumeroSolicitud.Text = selectedRow.Cells[4].Text;
|
||
CargarImagenesSeguimientoActividades(pkProgramacionSolicitud);
|
||
}
|
||
else
|
||
{
|
||
MensajeAlerta("No se han asignado las actividades a esta solicitud.");
|
||
}
|
||
|
||
}
|
||
}
|
||
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;
|
||
//llenarGridView(true);
|
||
llenarGridViewPendientes(true, "10000");
|
||
|
||
}
|
||
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, "10");
|
||
}
|
||
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
|
||
{
|
||
//llenarGridView(true);
|
||
llenarGridViewPendientes(true, "10000");
|
||
}
|
||
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
|
||
{
|
||
//llenarGridView(true);
|
||
Session["SOLICITUD"] = null;
|
||
Session["PKSOLICITUD"] = null;
|
||
Session["FKREUTILIZA"] = null;
|
||
Session["PKPROGRAMACION"] = null;
|
||
|
||
Response.Redirect("~/forms/tra/Validarplanosyfolios.aspx");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
//MensajeError("Error en R3M4" + MensajesAplicacion.BusquedaFallido.ToString(), ex);
|
||
}
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// Buscar usuarios en el Active Directory.
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
|
||
protected void btnProrroga_Click(object sender, EventArgs e) //M4
|
||
{
|
||
try
|
||
{
|
||
btnProrroga.Enabled = false;
|
||
ViewState["MODO"] = "Nuevo";
|
||
int nContador = 0;
|
||
EncriptaBL objEncripta = new EncriptaBL();
|
||
// recorro el grid
|
||
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;
|
||
int intPk = Convert.ToInt32(row.Cells[3].Text);
|
||
if (row.Cells[14].Text != " ")//FECHAINSERTASOLICITUD
|
||
{
|
||
DateTime dtFechaVenceCarta = DateTime.Parse(row.Cells[14].Text);
|
||
|
||
if (dtFechaVenceCarta > DateTime.Now && row.Cells[12].Text == "Finalizada")//fecha de vencimiento de la constancia mayor al dia de hoy que se encuentre en vigencia
|
||
{
|
||
Session["ESTADO"] = row.Cells[12].Text.Trim();
|
||
//se usa el proceso de revision para crear la nueva solicitud a partir de una existente pero queda con el tipo de disponibilidad en revision
|
||
objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = intPk;
|
||
objSolicitudBL.objSolicitudEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
DataSet ds = objSolicitudBL.revisionSolicitud();
|
||
|
||
//cambiamos el tipo de disponibilidad a prorroga y no se crean mas procedimientos almacenados
|
||
objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = int.Parse(ds.Tables[0].Rows[0]["PKSOLICITUD"].ToString());
|
||
objSolicitudBL.objSolicitudEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
ds = objSolicitudBL.dsListaSolicitud(null);
|
||
|
||
int nModificaTipo = 0;
|
||
objSolicitudBL.objSolicitudEL.FKTIPODISPONIBILIDAD = 2;//prorroga
|
||
nModificaTipo = objSolicitudBL.modificarTipoDisponibilidad();
|
||
|
||
Session["SOLICITUD"] = ds.Tables[0].Rows[0]["NUMEROSOLICITUDSOLICITUD"];
|
||
Session["PKSOLICITUD"] = ds.Tables[0].Rows[0]["PKSOLICITUD"];
|
||
Session["PKPROGRAMACION"] = ds.Tables[0].Rows[0]["PKPROGRAMACIONSOLICITUD"];
|
||
Session["FKREUTILIZA"] = ds.Tables[0].Rows[0]["FKREUTILIZA"];
|
||
Session["PKPROGRAMACION"] = " ";
|
||
|
||
|
||
AsignaActividadesUsuarios(1);
|
||
|
||
#region envio de notificacion a programacion
|
||
objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.FKDEPENDENCIA = int.Parse(Session["DEPENDENCIA"].ToString());
|
||
objSolicitudBL.objSolicitudEL.PK = 0;
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 2;
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaUsuariosXActividades(arlCondicionesFiltroBusqueda);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow row2 in dsEncargadosActividades.Tables[0].Rows)
|
||
{
|
||
if (Convert.ToBoolean(row2[Concepto.ACTIVO.ToString() + Tablas.USUARIO.ToString()]))
|
||
{
|
||
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.”";
|
||
|
||
int nPkSolicitud = Convert.ToInt32(Session["PKSOLICITUD"].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 = "Prorroga de expediente - SIGDD";
|
||
objcorreoBL.objcorreoEL.CONTENIDO = "La solicitud N° " + Session["SOLICITUD"].ToString() + " ha sido prorrogada para realizar la programación de actividades ingrese al sistema <a href=http://" + HttpContext.Current.Request.Url.Authority + "/Forms/wfrLogin.> SIGDD</a>" + strPiePagina;
|
||
objcorreoBL.objcorreoEL.FKUSUARIO = Convert.ToInt32(row2["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||
|
||
int nValorRetornadoCorreo = objcorreoBL.insertarCorreo();
|
||
}
|
||
}
|
||
}
|
||
#endregion
|
||
//if (int.Parse(ds.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString()) == 1 || int.Parse(ds.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString()) == 3)
|
||
// AsignaActividadesUsuarios(5);//Confección del Criterio técnico de agua potable
|
||
//if (int.Parse(ds.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString()) == 2 || int.Parse(ds.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString()) == 3)
|
||
// AsignaActividadesUsuarios(6);//Confección del Criterio técnico de alcantarillado sanitario
|
||
//AsignaActividadesUsuarios(7);//Confección de constancias
|
||
|
||
|
||
|
||
|
||
|
||
GuardarEventoBitacora(
|
||
Session["LOGIN"].ToString(),
|
||
AccionBitacora.UPDATE.ToString(),
|
||
MensajesBitacora.IngresarRegistro + ": Se prorroga la solicitud" + row.Cells[4].Text,
|
||
"frwBusquedaSolicitud.aspx",
|
||
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||
);
|
||
MensajeInformativo("Se finaliza el proceso de prorrogar correctamente por favor agregue los requisitos pendientes...");
|
||
//}
|
||
//else
|
||
//{
|
||
// MensajeAlerta("No ha vencido el plazo de vigencia de los documentos relacionados con la solicitud...");
|
||
//}
|
||
Session["ESTADO"] = string.Empty;
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&c=prorroga&d=deshabilitar", false);
|
||
}
|
||
else
|
||
{
|
||
MensajeAlerta("Este registro no cumple para prorrogar: Los documentos no estan en vigencia.");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if (row.Cells[14].Text == " ")
|
||
MensajeAlerta("Este registro no cumple para prorrogar: No existen constancias asociadas.");
|
||
|
||
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
if (nContador == 0)
|
||
MensajeAlerta("Debe seleccionar una solicitud.....");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
//MensajeError("Error en R3M4" + MensajesAplicacion.BusquedaFallido.ToString(), ex);
|
||
}
|
||
finally
|
||
{
|
||
btnProrroga.Enabled = true;
|
||
}
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// Buscar usuarios en el Active Directory.
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
|
||
protected void btnRevision_Click(object sender, EventArgs e) //M4
|
||
{
|
||
try
|
||
{
|
||
btnRevision.Enabled = false;
|
||
ViewState["MODO"] = "Nuevo";
|
||
int nContador = 0;
|
||
EncriptaBL objEncripta = new EncriptaBL();
|
||
// recorro el grid
|
||
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;
|
||
int intPk = Convert.ToInt32(row.Cells[3].Text);
|
||
if (row.Cells[14].Text != " ")
|
||
{
|
||
DateTime dtFechaVenceCarta = DateTime.Parse(row.Cells[14].Text);
|
||
|
||
if (dtFechaVenceCarta > DateTime.Now && row.Cells[12].Text == "Finalizada")//fecha de vencimiento de la constancia mayor al dia de hoy que se encuentre en vigencia
|
||
{
|
||
Session["ESTADO"] = row.Cells[12].Text.Trim();
|
||
objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = intPk;
|
||
objSolicitudBL.objSolicitudEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
DataSet ds = objSolicitudBL.revisionSolicitud();
|
||
|
||
Session["SOLICITUD"] = ds.Tables[0].Rows[0]["NUMEROSOLICITUDSOLICITUD"];
|
||
Session["PKSOLICITUD"] = ds.Tables[0].Rows[0]["PKSOLICITUD"];
|
||
Session["PKPROGRAMACION"] = " ";
|
||
Session["FKREUTILIZA"] = ds.Tables[0].Rows[0]["FKREUTILIZA"];
|
||
|
||
AsignaActividadesUsuarios(1);
|
||
#region envio de notificacion a programacion
|
||
objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.FKDEPENDENCIA = int.Parse(Session["DEPENDENCIA"].ToString());
|
||
objSolicitudBL.objSolicitudEL.PK = 0;
|
||
objSolicitudBL.objSolicitudEL.ORDEN = 2;
|
||
DataSet dsEncargadosActividades = objSolicitudBL.dsListaUsuariosXActividades(arlCondicionesFiltroBusqueda);
|
||
|
||
if (dsEncargadosActividades.Tables[0].Rows.Count > 0)
|
||
{
|
||
foreach (DataRow row2 in dsEncargadosActividades.Tables[0].Rows)
|
||
{
|
||
if (Convert.ToBoolean(row2[Concepto.ACTIVO.ToString() + Tablas.USUARIO.ToString()]))
|
||
{
|
||
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.”";
|
||
|
||
int nPkSolicitud = Convert.ToInt32(Session["PKSOLICITUD"].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 = "Revisión - SIGDD";
|
||
objcorreoBL.objcorreoEL.CONTENIDO = "La solicitud N° " + Session["SOLICITUD"].ToString() + " ha sido seleccionada para revisión, para realizar la programación de actividades ingrese al sistema <a href=http://" + HttpContext.Current.Request.Url.Authority + "/Forms/wfrLogin.> SIGDD</a>" + strPiePagina;
|
||
objcorreoBL.objcorreoEL.FKUSUARIO = Convert.ToInt32(row2["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||
|
||
int nValorRetornadoCorreo = objcorreoBL.insertarCorreo();
|
||
}
|
||
}
|
||
}
|
||
#endregion
|
||
//if (int.Parse(ds.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString()) == 1 || int.Parse(ds.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString()) == 3)
|
||
// AsignaActividadesUsuarios(5);//Confección del Criterio técnico de agua potable
|
||
//if (int.Parse(ds.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString()) == 2 || int.Parse(ds.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString()) == 3)
|
||
// AsignaActividadesUsuarios(6);//Confección del Criterio técnico de alcantarillado sanitario
|
||
//AsignaActividadesUsuarios(7);//Confección de constancias
|
||
|
||
llenarGridViewPendientes(true, "10000");
|
||
llenarDDLTipoBusqueda();
|
||
llenarDDLMes();
|
||
llenarDDLAño();
|
||
mostrarFilaTabla(1);
|
||
GuardarEventoBitacora(
|
||
Session["LOGIN"].ToString(),
|
||
AccionBitacora.UPDATE.ToString(),
|
||
MensajesBitacora.IngresarRegistro + ": Se revisa la solicitud" + row.Cells[4].Text,
|
||
"frwBusquedaSolicitud.aspx",
|
||
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||
);
|
||
MensajeInformativo("Se finaliza el proceso de revisión correctamente...");
|
||
//}
|
||
//else
|
||
//{
|
||
// MensajeAlerta("No ha vencido el plazo de vigencia de los documentos relacionados con la solicitud...");
|
||
//}
|
||
Session["ESTADO"] = string.Empty;
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&c=prorroga&d=deshabilitar", false);
|
||
}
|
||
else
|
||
{
|
||
MensajeAlerta("Este registro no cumple para revisión: No cumple con el plazo establecido en el RCPA.");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if (row.Cells[14].Text == " ")
|
||
MensajeAlerta("Este registro no cumple para revisión: No existen constancias asociadas.");
|
||
|
||
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
if (nContador == 0)
|
||
MensajeAlerta("Debe seleccionar una solicitud.....");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
//MensajeError("Error en R3M4" + MensajesAplicacion.BusquedaFallido.ToString(), ex);
|
||
}
|
||
finally
|
||
{
|
||
btnRevision.Enabled = true;
|
||
}
|
||
//try
|
||
//{
|
||
// ViewState["MODO"] = "Nuevo";
|
||
|
||
// int nContador = 0;
|
||
// EncriptaBL objEncripta = new EncriptaBL();
|
||
// // recorro el grid
|
||
// 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;
|
||
// int intPk = Convert.ToInt32(row.Cells[2].Text);
|
||
// if (row.Cells[14].Text != " ")
|
||
// {
|
||
// DateTime dtFechaVenceCarta = DateTime.Parse(row.Cells[14].Text);
|
||
|
||
// //if (dtFechaVenceCarta < DateTime.Now)
|
||
// //{
|
||
// Session["SOLICITUD"] = row.Cells[4].Text;
|
||
// Session["PKSOLICITUD"] = row.Cells[3].Text;
|
||
// Session["PKPROGRAMACION"] = row.Cells[2].Text;
|
||
// Session["FKREUTILIZA"] = " ";
|
||
// AsignaActividadesUsuarios(1);
|
||
// AsignaActividadesUsuarios(3);
|
||
// GuardarEventoBitacora(
|
||
// Session["LOGIN"].ToString(),
|
||
// AccionBitacora.UPDATE.ToString(),
|
||
// MensajesBitacora.IngresarRegistro + ": Se da proceso de resolución a la solicitud" + row.Cells[4].Text,
|
||
// "frwObservacionesActividades.aspx",
|
||
// Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||
// );
|
||
|
||
// Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&d=resolucion", false);
|
||
// //}
|
||
// //else
|
||
// //{
|
||
// // MensajeAlerta("No ha vencido el plazo de vigencia de los documentos relacionados con la solicitud...");
|
||
// //}
|
||
// }
|
||
|
||
// }
|
||
// //else
|
||
// //{
|
||
// // MensajeAlerta("No se han generado documentos para esta solicitud...");
|
||
// //}
|
||
// }
|
||
// }
|
||
// if (nContador == 0)
|
||
// MensajeAlerta("Debe seleccionar una solicitud.....");
|
||
//}
|
||
//catch (Exception ex)
|
||
//{
|
||
// MensajeError("Error en R3M4" + MensajesAplicacion.BusquedaFallido.ToString(), ex);
|
||
//}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Buscar usuarios en el Active Directory.
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
|
||
protected void btnReutilizar_Click(object sender, EventArgs e) //M4
|
||
{
|
||
try
|
||
{
|
||
btnReutilizar.Enabled = false;
|
||
ViewState["MODO"] = "Nuevo";
|
||
int nContador = 0;
|
||
EncriptaBL objEncripta = new EncriptaBL();
|
||
// recorro el grid
|
||
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;
|
||
int intPk = Convert.ToInt32(row.Cells[3].Text);
|
||
if (row.Cells[12].Text == "Finalizada" || row.Cells[12].Text == "Cancelada")
|
||
//if (row.Cells[14].Text != " ")//VERIFICA FECHAVENCECARTA SI NO ESTA ES PORQUE NO SE HAN GENERADO LOS DOCUMENTOS
|
||
{
|
||
// DateTime dtFechaVenceCarta = DateTime.Parse(row.Cells[14].Text);
|
||
|
||
//if (dtFechaVenceCarta < DateTime.Now)
|
||
{
|
||
objSolicitudBL = new solicitudBL();
|
||
objSolicitudBL.objSolicitudEL.PK = intPk;
|
||
objSolicitudBL.objSolicitudEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
DataSet ds = objSolicitudBL.reutilizarSolicitud();
|
||
MensajeInformativo("Se finaliza el proceso de reutilicación correctamente...");
|
||
Session["SOLICITUD"] = ds.Tables[0].Rows[0]["NUMEROSOLICITUDSOLICITUD"];
|
||
Session["PKSOLICITUD"] = ds.Tables[0].Rows[0]["PKSOLICITUD"]; ;
|
||
Session["PKPROGRAMACION"] = " ";
|
||
Session["FKREUTILIZA"] = ds.Tables[0].Rows[0]["FKREUTILIZA"];
|
||
|
||
AsignaActividadesUsuarios(1);
|
||
//if (int.Parse(ds.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString()) == 1 || int.Parse(ds.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString()) == 3)
|
||
// AsignaActividadesUsuarios(5);//Confección del Criterio técnico de agua potable
|
||
//if (int.Parse(ds.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString()) == 2 || int.Parse(ds.Tables[0].Rows[0]["FKTIPOINSPECCION"].ToString()) == 3)
|
||
// AsignaActividadesUsuarios(6);//Confección del Criterio técnico de alcantarillado sanitario
|
||
//AsignaActividadesUsuarios(7);//Confección de constancias
|
||
|
||
llenarGridViewPendientes(true, "10");
|
||
llenarDDLTipoBusqueda();
|
||
llenarDDLMes();
|
||
llenarDDLAño();
|
||
mostrarFilaTabla(1);
|
||
GuardarEventoBitacora(
|
||
Session["LOGIN"].ToString(),
|
||
AccionBitacora.INSERT.ToString(),
|
||
MensajesBitacora.IngresarRegistro + ": Se reutiliza la solicitud" + row.Cells[4].Text,
|
||
"frwBusquedaSolicitud.aspx",
|
||
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||
);
|
||
|
||
}
|
||
//else
|
||
//{
|
||
// MensajeAlerta("No ha vencido el plazo de vigencia de los documentos relacionados con la solicitud...");
|
||
//}
|
||
}
|
||
else
|
||
{
|
||
MensajeAlerta("La solicitud no puede reutilizarse ya que se encuentra activo, debe estar finalizado o cancelado para reutilizar la solicitud.");
|
||
}
|
||
}
|
||
}
|
||
}
|
||
if (nContador == 0)
|
||
MensajeAlerta("Debe seleccionar una solicitud.....");
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
//MensajeError("Error en R3M4" + MensajesAplicacion.BusquedaFallido.ToString(), ex);
|
||
}
|
||
finally
|
||
{
|
||
btnReutilizar.Enabled = true;
|
||
}
|
||
}
|
||
|
||
|
||
protected void btnTraslado_Click(object sender, EventArgs e) //M5
|
||
{
|
||
try
|
||
{
|
||
int nContador = 0;
|
||
EncriptaBL objEncripta = new EncriptaBL();
|
||
// recorro el grid
|
||
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;
|
||
int intPk = Convert.ToInt32(row.Cells[2].Text);
|
||
Session["SOLICITUD"] = row.Cells[4].Text;
|
||
Response.Redirect("~/forms/tra/frwTrasladoExpediente.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()));
|
||
}
|
||
}
|
||
}
|
||
if (nContador == 0)
|
||
MensajeAlerta("Debe seleccionar una solicitud.....");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Se dio un error durante el proceso." , ex);
|
||
}
|
||
}
|
||
|
||
protected void btnSalirActividades_Click(object sender, EventArgs e) //M6
|
||
{
|
||
try
|
||
{
|
||
Session["PKPROGRAMACION"] = "";
|
||
EjecutarScript("VentanaCerrarActividades();");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M6" + 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 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=deshabilitar",false);
|
||
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)
|
||
{
|
||
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();
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&c=confeccion&d=constancia&f=finalizado");
|
||
}
|
||
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();");
|
||
|
||
}
|
||
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 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 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 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 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);
|
||
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Salir del popup
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void btnSalirPopup_Click(object sender, EventArgs e) //M5
|
||
{
|
||
try
|
||
{
|
||
Session["PKPROGRAMACION"] = "";
|
||
//EjecutarScript("VentanaCerrarActividades();");
|
||
|
||
|
||
EjecutarScript("VentanaCerrar();");
|
||
limpiarCampos();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M5" + MensajesAplicacion.BusquedaFallido.ToString(), ex);
|
||
}
|
||
}
|
||
|
||
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)
|
||
{
|
||
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();
|
||
Response.Redirect("~/forms/tra/frwNuevaSolicitud.aspx?" + "l=" + objEncripta.Encryptar(Session["LOGIN"].ToString()) + "&u=" + objEncripta.Encryptar(Session["PKUSUARIO"].ToString()) + "&c=confeccion&d=constancia&f=finalizado");
|
||
|
||
|
||
}
|
||
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
|
||
{
|
||
//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();");
|
||
CargarImagenesSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
EjecutarScript("window.parent.VentanaCerrarFormularioASSesion();");
|
||
}
|
||
}
|
||
protected void btnSalirCriterioAS_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
EjecutarScript("VentanaCerrarFormularioAS();");
|
||
CargarImagenesSeguimientoActividades(int.Parse(Session["PKPROGRAMACION"].ToString()));
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
EjecutarScript("window.parent.VentanaCerrarFormularioASSesion();");
|
||
}
|
||
}
|
||
protected void btnSalirNotificacionCliente_Click(object sender, EventArgs e)
|
||
{
|
||
try
|
||
{
|
||
EjecutarScript("VentanaCerrarNotificacionCliente();");
|
||
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 bdfPkSolicitud = new GridViewBoundField("PKSOLICITUD", "PK", false, false, false);
|
||
GridViewBoundField bdfNumSolicitud = new GridViewBoundField("NUMEROSOLICITUDSOLICITUD", "Número solicitud", true, false, true);
|
||
GridViewBoundField bdfPropietario = new GridViewBoundField("NOMBRECLIENTESOLICITUD", "Propietario", true, false, true);
|
||
GridViewBoundField bdfRegion = new GridViewBoundField("DESCRIPCIONREGION", "Region", true, false, true);
|
||
GridViewBoundField bdfOficina = new GridViewBoundField("DESCRIPCIONDEPENDENCIASIGDD", "Oficina", true, false, true);
|
||
GridViewBoundField bdfPlano = new GridViewBoundField("NUMEROTERRENO", "Inmueble", true, false, true);
|
||
GridViewBoundField bdfFolio = new GridViewBoundField("NUMEROFOLIO", "Folio", true, false, true);
|
||
GridViewBoundField bdfUbicacion = new GridViewBoundField("UBICACION", "Prov/Canton/Dist", true, false, true);
|
||
GridViewBoundField bdfCedula = new GridViewBoundField("CEDULACLIENTESOLICITUD", "Cédula", true, false, true);
|
||
GridViewBoundField bdfEstado = new GridViewBoundField("DESCRIPCIONESTADOPROGRAMACION", "Estado", true,false, true);
|
||
GridViewBoundField bdfFkReutiliza = new GridViewBoundField("FKREUTILIZA", "FK", false, false, false);
|
||
GridViewBoundField bdfFechaVenceCarta = new GridViewBoundField("FECHAVENCECARTA", "FECHAVENCECARTA", false, false, false);
|
||
GridViewBoundField bdfFkTipoInspeccion = new GridViewBoundField("FKTIPOINSPECCION", "FK", false, false, false);
|
||
GridViewBoundField bdfFechaInspeccion = new GridViewBoundField("FECHAINSERTASOLICITUD", "Fecha", true, false, true);
|
||
GridViewBoundField bdfTiempoEjecucion = new GridViewBoundField("TIEMPOEJECUCION", "Duración/dias", true, false, true);
|
||
|
||
grvListaDatosTemp.Columns.Add(bdfPkProgramacion);
|
||
grvListaDatosTemp.Columns.Add(bdfPkSolicitud);
|
||
grvListaDatosTemp.Columns.Add(bdfNumSolicitud);
|
||
grvListaDatosTemp.Columns.Add(bdfPropietario);
|
||
grvListaDatosTemp.Columns.Add(bdfRegion);
|
||
grvListaDatosTemp.Columns.Add(bdfOficina);
|
||
grvListaDatosTemp.Columns.Add(bdfUbicacion);
|
||
grvListaDatosTemp.Columns.Add(bdfPlano);
|
||
grvListaDatosTemp.Columns.Add(bdfFolio);
|
||
grvListaDatosTemp.Columns.Add(bdfCedula);
|
||
grvListaDatosTemp.Columns.Add(bdfEstado);
|
||
grvListaDatosTemp.Columns.Add(bdfFkReutiliza);
|
||
grvListaDatosTemp.Columns.Add(bdfFechaVenceCarta);
|
||
grvListaDatosTemp.Columns.Add(bdfFkTipoInspeccion);
|
||
grvListaDatosTemp.Columns.Add(bdfFechaInspeccion);
|
||
grvListaDatosTemp.Columns.Add(bdfTiempoEjecucion);
|
||
|
||
grvListaDatosTemp.Columns[0].ItemStyle.Width = 25;
|
||
grvListaDatosTemp.Columns[1].ItemStyle.Width = 25;
|
||
grvListaDatosTemp.Columns[6].ItemStyle.Width = 200;
|
||
//grvListaDatosTemp.Columns[14].ItemStyle.BackColor = System.Drawing.Color.Red;
|
||
//grvListaDatosTemp.Columns[15].ItemStyle.BackColor = System.Drawing.Color.Gray;
|
||
//grvListaDatosTemp.Columns[16].ItemStyle.BackColor = System.Drawing.Color.Blue;
|
||
grvListaDatosTemp.Columns[17].ItemStyle.HorizontalAlign = HorizontalAlign.Center;
|
||
|
||
cuwBusquedaList.LlenarCHKLBusqueda(grvListaDatosTemp);
|
||
|
||
ButtonField bfActividades = new ButtonField();
|
||
bfActividades.ButtonType = ButtonType.Image;
|
||
bfActividades.Text = "Seguimiento";
|
||
bfActividades.HeaderText = "Acciones";
|
||
|
||
bfActividades.ImageUrl = "~/Images/MiniBotones/Seguimiento.png";
|
||
bfActividades.CommandName = "seguimiento";
|
||
grvListaDatosTemp.Columns.Add(bfActividades);
|
||
|
||
}
|
||
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
|
||
{
|
||
//llenarGridView(true);
|
||
llenarGridViewPendientes(true, "10000");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
|
||
|
||
/// <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":
|
||
btnBuscar.Visible = true;
|
||
btnReutilizar.Visible = true;
|
||
break;
|
||
|
||
case "MODIFICA":
|
||
//Inicio de variable tipo VIEWSTATE
|
||
ViewState["PUEDEMODIFICAR"] = true;
|
||
btnProrroga.Visible = true;
|
||
btnRevision.Visible = true;
|
||
btnTraslado.Visible = true;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Limpia los campos
|
||
/// </summary>
|
||
private void limpiarCampos()
|
||
{
|
||
txtConsulta.Text = string.Empty;
|
||
|
||
ddlAnno.SelectedValue = "-1";
|
||
ddlMes.SelectedValue = "-1";
|
||
ddlTipoBusqueda.SelectedValue = "-1";
|
||
|
||
|
||
}
|
||
|
||
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
|
||
{
|
||
EjecutarScript("VentanaAbrirActividades();VentanaEmergenteAbrirObservaciones('frwObservacionesActividadesSolicitud.aspx');");
|
||
ViewState["POPUP"] = "VentanaEmergente";
|
||
}
|
||
|
||
}
|
||
|
||
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');");
|
||
ViewState["POPUP"] = "VentanaEmergente";
|
||
}
|
||
|
||
}
|
||
#endregion
|
||
|
||
#region Metodos Controles a Datos (R5)
|
||
private int AsignaActividadesUsuarios(int nActividad) //M0
|
||
{
|
||
ActividadesBL objActividadesBL = new ActividadesBL();
|
||
ArrayList arlCondicionesFiltroBusqueda = new ArrayList();
|
||
int nPkSolicitud = 0;
|
||
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();
|
||
|
||
|
||
|
||
solicitudBL 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.FKACTIVIDAD = nActividad;
|
||
objresponsableActividadBL.objresponsableActividadEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
if(nActividad == 1)
|
||
objresponsableActividadBL.objresponsableActividadEL.FKESTADO = 5;//asignada
|
||
else
|
||
objresponsableActividadBL.objresponsableActividadEL.FKESTADO = 1;//asignada
|
||
|
||
objresponsableActividadBL.objresponsableActividadEL.ASTATE = true;
|
||
|
||
if (Session["PKPROGRAMACION"].ToString() == " ") //se verifica que ya se haya asignado la actividad 1
|
||
{
|
||
programacionsolicitudBL objprogramacionsolicitudBL = new programacionsolicitudBL();
|
||
objprogramacionsolicitudBL.objprogramacionsolicitudEL.FKESTADOPROGRAMACION = 6;
|
||
objprogramacionsolicitudBL.objprogramacionsolicitudEL.FKSOLICITUD = int.Parse(Session["PKSOLICITUD"].ToString());
|
||
int nPKProgramacionSolicitud = objprogramacionsolicitudBL.insertarprogramacionsolicitud();
|
||
objresponsableActividadBL.objresponsableActividadEL.FKPROGRAMACIONSOLICITUD = nPKProgramacionSolicitud;
|
||
Session["PKPROGRAMACION"] = nPKProgramacionSolicitud;
|
||
}
|
||
else
|
||
{
|
||
objresponsableActividadBL.objresponsableActividadEL.FKPROGRAMACIONSOLICITUD = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
}
|
||
|
||
#region nuevo
|
||
if (strModo == "Nuevo")
|
||
{
|
||
|
||
solicitudBL objsolicitudBL = new solicitudBL();
|
||
|
||
objsolicitudBL.objSolicitudEL.FKSOLICITUD = int.Parse(Session["PKSOLICITUD"].ToString());
|
||
objsolicitudBL.objSolicitudEL.FKUSUARIOXDEPENDENCIA = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
objsolicitudBL.objSolicitudEL.FKACTIVIDAD = nActividad;
|
||
|
||
DataSet dsActividad = objsolicitudBL.dsListaActividadesEncargado(arlCondicionesFiltroBusqueda);
|
||
|
||
if (dsActividad.Tables[0].Rows.Count == 0)
|
||
{
|
||
nValorRetornado = objresponsableActividadBL.insertarAsignacionActividadEncargado();
|
||
|
||
if (nValorRetornado > 0)
|
||
{
|
||
|
||
#region Envio de correo
|
||
|
||
arlCondicionesFiltroBusqueda = new ArrayList();
|
||
// condicionesBusqueda();
|
||
objsolicitudBL = new solicitudBL();
|
||
|
||
objsolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
|
||
|
||
{
|
||
|
||
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
|
||
|
||
}
|
||
}
|
||
|
||
string strActividad = "Ingreso y asignación de expedientes";
|
||
|
||
|
||
if (nActividad == 5)
|
||
strActividad = "Confección del Criterio técnico de agua potable";
|
||
if (nActividad == 6)
|
||
strActividad = "Confección del Criterio técnico de alcantarillado sanitario";
|
||
if(nActividad == 7)
|
||
strActividad = "Confección de constancias";
|
||
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 = "Se le ha asignado la actividad de " + strActividad + " de la solicitud de disponibilidad " + Session["SOLICITUD"].ToString() + ", para ver mas detalles ingrese al sistema <a href=http://" + HttpContext.Current.Request.Url.Authority + "/Forms/wfrLogin> SIGDD</a>" + strPiePagina;
|
||
objcorreoBL.objcorreoEL.FKUSUARIO = int.Parse(Session["PKUSUARIOXDEPENDENCIA"].ToString());
|
||
objcorreoBL.objcorreoEL.Fecha = DateTime.Now;
|
||
|
||
nValorRetornado = objcorreoBL.insertarCorreo();
|
||
|
||
#endregion
|
||
}
|
||
GuardarEventoBitacora(
|
||
Session["LOGIN"].ToString(),
|
||
AccionBitacora.INSERT.ToString(),
|
||
MensajesBitacora.IngresarRegistro + ": Se ha finalizado la actividad Ingreso y asignación de expedientes",
|
||
"frwBusquedaSolicitud.aspx",
|
||
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
||
);
|
||
}
|
||
else
|
||
{
|
||
// MensajeAlerta("El usuario ya tiene asignada la actividad.");
|
||
}
|
||
}
|
||
#endregion
|
||
}
|
||
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
return nValorRetornado;
|
||
}
|
||
|
||
|
||
/// <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;
|
||
if (n_pActividad == 4)
|
||
imgFormularioAS.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;
|
||
}
|
||
}
|
||
|
||
/// <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;
|
||
//}
|
||
|
||
EjecutarScript("VentanaAbrirActividades();");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
|
||
|
||
#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)
|
||
{
|
||
condicionesBusqueda();
|
||
objSolicitudBL = new solicitudBL();
|
||
|
||
|
||
|
||
int nAccesoInformacion = 0;
|
||
|
||
if (Session["ACCESOINSORMACION"].ToString().Trim() != "0")
|
||
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();
|
||
}
|
||
if (Request["f"] != null)
|
||
{
|
||
if (Request["f"].ToString() != string.Empty)
|
||
{
|
||
CondicionDAL condicion = new CondicionDAL();
|
||
condicion.valorIzquierdo = "NUMEROFOLIO";
|
||
condicion.operadorGeneral = operadorGeneral.LIKE;
|
||
condicion.operadorLogico = operadorLogico.AND;
|
||
condicion.valorDerecho = Request["f"].ToString();
|
||
arlCondicionesFiltroBusqueda.Add(condicion);
|
||
}
|
||
}
|
||
//if (txtConsulta.Text != "" && ddlTipoBusqueda.SelectedValue != "-1")
|
||
//{
|
||
|
||
// if (ddlTipoBusqueda.SelectedValue == "9")
|
||
// objSolicitudBL.objSolicitudEL.NUMEROSOLICITUD = txtConsulta.Text;
|
||
|
||
// if (ddlTipoBusqueda.SelectedValue == "8")
|
||
// objSolicitudBL.objSolicitudEL.NUMEROTERRENO = txtConsulta.Text;
|
||
|
||
// if (ddlTipoBusqueda.SelectedValue == "7")
|
||
// objSolicitudBL.objSolicitudEL.NUMEROFOLIO = txtConsulta.Text;
|
||
|
||
// if (ddlTipoBusqueda.SelectedValue == "6")
|
||
// {
|
||
// objSolicitudBL.objSolicitudEL.Nombre = txtConsulta.Text;
|
||
// objSolicitudBL.objSolicitudEL.NOMPROPREGISTRAL = txtConsulta.Text;
|
||
// objSolicitudBL.objSolicitudEL.NOMBRESOLICITANTE = txtConsulta.Text;
|
||
// }
|
||
|
||
// if (ddlTipoBusqueda.SelectedValue == "5")
|
||
// {
|
||
// objSolicitudBL.objSolicitudEL.NUMCEDULAPROP = txtConsulta.Text;
|
||
// objSolicitudBL.objSolicitudEL.CEDULASOLICITANTE = txtConsulta.Text;
|
||
// }
|
||
|
||
// if (ddlTipoBusqueda.SelectedValue == "4")
|
||
// objSolicitudBL.objSolicitudEL.NUMERONIS = txtConsulta.Text;
|
||
|
||
// if (ddlTipoBusqueda.SelectedValue == "3")
|
||
// {
|
||
// objSolicitudBL.objSolicitudEL.TELEFONO = txtConsulta.Text;
|
||
// //objSolicitudBL.objSolicitudEL.CELULAR = txtConsulta.Text;
|
||
// objSolicitudBL.objSolicitudEL.FAX = txtConsulta.Text;
|
||
// }
|
||
|
||
// if (ddlTipoBusqueda.SelectedValue == "2")
|
||
// {
|
||
// objSolicitudBL.objSolicitudEL.PROVINCIA = txtConsulta.Text;
|
||
// objSolicitudBL.objSolicitudEL.CANTON = txtConsulta.Text;
|
||
// objSolicitudBL.objSolicitudEL.DISTRITO = txtConsulta.Text;
|
||
// }
|
||
|
||
|
||
// DataSet dsUsuarios = objSolicitudBL.dsListaSolicitud(arlCondicionesFiltroBusqueda);
|
||
// General.detalleGridView(dsUsuarios, grvListaDatosTemp, lblTotalDatos);
|
||
//}
|
||
|
||
//if (ddlAnno.SelectedValue != "-1")
|
||
//{
|
||
// if (ddlTipoBusqueda.SelectedValue == "1")
|
||
// objSolicitudBL.objSolicitudEL.AÑO = int.Parse(ddlAnno.SelectedValue);
|
||
|
||
// if (ddlMes.SelectedValue != "-1")
|
||
// {
|
||
// if (ddlTipoBusqueda.SelectedValue == "0")
|
||
// {
|
||
// objSolicitudBL.objSolicitudEL.AÑO = int.Parse(ddlAnno.SelectedValue);
|
||
// objSolicitudBL.objSolicitudEL.MES = int.Parse(ddlMes.SelectedValue);
|
||
// }
|
||
// }
|
||
// DataSet dsUsuarios = objSolicitudBL.dsListaSolicitud(arlCondicionesFiltroBusqueda);
|
||
// General.detalleGridView(dsUsuarios, grvListaDatosTemp, lblTotalDatos);
|
||
//}
|
||
|
||
//if (txtConsulta.Text == "" && ddlTipoBusqueda.SelectedValue == "-1")
|
||
//{
|
||
// condicionesBusqueda();
|
||
// objSolicitudBL = new solicitudBL();
|
||
|
||
// //objSolicitudBL.objSolicitudEL.TEMPORAL = true;
|
||
// {
|
||
// DataSet dsUsuarios = objSolicitudBL.dsListaSolicitud(arlCondicionesFiltroBusqueda);
|
||
// General.detalleGridView(dsUsuarios, grvListaDatosTemp, lblTotalDatos);
|
||
// }
|
||
//}
|
||
if (arlCondicionesFiltroBusqueda.Count > 0)
|
||
{
|
||
DataSet ds = objSolicitudBL.dsListaSolicitud(arlCondicionesFiltroBusqueda);
|
||
General.detalleGridView(ds, grvListaDatosTemp, lblTotalDatos);
|
||
}
|
||
else
|
||
{
|
||
MensajeAlerta("Debe agregar filtros para la busqueda");
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Llena el dropdownlist de tipo de consulta
|
||
/// </summary>
|
||
private void llenarDDLTipoBusqueda() //M1
|
||
{
|
||
try
|
||
{
|
||
|
||
|
||
ddlTipoBusqueda.Items.Insert(0, new ListItem("Año/ Mes", "0"));
|
||
ddlTipoBusqueda.Items.Insert(0, new ListItem("Año", "1"));
|
||
ddlTipoBusqueda.Items.Insert(0, new ListItem("Prov/ Cant/ Distrito", "2"));
|
||
ddlTipoBusqueda.Items.Insert(0, new ListItem("Teléfono", "3"));
|
||
ddlTipoBusqueda.Items.Insert(0, new ListItem("Nis", "4"));
|
||
ddlTipoBusqueda.Items.Insert(0, new ListItem("Cédula(Fisica / jurídica)", "5"));
|
||
ddlTipoBusqueda.Items.Insert(0, new ListItem("Propietario / solicitante", "6"));
|
||
ddlTipoBusqueda.Items.Insert(0, new ListItem("Folio real", "7"));
|
||
ddlTipoBusqueda.Items.Insert(0, new ListItem("Plano catastrado", "8"));
|
||
ddlTipoBusqueda.Items.Insert(0, new ListItem("Número de Solicitud", "9"));
|
||
ddlTipoBusqueda.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||
ddlTipoBusqueda.SelectedValue = "9";
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Llena el dropdownlist de grado academico según la aplicación
|
||
/// </summary>
|
||
private void llenarDDLAño() //M2
|
||
{
|
||
try
|
||
{
|
||
//Limpia el control
|
||
ddlAnno.Items.Clear();
|
||
//Instancia el bjeto
|
||
objSolicitudBL = new solicitudBL();
|
||
//Asigna datos al atributo
|
||
|
||
|
||
//Carga la información en un dataset
|
||
DataSet dsGradoAcademico = objSolicitudBL.dsListaAnnos(null);
|
||
if (dsGradoAcademico.Tables[0].Rows.Count != 0)
|
||
{
|
||
ddlAnno.DataSource = dsGradoAcademico;
|
||
ddlAnno.DataTextField = dsGradoAcademico.Tables[0].Columns["FECHAINSERTASOLICITUD"].ColumnName;
|
||
ddlAnno.DataValueField = dsGradoAcademico.Tables[0].Columns["FECHAINSERTASOLICITUD"].ColumnName;
|
||
ddlAnno.DataBind();
|
||
|
||
|
||
ddlAnno.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||
}
|
||
else
|
||
ddlAnno.Items.Insert(0, new ListItem("----- No existen opciones -----", "-1"));
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
/// <summary>
|
||
/// Llena el dropdownlist de tipo de consulta
|
||
/// </summary>
|
||
private void llenarDDLMes() //M1
|
||
{
|
||
try
|
||
{
|
||
ddlMes.Items.Clear();
|
||
ddlMes.Items.Insert(0, new ListItem("Diciembre", "12"));
|
||
ddlMes.Items.Insert(0, new ListItem("Noviembre", "11"));
|
||
ddlMes.Items.Insert(0, new ListItem("Octubre", "10"));
|
||
ddlMes.Items.Insert(0, new ListItem("Setiembre", "9"));
|
||
ddlMes.Items.Insert(0, new ListItem("Agosto", "8"));
|
||
ddlMes.Items.Insert(0, new ListItem("Julio", "7"));
|
||
ddlMes.Items.Insert(0, new ListItem("Junio", "6"));
|
||
ddlMes.Items.Insert(0, new ListItem("Mayo", "5"));
|
||
ddlMes.Items.Insert(0, new ListItem("Abril", "4"));
|
||
ddlMes.Items.Insert(0, new ListItem("Marzo", "3"));
|
||
ddlMes.Items.Insert(0, new ListItem("Febrero", "2"));
|
||
ddlMes.Items.Insert(0, new ListItem("Enero", "1"));
|
||
ddlMes.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Carga el grid principal
|
||
/// </summary>
|
||
/// <param name="p_Llenar"></param>
|
||
private void llenarGridViewPendientes(bool p_Llenar,string strTop) //M0
|
||
{
|
||
try
|
||
{
|
||
if (!IsPostBack || p_Llenar)
|
||
{
|
||
condicionesBusqueda();
|
||
objSolicitudBL = new solicitudBL();
|
||
int nAccesoInformacion = 0;
|
||
|
||
if (Session["ACCESOINSORMACION"].ToString().Trim() != "0")
|
||
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();
|
||
}
|
||
if (Request["f"] != null)
|
||
{
|
||
if (Request["f"].ToString() != string.Empty)
|
||
{
|
||
CondicionDAL condicion = new CondicionDAL();
|
||
condicion.valorIzquierdo = "NUMEROFOLIO";
|
||
condicion.operadorGeneral = operadorGeneral.LIKE;
|
||
condicion.operadorLogico = operadorLogico.AND;
|
||
condicion.valorDerecho = Request["f"].ToString();
|
||
arlCondicionesFiltroBusqueda.Add(condicion);
|
||
}
|
||
}
|
||
//objSolicitudBL.objSolicitudEL.TEMPORAL = true;
|
||
{
|
||
DataSet dsUsuarios = objSolicitudBL.dsListaSolicitudGrid(arlCondicionesFiltroBusqueda, strTop);
|
||
General.detalleGridView(dsUsuarios, grvListaDatosTemp, lblTotalDatos);
|
||
}
|
||
}
|
||
}
|
||
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;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
|
||
protected void ddlTipoBusqueda_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
ddlAnno.SelectedValue = "-1";
|
||
ddlMes.SelectedValue = "-1";
|
||
txtConsulta.Text = "";
|
||
if (ddlTipoBusqueda.SelectedValue == "0") //año/mes
|
||
{
|
||
lblBuscar.Visible = false;
|
||
txtConsulta.Visible = false;
|
||
ddlAnno.Visible = true;
|
||
ddlMes.Visible = true;
|
||
}
|
||
else
|
||
{
|
||
if (ddlTipoBusqueda.SelectedValue == "1") //año
|
||
{
|
||
lblBuscar.Visible = false;
|
||
txtConsulta.Visible = false;
|
||
ddlAnno.Visible = true;
|
||
ddlMes.Visible = false;
|
||
}
|
||
else //año/mes
|
||
{
|
||
lblBuscar.Visible = true;
|
||
txtConsulta.Visible = true;
|
||
ddlAnno.Visible = false;
|
||
ddlMes.Visible = false;
|
||
}
|
||
}
|
||
|
||
//grvListaDatosTemp = (GridView)tdLista.FindControl("grvListaDatos");
|
||
|
||
|
||
// grvListaDatosTemp.Columns[4].Visible = true;
|
||
|
||
// grvListaDatosTemp.Columns[5].Visible = true;
|
||
|
||
// grvListaDatosTemp.Columns[6].Visible = true;
|
||
|
||
// grvListaDatosTemp.Columns[7].Visible = true;
|
||
|
||
//if (ddlTipoBusqueda.SelectedValue == "2")
|
||
// grvListaDatosTemp.Columns[4].Visible = true;
|
||
//if (ddlTipoBusqueda.SelectedValue == "8")
|
||
// grvListaDatosTemp.Columns[5].Visible = true;
|
||
//if (ddlTipoBusqueda.SelectedValue == "7")
|
||
// grvListaDatosTemp.Columns[6].Visible = true;
|
||
//if (ddlTipoBusqueda.SelectedValue == "5")
|
||
// grvListaDatosTemp.Columns[7].Visible = true;
|
||
}
|
||
|
||
|
||
protected void grvListaDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||
{
|
||
try
|
||
{
|
||
GridViewRow selectedRow = e.Row;
|
||
e.Row.Cells[18].ToolTip = "Seguimiento de Disponibilidades";
|
||
e.Row.Cells[1].ToolTip = "Solicitud de disponibilidad";
|
||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||
{
|
||
// 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.Yellow;
|
||
}
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Se produjo un error al realizar la consulta.", ex);
|
||
}
|
||
}
|
||
} |