1033 lines
40 KiB
C#
1033 lines
40 KiB
C#
|
|
/*===========================================================================================================================
|
|||
|
|
* Instituto Costarricense de Acueductos y Alcantarillados. - 2015
|
|||
|
|
* Administración de la Seguridad
|
|||
|
|
* Nombre de la Pantalla: frwUsuario.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;
|
|||
|
|
using AyABL.Tran;
|
|||
|
|
using AyABL.APL;
|
|||
|
|
using AyABL.Tran;
|
|||
|
|
using AyABL.Usuario;
|
|||
|
|
using System.IO;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
public partial class Forms_Requisitos_frwRequisitos : 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);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
MensajeError("Error en R0M1", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Variables (R1)
|
|||
|
|
|
|||
|
|
GridView grvListaDatosCantonalesTemp;
|
|||
|
|
|
|||
|
|
requisitoBL objRequisitoBL;
|
|||
|
|
UsuarioBL objUsuarioBL;
|
|||
|
|
|
|||
|
|
|
|||
|
|
ArrayList arlCondicionesFiltroBusqueda = new ArrayList();
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Eventos Formulario (R2)
|
|||
|
|
|
|||
|
|
protected void Page_Load(object sender, EventArgs e) //M0
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if ((!IsPostBack) && (Session.Count > 0))
|
|||
|
|
{
|
|||
|
|
llenarGridView(true);
|
|||
|
|
mostrarFilaTabla(1);
|
|||
|
|
llenarDDLtipoInspeccion();
|
|||
|
|
llenarTipoProyecto();
|
|||
|
|
ComandosxMenu();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
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 grvListaDatosRequisitos_RowCommand(object sender, GridViewCommandEventArgs e) //M0
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (e.CommandName == "editar")
|
|||
|
|
{
|
|||
|
|
int i = Convert.ToInt32(e.CommandArgument);
|
|||
|
|
GridViewRow selectedRow = grvListaDatosRequisitos.Rows[i];
|
|||
|
|
int intPkRequisito = Convert.ToInt32(selectedRow.Cells[2].Text);
|
|||
|
|
ViewState["PkRequisito"] = intPkRequisito;
|
|||
|
|
ViewState["MODO"] = "Modifica";
|
|||
|
|
|
|||
|
|
mostrarFilaTabla(2);
|
|||
|
|
|
|||
|
|
mostrarDatos(intPkRequisito);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
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 grvListaDatosRequisitos_PageIndexChanging(object sender, GridViewPageEventArgs e) //M3
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
grvListaDatosRequisitos.PageIndex = e.NewPageIndex;
|
|||
|
|
llenarGridView(true);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
MensajeError("Error en R3M3", 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) //M4
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
llenarGridView(true);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
MensajeError("Error en R3M4" + 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) //M7
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
llenarGridView(true);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
MensajeError("Error en R3M7" + MensajesAplicacion.UsuarioInexistente.ToString(), ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Activa el evento del boton Nuevo
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
|
|||
|
|
protected void btnNuevo_Click(object sender, EventArgs e) //M8
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
llenarTipoProyecto();
|
|||
|
|
ViewState["MODO"] = "Nuevo";
|
|||
|
|
mostrarFilaTabla(2);
|
|||
|
|
//Limpia el grid de Active Directory
|
|||
|
|
|
|||
|
|
txtDescripcion.Focus();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
MensajeError("Error en R3M8" + MensajesAplicacion.GuardadoFallido.ToString(), ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Metodo que activa el botón de Eliminar
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
|
|||
|
|
protected void btnActivar_Click(object sender, EventArgs e) //M9
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
foreach (GridViewRow row in grvListaDatosRequisitos.Rows)
|
|||
|
|
{
|
|||
|
|
HtmlInputCheckBox chkTemp = (HtmlInputCheckBox)row.Controls[0].Controls[1];
|
|||
|
|
if (chkTemp != null)
|
|||
|
|
{
|
|||
|
|
// si el registro esta marcado
|
|||
|
|
if (chkTemp.Checked)
|
|||
|
|
{
|
|||
|
|
int intPkEliminar = Convert.ToInt32(row.Cells[2].Text);
|
|||
|
|
ActivarDesactivar(intPkEliminar);
|
|||
|
|
MensajeInformativo(AyABL.BASESDEDATOS.ADS + "Interfaz: " + MensajesAplicacion.GuardadoExitoso.ToString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
llenarGridView(true);
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
MensajeError("Error en R3M9", ex);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
///<summary>
|
|||
|
|
///Activa el metodo del boton Anterior, regresa a la primera fila de la tabla
|
|||
|
|
///</summary>
|
|||
|
|
///<param name="sender"></param>
|
|||
|
|
///<param name="e"></param>
|
|||
|
|
|
|||
|
|
protected void btnAnterior_Click(object sender, EventArgs e) //M12
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
txtDescripcion.Text = "";
|
|||
|
|
txtDocSoporte.Text = "";
|
|||
|
|
chkProrroga.Checked = false;
|
|||
|
|
chkRevision.Checked = false;
|
|||
|
|
|
|||
|
|
chkApcr.Checked = false;
|
|||
|
|
chkPoseedor.Checked = false;
|
|||
|
|
chkSegregacion.Checked = false;
|
|||
|
|
chkDerechos.Checked = false;
|
|||
|
|
chkAutorizadoLegal.Checked = false;
|
|||
|
|
chkPropietarioRegistral.Checked = false;
|
|||
|
|
chkConcesionario.Checked = false;
|
|||
|
|
llenarGridView(true);
|
|||
|
|
divDatosSuperiores.Visible = true;
|
|||
|
|
divDatosMedios.Visible = false;
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
MensajeError("Error en R3M12", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Activa el evento del boton guardar.1
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
|
|||
|
|
protected void btnGuardar_Click(object sender, EventArgs e) //M14
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (txtDescripcion.Text != "" && txtDocSoporte.Text != "" && ddlTipoInspeccion.SelectedValue != "-1")
|
|||
|
|
{
|
|||
|
|
int pkRegistro = GuardarDatos();
|
|||
|
|
llenarGridView(true);
|
|||
|
|
mostrarFilaTabla(1);
|
|||
|
|
|
|||
|
|
MensajeInformativo(AyABL.BASESDEDATOS.ADS + "Interfaz: " + MensajesAplicacion.GuardadoExitoso.ToString());
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//MensajeAlerta(AyABL.BASESDEDATOS.ADS + "Interfaz: " + MensajesAplicacion.GuardadoFallido.ToString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
MensajeError("Error en R3M14", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
protected void chklTipoProyecto_SelectedIndexChanged(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
CheckBoxList list = (CheckBoxList)sender;
|
|||
|
|
string[] control = Request.Form.Get("__EVENTTARGET").Split('$');
|
|||
|
|
int index = control.Length - 1;
|
|||
|
|
ListItem li = (ListItem)list.Items[Int32.Parse(control[index])];
|
|||
|
|
|
|||
|
|
if (li.ToString().Equals("Todos")) //If it was the "Select All" Item which triggered the event
|
|||
|
|
{
|
|||
|
|
//If it was checked, check off everything. If it was unchecked, uncheck everything.
|
|||
|
|
for (int i = 0; i < chklTipoProyecto.Items.Count; i++)
|
|||
|
|
{
|
|||
|
|
chklTipoProyecto.Items[i].Selected = chklTipoProyecto.Items.FindByText("Todos").Selected;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private void llenarDDLtipoInspeccion(bool p)
|
|||
|
|
{
|
|||
|
|
throw new NotImplementedException();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
#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 = false;
|
|||
|
|
divDatosMedios.Visible = false;
|
|||
|
|
|
|||
|
|
|
|||
|
|
switch (p_intFila)
|
|||
|
|
{
|
|||
|
|
case 1:
|
|||
|
|
llenarGridView(true);
|
|||
|
|
divDatosSuperiores.Visible = true;
|
|||
|
|
break;
|
|||
|
|
case 2:
|
|||
|
|
llenarGridView(true);
|
|||
|
|
divDatosMedios.Visible = true;
|
|||
|
|
break;
|
|||
|
|
case 3:
|
|||
|
|
llenarGridView(true);
|
|||
|
|
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
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
|
|||
|
|
{
|
|||
|
|
grvListaDatosCantonalesTemp = (GridView)tdLista.FindControl("grvListaDatosRequisitos");
|
|||
|
|
|
|||
|
|
GridViewBoundField bdfPkRequisito = new GridViewBoundField("PKREQUISITO", "PK", true, false, true );
|
|||
|
|
GridViewBoundField bdfDescripcion = new GridViewBoundField("DESCRIPCIONREQUISITO", "Requisito", true, false, true);
|
|||
|
|
GridViewBoundField bdfDocSoporte = new GridViewBoundField("DOCSOPORTEREQUISITO", "Documento soporte", true, false, true);
|
|||
|
|
GridViewBoundField bdfTipoInspeccion = new GridViewBoundField("DESCRIPCIONTIPOINSPECCION", "Tipo disponibilidad", true, false, true);
|
|||
|
|
GridViewBoundField bdfFecha = new GridViewBoundField("FECHACREAREQUISITO", "Fecha", true, true, true);
|
|||
|
|
GridViewBoundField bdfUsuario = new GridViewBoundField("USUARIOCREAREQUISITO", "Usuario", true, false, true);
|
|||
|
|
GridViewBoundField bdfActivo = new GridViewBoundField("ASTATEREQUISITO", "Activo", true, "Si", "No", true);
|
|||
|
|
|
|||
|
|
grvListaDatosCantonalesTemp.Columns.Add(bdfPkRequisito);
|
|||
|
|
grvListaDatosCantonalesTemp.Columns.Add(bdfDescripcion);
|
|||
|
|
grvListaDatosCantonalesTemp.Columns.Add(bdfDocSoporte);
|
|||
|
|
grvListaDatosCantonalesTemp.Columns.Add(bdfTipoInspeccion);
|
|||
|
|
grvListaDatosCantonalesTemp.Columns.Add(bdfFecha);
|
|||
|
|
grvListaDatosCantonalesTemp.Columns.Add(bdfUsuario);
|
|||
|
|
grvListaDatosCantonalesTemp.Columns.Add(bdfActivo);
|
|||
|
|
|
|||
|
|
grvListaDatosCantonalesTemp.Columns[0].ItemStyle.Width = 25;
|
|||
|
|
grvListaDatosCantonalesTemp.Columns[1].ItemStyle.Width = 25;
|
|||
|
|
grvListaDatosCantonalesTemp.Columns[2].ItemStyle.Width = 25;
|
|||
|
|
//grvListaDatosCantonalesTemp.Columns[2].ItemStyle.Width = 500;
|
|||
|
|
//grvListaDatosCantonalesTemp.Columns[3].ItemStyle.Width = 425;
|
|||
|
|
//grvListaDatosCantonalesTemp.Columns[4].ItemStyle.Width = 25;
|
|||
|
|
|
|||
|
|
|
|||
|
|
cuwBusquedaList.LlenarCHKLBusqueda(grvListaDatosCantonalesTemp);
|
|||
|
|
}
|
|||
|
|
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.BITACORA, 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.BITACORA, 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() //M4
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
llenarGridView(true);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
throw ex;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Metodo que se utiliza para el despliegue de los botones
|
|||
|
|
/// </summary>
|
|||
|
|
private void ComandosxMenu() //M6
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
DataSet dsComandos = getComandos();
|
|||
|
|
|
|||
|
|
if (dsComandos != null)
|
|||
|
|
{
|
|||
|
|
foreach (DataRow drTemp in dsComandos.Tables[0].Rows)
|
|||
|
|
{
|
|||
|
|
switch (drTemp["NOMBRECOMANDO"].ToString().ToUpper())
|
|||
|
|
{
|
|||
|
|
case "NUEVO":
|
|||
|
|
btnNuevo.Visible = true;
|
|||
|
|
btnGuardar.Visible = true;
|
|||
|
|
|
|||
|
|
break;
|
|||
|
|
|
|||
|
|
case "MODIFICA":
|
|||
|
|
//Inicio de variable tipo VIEWSTATE
|
|||
|
|
ViewState["PUEDEMODIFICAR"] = true;
|
|||
|
|
btnGuardar.Visible = true;
|
|||
|
|
btnActivar.Visible = true;
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
throw ex;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Limpia los campos
|
|||
|
|
/// </summary>
|
|||
|
|
private void limpiarCampos()
|
|||
|
|
{
|
|||
|
|
txtDescripcion.Text = string.Empty;
|
|||
|
|
txtDocSoporte.Text = string.Empty;
|
|||
|
|
chkProrroga.Checked = false;
|
|||
|
|
chkRevision.Checked = false;
|
|||
|
|
chkApcr.Checked = false;
|
|||
|
|
chkPoseedor.Checked = false;
|
|||
|
|
chkSegregacion.Checked = false;
|
|||
|
|
chkDerechos.Checked = false;
|
|||
|
|
chkAutorizadoLegal.Checked = false;
|
|||
|
|
chkPropietarioRegistral.Checked = false;
|
|||
|
|
chkConcesionario.Checked = false;
|
|||
|
|
chklTipoProyecto.Items.Clear();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Metodos Controles a Datos (R5)
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// guarda y modifica registros en la tabla.
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
private int GuardarDatos() //M0
|
|||
|
|
{
|
|||
|
|
int nValorRetornado = 0;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
string strModo = ViewState["MODO"].ToString();
|
|||
|
|
|
|||
|
|
objRequisitoBL = new requisitoBL();
|
|||
|
|
objRequisitoBL.objrequisitoEL.DESCRIPCION = txtDescripcion.Text;
|
|||
|
|
objRequisitoBL.objrequisitoEL.PRORROGA =chkProrroga.Checked;
|
|||
|
|
objRequisitoBL.objrequisitoEL.REVISION =chkRevision.Checked;
|
|||
|
|
|
|||
|
|
objRequisitoBL.objrequisitoEL.POSEEDOR = chkPoseedor.Checked;
|
|||
|
|
objRequisitoBL.objrequisitoEL.SEGREGACION = chkSegregacion.Checked;
|
|||
|
|
objRequisitoBL.objrequisitoEL.DERECHOS = chkDerechos.Checked;
|
|||
|
|
objRequisitoBL.objrequisitoEL.AUTORIZADOLEGAL = chkAutorizadoLegal.Checked;
|
|||
|
|
objRequisitoBL.objrequisitoEL.PROPIETARIOREGISTRAL = chkPropietarioRegistral.Checked;
|
|||
|
|
objRequisitoBL.objrequisitoEL.CONCESIONARIO = chkConcesionario.Checked;
|
|||
|
|
objRequisitoBL.objrequisitoEL.FKNATURALEZAINMUEBLE = Int32.Parse(rblNaturalezaInmueble.SelectedValue);
|
|||
|
|
objRequisitoBL.objrequisitoEL.APCR = chkApcr.Checked;
|
|||
|
|
|
|||
|
|
|
|||
|
|
objRequisitoBL.objrequisitoEL.Activo = true;
|
|||
|
|
objRequisitoBL.objrequisitoEL.DOCSOPORTE = txtDocSoporte.Text;
|
|||
|
|
objRequisitoBL.objrequisitoEL.Fecha = DateTime.Now;
|
|||
|
|
objRequisitoBL.objrequisitoEL.USUARIOCREA = Session["LOGIN"].ToString();
|
|||
|
|
objRequisitoBL.objrequisitoEL.FKTIPOINSPECCION = Int32.Parse(ddlTipoInspeccion.SelectedValue);
|
|||
|
|
objRequisitoBL.objrequisitoEL.FKTIPOPROPIETARIO = Int32.Parse(ddlTipoCliente.SelectedValue);
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (strModo == "Nuevo")
|
|||
|
|
{
|
|||
|
|
nValorRetornado = objRequisitoBL.insertarRequisito();
|
|||
|
|
if (nValorRetornado != 0)
|
|||
|
|
{
|
|||
|
|
bool bGuardarRequisitoProyecto = GuardarRequisitoProyecto(nValorRetornado);
|
|||
|
|
}
|
|||
|
|
limpiarCampos();
|
|||
|
|
GuardarEventoBitacora(
|
|||
|
|
Session["LOGIN"].ToString(),
|
|||
|
|
AccionBitacora.INSERT.ToString(),
|
|||
|
|
MensajesBitacora.IngresarRegistro + ": Se ha ingresado el requisito " + txtDescripcion.Text.Trim(),
|
|||
|
|
Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath),
|
|||
|
|
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else if (strModo == "Modifica" && bool.Parse(ViewState["PUEDEMODIFICAR"].ToString()) == true)
|
|||
|
|
{
|
|||
|
|
objRequisitoBL.objrequisitoEL.PK = Convert.ToInt32(ViewState["PkRequisito"]);
|
|||
|
|
nValorRetornado = objRequisitoBL.modificarRequisito();
|
|||
|
|
bool bGuardarRequisitoProyecto = ModificarRequisitoProyecto(Convert.ToInt32(ViewState["PkRequisito"]));
|
|||
|
|
limpiarCampos();
|
|||
|
|
GuardarEventoBitacora(
|
|||
|
|
Session["LOGIN"].ToString(),
|
|||
|
|
AccionBitacora.UPDATE.ToString(),
|
|||
|
|
MensajesBitacora.IngresarRegistro + ": Se ha modificado el requisito " + txtDescripcion.Text.Trim(),
|
|||
|
|
Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath),
|
|||
|
|
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
throw ex;
|
|||
|
|
}
|
|||
|
|
return nValorRetornado;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// guarda y modifica registros en la tabla.
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public bool GuardarRequisitoProyecto(int nFKRequisito)
|
|||
|
|
{
|
|||
|
|
bool bResultado = false;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
objRequisitoBL = new requisitoBL();
|
|||
|
|
objRequisitoBL.objrequisitoProyectoEL.FKREQUISITO = nFKRequisito;
|
|||
|
|
|
|||
|
|
foreach (ListItem lista in chklTipoProyecto.Items)
|
|||
|
|
{
|
|||
|
|
objRequisitoBL.objrequisitoProyectoEL.FKPROYECTO = Convert.ToInt32(lista.Value);
|
|||
|
|
objRequisitoBL.objrequisitoProyectoEL.ASTATE = lista.Selected;
|
|||
|
|
int nPkRequisitoProyecto = objRequisitoBL.insertarRequisitoProyecto();
|
|||
|
|
bResultado = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
bResultado = false;
|
|||
|
|
throw ex;
|
|||
|
|
}
|
|||
|
|
return bResultado;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// guarda y modifica registros en la tabla.
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public bool ModificarRequisitoProyecto(int nFKRequisito)
|
|||
|
|
{
|
|||
|
|
bool bResultado = false;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
objRequisitoBL = new requisitoBL();
|
|||
|
|
objRequisitoBL.objrequisitoProyectoEL.FKREQUISITO = nFKRequisito;
|
|||
|
|
|
|||
|
|
proyectoBL objProyectoBL;
|
|||
|
|
objProyectoBL = new proyectoBL();
|
|||
|
|
//Asigna datos al atributo
|
|||
|
|
|
|||
|
|
|
|||
|
|
//Carga la información en un dataset
|
|||
|
|
//modifica los datos de los proyectos enlazado al requisito
|
|||
|
|
foreach (ListItem lista in chklTipoProyecto.Items)
|
|||
|
|
{
|
|||
|
|
int nPkRequisitoProyecto = 0;
|
|||
|
|
objRequisitoBL = new requisitoBL();
|
|||
|
|
objRequisitoBL.objrequisitoProyectoEL.FKREQUISITO = nFKRequisito;
|
|||
|
|
objRequisitoBL.objrequisitoProyectoEL.FKPROYECTO = Convert.ToInt32(lista.Value);
|
|||
|
|
objRequisitoBL.objrequisitoProyectoEL.ASTATE = lista.Selected;
|
|||
|
|
nPkRequisitoProyecto = objRequisitoBL.modificarRequisitoProyecto();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
//guarda los proyectos que no han sido enlazados al requisito
|
|||
|
|
DataSet dsProyectos = objProyectoBL.dsListaProyectos(null);
|
|||
|
|
foreach (DataRow row in dsProyectos.Tables[0].Rows)
|
|||
|
|
{
|
|||
|
|
int nPkRequisitoProyecto = 0;
|
|||
|
|
objRequisitoBL = new requisitoBL();
|
|||
|
|
objRequisitoBL.objrequisitoProyectoEL.FKREQUISITO = nFKRequisito;
|
|||
|
|
objRequisitoBL.objrequisitoProyectoEL.FKPROYECTO = Convert.ToInt32(row["PKPROYECTO"].ToString());
|
|||
|
|
objRequisitoBL.objrequisitoProyectoEL.ASTATE = false;
|
|||
|
|
////se verifica si existen registros de requisitos enlazados a los proyectos
|
|||
|
|
DataSet ds = objRequisitoBL.listarRequisitosProyecto(null, false);
|
|||
|
|
if (ds.Tables[0].Rows.Count == 0) //si no existe el proyecto asociado al requisito se inserta nuevo
|
|||
|
|
nPkRequisitoProyecto = objRequisitoBL.insertarRequisitoProyecto();
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
bResultado = true;
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
bResultado = false;
|
|||
|
|
throw ex;
|
|||
|
|
}
|
|||
|
|
return bResultado;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Activa o desactiva el usuario
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
|
|||
|
|
private bool ActivarDesactivar(int p_intPkEliminar) //M2
|
|||
|
|
{
|
|||
|
|
bool blnValorRetornado = false;
|
|||
|
|
bool blnActivo = false;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
objRequisitoBL = new requisitoBL();
|
|||
|
|
objRequisitoBL.objrequisitoEL.PK = p_intPkEliminar;
|
|||
|
|
DataSet dsRequisitosDS = objRequisitoBL.listarRequisitos(null, false, null);
|
|||
|
|
|
|||
|
|
//Verifica que el usuario se encuentre en la BD
|
|||
|
|
if (dsRequisitosDS.Tables[0].Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
//Si esta activado que lo desactive
|
|||
|
|
if (Convert.ToBoolean(dsRequisitosDS.Tables[0].Rows[0][Concepto.ASTATE.ToString() + Tablas.requisito.ToString()]))
|
|||
|
|
blnActivo = false;
|
|||
|
|
//Si esta desactivado que lo active
|
|||
|
|
else
|
|||
|
|
blnActivo = true;
|
|||
|
|
|
|||
|
|
objRequisitoBL.objrequisitoEL.Activo = blnActivo;
|
|||
|
|
objRequisitoBL.objrequisitoEL.DESCRIPCION = dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.DESCRIPCION.ToString() + Tablas.requisito.ToString()].ToString();
|
|||
|
|
objRequisitoBL.objrequisitoEL.DOCSOPORTE = dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.DOCSOPORTE.ToString() + Tablas.requisito.ToString()].ToString();
|
|||
|
|
objRequisitoBL.objrequisitoEL.Fecha = Convert.ToDateTime(dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.FECHACREA.ToString() + Tablas.requisito.ToString()]);
|
|||
|
|
objRequisitoBL.objrequisitoEL.USUARIOCREA = dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.USUARIOCREA.ToString() + Tablas.requisito.ToString()].ToString();
|
|||
|
|
objRequisitoBL.objrequisitoEL.FKTIPOINSPECCION = (int)dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.FKTIPOINSPECCION.ToString()];
|
|||
|
|
|
|||
|
|
objRequisitoBL.objrequisitoEL.PRORROGA = bool.Parse(dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.PRORROGA.ToString() + Tablas.requisito.ToString()].ToString());
|
|||
|
|
objRequisitoBL.objrequisitoEL.REVISION = bool.Parse(dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.REVISION.ToString() + Tablas.requisito.ToString()].ToString());
|
|||
|
|
objRequisitoBL.objrequisitoEL.POSEEDOR = bool.Parse(dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.POSEEDOR.ToString() + Tablas.requisito.ToString()].ToString());
|
|||
|
|
objRequisitoBL.objrequisitoEL.SEGREGACION = bool.Parse(dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.SEGREGACION.ToString() + Tablas.requisito.ToString()].ToString());
|
|||
|
|
objRequisitoBL.objrequisitoEL.DERECHOS = bool.Parse(dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.DERECHOS.ToString() + Tablas.requisito.ToString()].ToString());
|
|||
|
|
objRequisitoBL.objrequisitoEL.AUTORIZADOLEGAL = bool.Parse(dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.AUTORIZADOLEGAL.ToString() + Tablas.requisito.ToString()].ToString());
|
|||
|
|
objRequisitoBL.objrequisitoEL.PROPIETARIOREGISTRAL = bool.Parse(dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.PROPIETARIOREGISTRAL.ToString() + Tablas.requisito.ToString()].ToString());
|
|||
|
|
objRequisitoBL.objrequisitoEL.CONCESIONARIO = bool.Parse(dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.CONCESIONARIO.ToString() + Tablas.requisito.ToString()].ToString());
|
|||
|
|
objRequisitoBL.objrequisitoEL.APCR = bool.Parse(dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.APCR.ToString() + Tablas.requisito.ToString()].ToString());
|
|||
|
|
objRequisitoBL.objrequisitoEL.FKNATURALEZAINMUEBLE = int.Parse(dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.FKNATURALEZAINMUEBLE.ToString()].ToString()) ;
|
|||
|
|
objRequisitoBL.objrequisitoEL.FKTIPOPROPIETARIO = int.Parse(dsRequisitosDS.Tables[0].Rows[0][t_adm_requisito.FKTIPOPROPIETARIO.ToString()].ToString());
|
|||
|
|
|
|||
|
|
|
|||
|
|
objRequisitoBL.modificarRequisito();
|
|||
|
|
}
|
|||
|
|
GuardarEventoBitacora(
|
|||
|
|
Session["LOGIN"].ToString(),
|
|||
|
|
AccionBitacora.INSERT.ToString(),
|
|||
|
|
MensajesBitacora.ModificarRegistro + ": Se ha puesto el registro de la PK=" + p_intPkEliminar + " en " + blnActivo,
|
|||
|
|
Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath),
|
|||
|
|
Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
throw ex;
|
|||
|
|
}
|
|||
|
|
return blnValorRetornado;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
#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();
|
|||
|
|
objRequisitoBL = new requisitoBL();
|
|||
|
|
condicionesBusqueda();
|
|||
|
|
|
|||
|
|
|
|||
|
|
DataSet dsRequisitos = objRequisitoBL.dsListaRequisito(arlCondicionesFiltroBusqueda);
|
|||
|
|
General.detalleGridView(dsRequisitos, grvListaDatosCantonalesTemp, lblTotalDatos);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
throw ex;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Muestra los datos del registro
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="p_intPkConsultar"></param>
|
|||
|
|
private void mostrarDatos(int p_intPkConsultar) //M1
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
|
|||
|
|
objRequisitoBL = new requisitoBL();
|
|||
|
|
objRequisitoBL.objrequisitoEL.PK = p_intPkConsultar;
|
|||
|
|
DataSet dsRequisito = objRequisitoBL.dsListaRequisito(null);
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (dsRequisito.Tables[0].Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
//Información de la cantonal
|
|||
|
|
|
|||
|
|
txtDescripcion.Text = dsRequisito.Tables[0].Rows[0]["DESCRIPCIONREQUISITO"].ToString();
|
|||
|
|
txtDocSoporte.Text = dsRequisito.Tables[0].Rows[0]["DOCSOPORTEREQUISITO"].ToString();
|
|||
|
|
ddlTipoInspeccion.SelectedValue = dsRequisito.Tables[0].Rows[0]["PKTIPOINSPECCION"].ToString();
|
|||
|
|
ddlTipoCliente.SelectedValue = dsRequisito.Tables[0].Rows[0]["FKTIPOPROPIETARIO"].ToString();
|
|||
|
|
chkProrroga.Checked = bool.Parse(dsRequisito.Tables[0].Rows[0]["PRORROGAREQUISITO"].ToString());
|
|||
|
|
chkRevision.Checked = bool.Parse(dsRequisito.Tables[0].Rows[0]["REVISIONREQUISITO"].ToString());
|
|||
|
|
|
|||
|
|
if (dsRequisito.Tables[0].Rows[0]["APCRREQUISITO"].ToString() != string.Empty)
|
|||
|
|
chkApcr.Checked = bool.Parse(dsRequisito.Tables[0].Rows[0]["APCRREQUISITO"].ToString());
|
|||
|
|
if (dsRequisito.Tables[0].Rows[0]["POSEEDORREQUISITO"].ToString() != string.Empty)
|
|||
|
|
chkPoseedor.Checked = bool.Parse(dsRequisito.Tables[0].Rows[0]["POSEEDORREQUISITO"].ToString());
|
|||
|
|
if (dsRequisito.Tables[0].Rows[0]["SEGREGACIONREQUISITO"].ToString() != string.Empty)
|
|||
|
|
chkSegregacion.Checked = bool.Parse(dsRequisito.Tables[0].Rows[0]["SEGREGACIONREQUISITO"].ToString());
|
|||
|
|
if (dsRequisito.Tables[0].Rows[0]["DERECHOSREQUISITO"].ToString() != string.Empty)
|
|||
|
|
chkDerechos.Checked = bool.Parse(dsRequisito.Tables[0].Rows[0]["DERECHOSREQUISITO"].ToString());
|
|||
|
|
if (dsRequisito.Tables[0].Rows[0]["AUTORIZADOLEGALREQUISITO"].ToString() != string.Empty)
|
|||
|
|
chkAutorizadoLegal.Checked = bool.Parse(dsRequisito.Tables[0].Rows[0]["AUTORIZADOLEGALREQUISITO"].ToString());
|
|||
|
|
|
|||
|
|
if (dsRequisito.Tables[0].Rows[0]["PROPIETARIOREGISTRALREQUISITO"].ToString() != string.Empty)
|
|||
|
|
chkPropietarioRegistral.Checked = bool.Parse(dsRequisito.Tables[0].Rows[0]["PROPIETARIOREGISTRALREQUISITO"].ToString());
|
|||
|
|
if (dsRequisito.Tables[0].Rows[0]["CONCESIONARIOREQUISITO"].ToString() != string.Empty)
|
|||
|
|
chkConcesionario.Checked = bool.Parse(dsRequisito.Tables[0].Rows[0]["CONCESIONARIOREQUISITO"].ToString());
|
|||
|
|
|
|||
|
|
rblNaturalezaInmueble.SelectedValue = dsRequisito.Tables[0].Rows[0]["FKNATURALEZAINMUEBLE"].ToString();
|
|||
|
|
|
|||
|
|
objRequisitoBL.objrequisitoProyectoEL.FKREQUISITO = p_intPkConsultar;
|
|||
|
|
DataSet dsProyectos = objRequisitoBL.listarRequisitosProyecto(null, false);
|
|||
|
|
chklTipoProyecto.ClearSelection();
|
|||
|
|
if (dsProyectos.Tables[0].Rows.Count > 1)
|
|||
|
|
{
|
|||
|
|
chklTipoProyecto.Items.Clear();
|
|||
|
|
|
|||
|
|
foreach (DataRow row in dsProyectos.Tables[0].Rows)
|
|||
|
|
{
|
|||
|
|
ListItem item = new ListItem();
|
|||
|
|
item.Value = row["PKPROYECTO"].ToString();
|
|||
|
|
item.Text = row["DESCRIPCIONPROYECTO"].ToString();
|
|||
|
|
item.Selected = bool.Parse(row["ASTATEREQUISITOPROYECTO"].ToString());
|
|||
|
|
chklTipoProyecto.Items.Add(item);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
chklTipoProyecto.Items.Insert(0, new ListItem("Todos", "-1"));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
throw ex;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Llena el dropdownlist de grado academico según la aplicación
|
|||
|
|
/// </summary>
|
|||
|
|
private void llenarDDLtipoInspeccion() //M6
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//Limpia el control
|
|||
|
|
ddlTipoInspeccion.Items.Clear();
|
|||
|
|
//Instancia el bjeto
|
|||
|
|
objUsuarioBL = new UsuarioBL();
|
|||
|
|
//Asigna datos al atributo
|
|||
|
|
|
|||
|
|
|
|||
|
|
//Carga la información en un dataset
|
|||
|
|
DataSet dsTipoInspeccion = objUsuarioBL.dsListaTipoInspeccion(null);
|
|||
|
|
if (dsTipoInspeccion.Tables[0].Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
ddlTipoInspeccion.DataSource = dsTipoInspeccion;
|
|||
|
|
ddlTipoInspeccion.DataTextField = dsTipoInspeccion.Tables[0].Columns["DESCRIPCIONTIPOINSPECCION"].ColumnName;
|
|||
|
|
ddlTipoInspeccion.DataValueField = dsTipoInspeccion.Tables[0].Columns["PKTIPOINSPECCION"].ColumnName;
|
|||
|
|
ddlTipoInspeccion.DataBind();
|
|||
|
|
|
|||
|
|
|
|||
|
|
ddlTipoInspeccion.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
ddlTipoInspeccion.Items.Insert(0, new ListItem("----- No existen opciones -----", "-1"));
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
throw ex;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// Llena el dropdownlist de grado academico según la aplicación
|
|||
|
|
/// </summary>
|
|||
|
|
private void llenarTipoProyecto() //M1
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//Limpia el control
|
|||
|
|
chklTipoProyecto.Items.Clear();
|
|||
|
|
//Instancia el bjeto
|
|||
|
|
proyectoBL objProyectoBL;
|
|||
|
|
objProyectoBL = new proyectoBL();
|
|||
|
|
//Asigna datos al atributo
|
|||
|
|
|
|||
|
|
|
|||
|
|
//Carga la información en un dataset
|
|||
|
|
|
|||
|
|
|
|||
|
|
DataSet dsProyectos = objProyectoBL.dsListaProyectos(null);
|
|||
|
|
|
|||
|
|
if (dsProyectos.Tables[0].Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
chklTipoProyecto.DataSource = dsProyectos;
|
|||
|
|
chklTipoProyecto.DataTextField = dsProyectos.Tables[0].Columns["DESCRIPCIONPROYECTO"].ColumnName;
|
|||
|
|
chklTipoProyecto.DataValueField = dsProyectos.Tables[0].Columns["PKPROYECTO"].ColumnName;
|
|||
|
|
chklTipoProyecto.DataBind();
|
|||
|
|
|
|||
|
|
|
|||
|
|
chklTipoProyecto.Items.Insert(0, new ListItem("Todos", "-1"));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
chklTipoProyecto.Items.Insert(0, new ListItem("----- No existen opciones -----", "-1"));
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
throw ex;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|