2021-01-22 14:59:35 +00:00
/ * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Instituto Costarricense de Acueductos y Alcantarillados . - 2017
* 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
* Juan Pablo Monge D 14 – 09 - 2017 Se inicia con el diseño de la pagina
* … … … … … … … … … … … … … … … … … … … … … …
* … … … … … … … … … … … … … … … … … … … … … …
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Derechos Reservados ( C ) 2017 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.TRA ;
using System.Text ;
using System.Security.Cryptography ;
using System.IO ;
public partial class Forms_Trans_frwCriterioAS : 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 ) ;
// EjecutarScript("inicializaTab('formulario');");
}
catch ( Exception ex )
{
MensajeError ( "Error en R0M1" , ex ) ;
}
}
#endregion
#region Variables ( R1 )
inspeccionasBL objInspeccionasBL ;
GridView grvListaVisitaSolicitudTemp ;
string strNumSolicitudTMP = "0" ;
#region variables del estandar
string strPagina = string . Empty ;
string strScript = string . Empty ;
#endregion
#endregion
#region Eventos Formulario ( R2 )
protected void Page_Load ( object sender , EventArgs e ) //M0
{
try
{
//ScriptManager.GetCurrent(Page).RegisterPostBackControl(btnNuevo);
if ( Session [ "ACTIVIDADFINALIZADA" ] ! = null )
Session [ "ACTIVIDADFINALIZADA" ] = null ;
ScriptManager . GetCurrent ( Page ) . RegisterPostBackControl ( grvListaVisitaSolicitud ) ;
if ( ViewState [ "MODO" ] ! = null )
{
if ( ViewState [ "MODO" ] . ToString ( ) = = "Firmador" )
{
obtenerDocumentoFirmado ( ) ;
}
}
strNumSolicitudTMP = Session [ "SOLICITUD" ] . ToString ( ) ;
if ( Session [ "FKREUTILIZA" ] ! = null & & Session [ "FKREUTILIZA" ] . ToString ( ) ! = string . Empty & & Session [ "FKREUTILIZA" ] . ToString ( ) ! = " " )
nPKReutilizaTMP = int . Parse ( Session [ "FKREUTILIZA" ] . ToString ( ) ) ;
lblNumSolicitud . Text = strNumSolicitudTMP ;
if ( ( ! IsPostBack ) & & ( Session . Count > 0 ) )
{
limpiarCampos ( ) ;
Session [ "Pagina" ] = "" ;
txtLatitud . Text = "" ;
txtLongitud . Text = "" ;
EjecutarScript ( "inicializaTab('grid');" ) ;
ComandosxMenu ( ) ;
llenarGridVisitaSolicitud ( ) ;
}
else
{
if ( Session . Count = = 0 )
{ ClientScript . RegisterStartupScript ( this . GetType ( ) , "Error" , "<script>javascript: window.parent.VentanaCerrarActividades();window.parent.VentanaCerrarFormularioAS();window.location.href = '../wfrLogin.aspx?sesion=expiro';</script>" ) ; }
}
//{ ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>javascript: window.parent.VentanaCerrarActividades();window.parent.VentanaCerrarFormularioAP();</script>"); }
}
catch ( Exception ex )
{
MensajeError ( "Error en R2M0" , ex ) ;
}
}
#endregion
#region Eventos Controles Web ( R3 )
///<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 ) //M1
{
try
{
llenarGridVisitaSolicitud ( ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M2" + MensajesAplicacion . RefrescarFallido . ToString ( ) , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('grid');" ) ;
}
}
/// <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 grvListaVisitaSolicitud_PageIndexChanging ( object sender , GridViewPageEventArgs e ) //M1
{
try
{
grvListaVisitaSolicitud . PageIndex = e . NewPageIndex ;
llenarGridVisitaSolicitud ( ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M1" , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('grid');" ) ;
}
}
/// <summary>
/// Metodo que se utiliza para borrar el rol del listado de roles
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grvListaVisitaSolicitud_RowCommand ( object sender , GridViewCommandEventArgs e ) //M5
{
try
{
if ( validarSesion ( ) = = false )
EjecutarScript ( "window.parent.VentanaCerrarFormularioASSesion();" ) ;
else
{
int i = Convert . ToInt32 ( e . CommandArgument ) ;
GridViewRow selectedRow = grvListaVisitaSolicitud . Rows [ i ] ;
Session [ "PKINSPECCION" ] = int . Parse ( selectedRow . Cells [ 0 ] . Text ) ;
Session [ "FKDEPENDENCIASIGDD" ] = selectedRow . Cells [ 11 ] . Text ;
if ( e . CommandName = = "ver" )
{
limpiarCampos ( ) ;
//deshabilitarCampos();
int nPk = int . Parse ( selectedRow . Cells [ 0 ] . Text ) ;
cargarFormularioCriterioAS ( nPk ) ;
ViewState [ "MODO" ] = "Modificar" ;
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
if ( e . CommandName = = "enviar" )
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . PKINSPECCION = int . Parse ( selectedRow . Cells [ 0 ] . Text ) ;
DataSet dsInspeccion = objInspeccionasBL . listarInspeccionesAS ( null ) ;
llenarDDLEncargado ( true ) ;
if ( dsInspeccion . Tables [ 0 ] . Rows . Count ! = 0 )
if ( ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "REVISIONREVISIONFORMULARIO" ] . ToString ( ) . ToLower ( ) = = "" ) | | ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "REVISIONREVISIONFORMULARIO" ] . ToString ( ) . ToLower ( ) ! = "false" ) ) // && dsInspeccion.Tables[0].Rows[0]["FECHARECIBIDOREVISIONFORMULARIO"].ToString() != dsInspeccion.Tables[0].Rows[0]["FECHAREVISIONREVISIONFORMULARIO"].ToString()))
{
EjecutarScript ( "VentanaAbrirCorreo();" ) ;
}
else
{
EjecutarScript ( "inicializaTab('grid','revision');" ) ;
}
}
if ( e . CommandName = = "firmar" )
{
//limpiarCampos();
string strNombreCarta = Session [ "SOLICITUD" ] . ToString ( ) ;
firmarDocumento ( strNombreCarta ) ;
EjecutarScript ( "inicializaTab('grid');" ) ;
}
if ( e . CommandName = = "verpdf" )
{
//limpiarCampos();
char delimitador = '-' ;
string strNombreCarta = selectedRow . Cells [ 1 ] . Text ;
string [ ] arrayNombre = strNombreCarta . Split ( delimitador ) ;
string pdfPath = ConfigurationManager . AppSettings [ "DocumentosPDF" ] . ToString ( ) + @"\" + arrayNombre [ 0 ] . ToString ( ) + "-" + arrayNombre [ 1 ] . ToString ( ) + "-" + arrayNombre [ 2 ] . ToString ( ) + @"\" + strNombreCarta + "-AS.pdf" ;
string targetURL = "'../../DocumentosPDF/" + arrayNombre [ 0 ] . ToString ( ) + "-" + arrayNombre [ 1 ] . ToString ( ) + "-" + arrayNombre [ 2 ] . ToString ( ) + "/" + strNombreCarta + "-AS.pdf'" ;
string ruta = ConfigurationManager . AppSettings [ "DocumentosPDF" ] . ToString ( ) + @"\" + arrayNombre [ 0 ] . ToString ( ) + "-" + arrayNombre [ 1 ] . ToString ( ) + "-" + arrayNombre [ 2 ] . ToString ( ) ;
//if (!File.Exists(pdfPath))
{
//obtener la constancia y ponerla en la carpeta compartida para el envio de correo
//se el registro de vision 2020
Documento oDoc = new Documento ( ) ;
string strResultado = oDoc . Consultar_Documento ( arrayNombre [ 0 ] . ToString ( ) + "-" + arrayNombre [ 1 ] . ToString ( ) + "-" + arrayNombre [ 2 ] . ToString ( ) + "|Criterio técnico AS" , strNombreCarta , strNombreCarta + "-AS.pdf" ) ;
if ( strResultado ! = string . Empty & & strResultado ! = "No existe" )
{
//strResultado += pdfPath + ";"; ;
EjecutarScript ( "abrirPDF('" + strResultado + "');inicializaTab('grid','');" ) ;
}
else
{
ClientScript . RegisterStartupScript ( this . GetType ( ) , "Error" , "<script>javascript: MensajeInformativo('No se ha generado el documento PDF." + pdfPath + "');inicializaTab('grid','');</script>" ) ;
}
}
//if (System.IO.File.Exists(pdfPath))
//{
// EjecutarScript("abrirPDF(" + targetURL + ");inicializaTab('grid','');");
// //System.Diagnostics.Process proc = new System.Diagnostics.Process();
// //proc.StartInfo.FileName = pdfPath;
// //proc.Start();
// //proc.Close();
// //EjecutarScript("JavaScript: window.open('" + targetURL + "','','width=500,height=245,left=350,top=50');");
//}
}
}
}
catch ( Exception ex )
{
//MensajeError("Error en R3M5", ex);
EjecutarScript ( "alert('Error: " + ex . Message . ToString ( ) + "');inicializaTab('grid','');" ) ;
}
}
protected void btnNuevo_Click ( object sender , EventArgs e ) //M6
{
try
{
if ( validarSesion ( ) = = false )
EjecutarScript ( "window.parent.VentanaCerrarFormularioASSesion();" ) ;
else
{
int pkRegistro = GuardarDatosVisitaSolicitud ( ) ;
if ( pkRegistro = = 0 )
//EjecutarScript("exportarPDF();");
EjecutarScript ( "inicializaTab('grid','Exitoso')" ) ;
else
{
EjecutarScript ( "exportarPDF();" ) ;
EjecutarScript ( "inicializaTab('grid','Exitoso')" ) ;
//limpiarCampos();
}
llenarGridVisitaSolicitud ( ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M6" , ex ) ;
}
}
protected void btnAprobar_Click ( object sender , EventArgs e )
{
try
{
int pkRegistro = GuardarDatosVisitaSolicitud ( ) ;
int nValorRetornadoRevision = 0 ;
if ( pkRegistro = = 0 )
EjecutarScript ( "inicializaTab('formulario','Alerta');" ) ;
else
{
//cambia el estado de la revision del formulario t_dis_revisionformulario
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKREVISIONFORMULARIO = int . Parse ( ViewState [ "PKREVISIONFORMULARIO" ] . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . REVISIONREVISIONFORMULARIO = true ;
objInspeccionasBL . objinspeccionasEL . FECHAREVISIONREVISIONFORMULARIO = DateTime . Now ;
nValorRetornadoRevision = objInspeccionasBL . modificarRevisionFormulario ( ) ;
if ( nValorRetornadoRevision ! = 0 )
{
nValorRetornadoRevision = 0 ;
//cambia el estado de la inspeccion general t_dis_inspeccion
objInspeccionasBL . objinspeccionasEL . PKINSPECCION = int . Parse ( Session [ "PKINSPECCION" ] . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . FKESTADOINSPECCION = 1 ; //asignada t_adm_estadoinspeccion
nValorRetornadoRevision = objInspeccionasBL . modificarEstadoInspecciongeneral ( ) ;
if ( nValorRetornadoRevision ! = 0 )
{
GuardarDatosActividad ( "aprueba" ) ;
#region Envio de correo
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.”" ;
AyABL . TRA . correoBL objcorreoBL = new AyABL . TRA . correoBL ( ) ;
objcorreoBL . objcorreoEL . FKNUMSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
// objcorreoBL.objcorreoEL.CORREO = dsActividad.Tables[0].Rows[0]["LOGINUSUARIO"].ToString() + "@aya.go.cr";
objcorreoBL . objcorreoEL . ASUNTO = "Revisión de Criterio Técnico - SIGDD" ;
objcorreoBL . objcorreoEL . CONTENIDO = "La solicitud de disponibilidad " + Session [ "SOLICITUD" ] . ToString ( ) + " se aprobó el día " + DateTime . Now . ToString ( ) + ", para ver los detalles ingrese al sistema en el siguiente hipervínculo, ingrese al sistema <a href=http://" + HttpContext . Current . Request . Url . Authority + "/Forms/wfrLogin> SIGDD</a>" + strPiePagina ;
objcorreoBL . objcorreoEL . FKUSUARIO = Convert . ToInt32 ( Session [ "PKUSUARIOXDEPENDENCIA" ] . ToString ( ) ) ;
objcorreoBL . objcorreoEL . Fecha = DateTime . Now ;
nValorRetornadoRevision = objcorreoBL . insertarCorreo ( ) ;
ObservacionesBL objObservacionesBL = new ObservacionesBL ( ) ;
//objObservacionesBL.objobservacionesEL.FKNUMSOLICITUD = strNumSolicitudTMP;
objObservacionesBL . objobservacionesEL . OBSERVACIONES = "El usuario " + Session [ "NOMBREEMPLEADO" ] . ToString ( ) + " aprobó el formulario de alcantarillado sanitario potable de la solicitud N°" + Session [ "SOLICITUD" ] . ToString ( ) ;
objObservacionesBL . objobservacionesEL . Fecha = DateTime . Now ;
objObservacionesBL . objobservacionesEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
objObservacionesBL . objobservacionesEL . USUARIO = Session [ "LOGIN" ] . ToString ( ) ;
int nValorRetornadoObservacion = objObservacionesBL . insertarObservaciones ( ) ;
#endregion
}
}
EjecutarScript ( "exportarPDF();" ) ;
//limpiarCampos();
}
llenarGridVisitaSolicitud ( ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M6" , ex ) ;
}
}
protected void btnDenegar_Click ( object sender , EventArgs e )
{
try
{
int pkRegistro = GuardarDatosVisitaSolicitud ( ) ;
int nValorRetornadoRevision = 0 ;
if ( pkRegistro = = 0 )
EjecutarScript ( "inicializaTab('formulario','Alerta');" ) ;
else
{
//cambia el estado de la revision del formulario t_dis_revisionformulario
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKREVISIONFORMULARIO = int . Parse ( ViewState [ "PKREVISIONFORMULARIO" ] . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . REVISIONREVISIONFORMULARIO = false ;
objInspeccionasBL . objinspeccionasEL . FECHAREVISIONREVISIONFORMULARIO = DateTime . Now ;
nValorRetornadoRevision = objInspeccionasBL . modificarRevisionFormulario ( ) ;
if ( nValorRetornadoRevision ! = 0 )
{
nValorRetornadoRevision = 0 ;
//cambia el estado de la inspeccion general t_dis_inspeccion
objInspeccionasBL . objinspeccionasEL . PKINSPECCION = int . Parse ( Session [ "PKINSPECCION" ] . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . FKESTADOINSPECCION = 3 ; //reinspeccion t_adm_estadoinspeccion
nValorRetornadoRevision = objInspeccionasBL . modificarEstadoInspecciongeneral ( ) ;
if ( nValorRetornadoRevision ! = 0 )
{
GuardarDatosActividad ( "deniega" ) ;
#region Envio de correo
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.”" ;
AyABL . TRA . correoBL objcorreoBL = new AyABL . TRA . correoBL ( ) ;
objcorreoBL . objcorreoEL . FKNUMSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
// objcorreoBL.objcorreoEL.CORREO = dsActividad.Tables[0].Rows[0]["LOGINUSUARIO"].ToString() + "@aya.go.cr";
objcorreoBL . objcorreoEL . ASUNTO = "Revisión de Criterio Técnico - SIGDD" ;
objcorreoBL . objcorreoEL . CONTENIDO = "La solicitud de disponibilidad " + Session [ "SOLICITUD" ] . ToString ( ) + " se denegó el día " + DateTime . Now . ToString ( ) + ", para ver los detalles ingrese al sistema en el siguiente hipervínculo, ingrese al sistema <a href=http://" + HttpContext . Current . Request . Url . Authority + "/Forms/wfrLogin> SIGDD</a>" + strPiePagina ;
objcorreoBL . objcorreoEL . FKUSUARIO = Convert . ToInt32 ( Session [ "PKUSUARIOXDEPENDENCIA" ] . ToString ( ) ) ;
objcorreoBL . objcorreoEL . Fecha = DateTime . Now ;
nValorRetornadoRevision = objcorreoBL . insertarCorreo ( ) ;
ObservacionesBL objObservacionesBL = new ObservacionesBL ( ) ;
//objObservacionesBL.objobservacionesEL.FKNUMSOLICITUD = strNumSolicitudTMP;
objObservacionesBL . objobservacionesEL . OBSERVACIONES = "El usuario " + Session [ "NOMBREEMPLEADO" ] . ToString ( ) + " denegó el formulario de alcantarillado sanitario potable de la solicitud N°" + Session [ "SOLICITUD" ] . ToString ( ) ;
objObservacionesBL . objobservacionesEL . Fecha = DateTime . Now ;
objObservacionesBL . objobservacionesEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
objObservacionesBL . objobservacionesEL . USUARIO = Session [ "LOGIN" ] . ToString ( ) ;
int nValorRetornadoObservacion = objObservacionesBL . insertarObservaciones ( ) ;
#endregion
}
}
EjecutarScript ( "exportarPDF();" ) ;
//limpiarCampos();
}
llenarGridVisitaSolicitud ( ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M6" , ex ) ;
}
}
protected void ddlInspector_SelectedIndexChanged ( object sender , EventArgs e )
{
}
//protected void rblTipoPrevista_SelectedIndexChanged(object sender, EventArgs e)
//{
// try
// {
// if (rblTipoPrevista.SelectedValue.ToString() == "4")
// {
// txtOtrosPrevista.Visible = true;
// txtOtrosPrevista.Enabled = true;
// }
// else
// {
// txtOtrosPrevista.Text = string.Empty;
// txtOtrosPrevista.Visible = false;
// txtOtrosPrevista.Enabled = false;
// }
// }
// catch (Exception ex)
// {
// MensajeError("Se dio un error al seleccionar el tipo de prevista.", ex);
// }
// finally
// {
// EjecutarScript("inicializaTab('formulario');");
// }
//}
//protected void rblTuberiaDistribucion_SelectedIndexChanged(object sender, EventArgs e)
//{
// try
// {
// if (rblTuberiaDistribucion.SelectedValue.ToString() == "true")
// {
// dvTuberiaDistribucion.Visible = true;
// dvTuberiaDistribucion2.Visible = true;
// }
// else
// {
// dvTuberiaDistribucion.Visible = false;
// dvTuberiaDistribucion2.Visible = false;
// }
// }
// catch (Exception ex)
// {
// MensajeError("Se dio un error.", ex);
// }
// finally
// {
// EjecutarScript("inicializaTab('formulario');");
// }
//}
//protected void rblDiametro_SelectedIndexChanged(object sender, EventArgs e)
//{
// try
// {
// if (rblDiametro.SelectedValue.ToString() == "Otro")
// {
// dvTuberiaDistribucion3.Visible = true;
// }
// else
// {
// dvTuberiaDistribucion3.Visible = false;
// }
// }
// catch (Exception ex)
// {
// MensajeError("Se dio un error.", ex);
// }
// finally
// {
// EjecutarScript("inicializaTab('formulario');");
// }
//}
protected void rblDisponibilidadAS_SelectedIndexChanged ( object sender , EventArgs e )
{
try
{
if ( rblDisponibilidadAS . SelectedValue . ToString ( ) = = "false" )
{
divNoExisteDisponibilidad . Visible = true ;
divSiExisteDisponibilidad . Visible = false ;
}
else
{
divNoExisteDisponibilidad . Visible = false ;
divSiExisteDisponibilidad . Visible = true ;
}
}
catch ( Exception ex )
{
MensajeError ( "Se dio un error." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
protected void rblRequiereCCR_SelectedIndexChanged ( object sender , EventArgs e )
{
try
{
if ( rblRequiereCCR . SelectedValue . ToString ( ) = = "true" )
{
divCCH2 . Visible = true ;
rblUbicacionMedidor . ClearSelection ( ) ;
rblUbicacionMedidor . Enabled = true ;
txtLindero . Enabled = true ;
txtLindero . Text = string . Empty ;
}
else
{
divCCH2 . Visible = false ;
rblUbicacionMedidor . SelectedValue = "5" ;
rblUbicacionMedidor . Enabled = false ;
txtLindero . Enabled = false ;
txtLindero . Text = "N/A" ;
}
}
catch ( Exception ex )
{
MensajeError ( "Se dio un error." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
protected void rblNuevoServicio_SelectedIndexChanged ( object sender , EventArgs e )
{
try
{
if ( rblNuevoServicio . SelectedValue . ToString ( ) = = "7" )
{
rblDiametroNuevoServicio . Enabled = false ;
txtDistanciaNuevoServicio . Enabled = false ;
txtDistanciaNuevoServicio . Text = "N/A" ;
}
else
{
rblDiametroNuevoServicio . Enabled = true ;
txtDistanciaNuevoServicio . Enabled = true ;
txtDistanciaNuevoServicio . Text = string . Empty ;
}
}
catch ( Exception ex )
{
MensajeError ( "Se dio un error." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
protected void rblExisteNis_SelectedIndexChanged ( object sender , EventArgs e )
{
try
{
if ( rblExisteNis . SelectedValue = = "true" )
txtNisExistente . Enabled = true ;
else
txtNisExistente . Enabled = false ;
}
catch ( Exception ex )
{
MensajeError ( "Se produjo un error al seleccionar la opcion." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
protected void rblEstructuraExistente_SelectedIndexChanged ( object sender , EventArgs e )
{
try
{
if ( rblEstructuraExistente . SelectedValue = = "true" )
txtTipoEstructuraExistente . Enabled = true ;
else
txtTipoEstructuraExistente . Enabled = false ;
}
catch ( Exception ex )
{
MensajeError ( "Se produjo un error al seleccionar la opcion." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
protected void rblExisteDisponibilidad_SelectedIndexChanged ( object sender , EventArgs e )
{
try
{
if ( rblExisteDisponibilidad . SelectedValue = = "true" )
txtDisponibilidadAsociada . Enabled = true ;
else
txtDisponibilidadAsociada . Enabled = false ;
}
catch ( Exception ex )
{
MensajeError ( "Se produjo un error al seleccionar la opcion." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
protected void btnHabilitar_Click ( object sender , EventArgs e )
{
decimal dCaudalRecoleccion = 0 ;
try
{
ViewState [ "MODO" ] = "Nuevo" ;
//deshabilitarCampos();
habilitarCampos ( ) ;
//rfvCaudalReservado.ErrorMessage = "";
//revPresionMinima.ErrorMessage = "";
//revPresionMaxima.ErrorMessage = "";
limpiarCampos ( ) ;
//txtDiametroPrevista.Enabled = false;
//txtOtrosPrevista.Visible = false;
2021-02-09 20:27:11 +00:00
2021-01-22 14:59:35 +00:00
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
DataSet dsInspeccion = objInspeccionasBL . listarInspeccionesAS ( null ) ;
2021-02-09 20:27:11 +00:00
2021-01-22 14:59:35 +00:00
if ( dsInspeccion . Tables [ 0 ] . Rows . Count ! = 0 )
{
foreach ( DataRow row in dsInspeccion . Tables [ 0 ] . Rows )
{
if ( row [ "DESCRIPCIONESTADOINSPECCION" ] . ToString ( ) . ToLower ( ) = = "asignada" | | row [ "DESCRIPCIONESTADOINSPECCION" ] . ToString ( ) . ToLower ( ) = = "pendiente revisión" )
{
rblExisteNis . SelectedValue = "false" ;
txtNisExistente . Text = string . Empty ;
//lblProposito.Text = string.Empty;
EjecutarScript ( "inicializaTab('grid','existe');" ) ;
}
}
}
else //si no existen formularios asociados a la solicitud actual se carga la informacion de la solicitud de origen de la prorroga o revision
{
if ( nPKReutilizaTMP ! = 0 )
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . FKSOLICITUD = nPKReutilizaTMP ;
DataSet dsInspeccionBL = objInspeccionasBL . listarInspeccionesAS ( null ) ;
if ( dsInspeccionBL . Tables [ 0 ] . Rows . Count > 0 )
{
cargarFormularioCriterioAS ( int . Parse ( dsInspeccionBL . Tables [ 0 ] . Rows [ 0 ] [ "PKINSPECCION" ] . ToString ( ) ) ) ;
habilitarCampos ( ) ;
}
}
}
solicitudBL objSolicitudBL = new solicitudBL ( ) ;
objSolicitudBL . objSolicitudEL . PK = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
DataSet ds = objSolicitudBL . dsListaSolicitudProgramacion ( null ) ;
if ( ds . Tables [ 0 ] . Rows . Count ! = 0 )
{
rblExisteNis . SelectedValue = ds . Tables [ 0 ] . Rows [ 0 ] [ "TIENESERVICIOSOLICITUD" ] . ToString ( ) . ToLower ( ) ;
txtNisExistente . Text = ds . Tables [ 0 ] . Rows [ 0 ] [ "NUMERONISSOLICITUD" ] . ToString ( ) ;
//lblProposito.Text = dsInspeccion.Tables[0].Rows[0]["DESCRIPCIONPROYECTO"].ToString();
Session [ "PKTIPOINSPECCION" ] = ds . Tables [ 0 ] . Rows [ 0 ] [ "FKTIPOINSPECCION" ] . ToString ( ) ;
//txtCaudalReservado.Text = dCaudal.ToString();
if ( rblExisteNis . SelectedValue = = "true" )
txtNisExistente . Enabled = true ;
else
txtNisExistente . Enabled = false ;
int nCantidadEdificaciones = int . Parse ( ds . Tables [ 0 ] . Rows [ 0 ] [ "CANTIDADEDIFICACIONESSOLICITUD" ] . ToString ( ) . ToLower ( ) ) ;
if ( nCantidadEdificaciones > 0 )
rblEstructuraExistente . SelectedValue = "true" ;
else
rblEstructuraExistente . SelectedValue = "false" ;
txtTipoEstructuraExistente . Text = ds . Tables [ 0 ] . Rows [ 0 ] [ "DESCRIPCIONUSOEDIFICACIONSOLICITUD" ] . ToString ( ) ;
}
if ( rblEstructuraExistente . SelectedValue = = "false" )
txtTipoEstructuraExistente . Enabled = false ;
if ( rblExisteDisponibilidad . SelectedValue = = "false" )
txtDisponibilidadAsociada . Enabled = false ;
if ( rblCuentaPrevista . SelectedValue ! = "1" )
{
rblDiametroPrevista . Enabled = false ;
rblTipoCajaRegistro . Enabled = false ;
txtObservacionTipoCajaRegistro . Enabled = false ;
}
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
dCaudalRecoleccion = objInspeccionasBL . obtenerCaudal ( ) ;
dCaudalRecoleccion = Decimal . Multiply ( dCaudalRecoleccion , decimal . Parse ( "0.8" ) ) ;
txtCaudalReservado . Text = dCaudalRecoleccion . ToString ( "N2" ) ;
BloquearIntros ( ) ;
2021-02-09 20:27:11 +00:00
inspeccionapBL objInspeccionBL = new inspeccionapBL ( ) ;
objInspeccionBL . objinspeccionapEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
DataSet dsInspeccion2 = objInspeccionBL . listarInspecciones ( null ) ;
if ( dsInspeccion2 . Tables [ 0 ] . Rows . Count ! = 0 )
{
LlenarDatosExistentes ( dsInspeccion2 ) ;
}
2021-01-22 14:59:35 +00:00
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
catch ( Exception ex )
{
if ( validarSesion ( ) = = false )
EjecutarScript ( "window.parent.VentanaCerrarFormularioASSesion();" ) ;
else
MensajeError ( "Se produjo un error." , ex ) ;
}
}
protected void btnEnviarRevision_Click ( object sender , EventArgs e )
{
int nValorRetornado = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
//objInspeccionBL.objinspeccionapEL.FKSOLICITUD = int.Parse(Session["PKSOLICITUD"].ToString());
objInspeccionasBL . objinspeccionasEL . PKINSPECCION = nPKReutilizaTMP ;
DataSet dsInspeccion = objInspeccionasBL . listarInspeccionesAS ( null ) ;
ObservacionesBL objObservacionesBL = new ObservacionesBL ( ) ;
objObservacionesBL . objobservacionesEL . USUARIO = Session [ "LOGIN" ] . ToString ( ) ;
int nValorRetornadoObservacion = 0 ;
if ( int . Parse ( ddlEncargadoRevision . SelectedValue ) ! = - 1 )
{
if ( int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKESTADOINSPECCION" ] . ToString ( ) ) = = 2 )
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKREVISIONFORMULARIO = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKREVISIONFORMULARIO" ] . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . REVISIONREVISIONFORMULARIO = false ;
objInspeccionasBL . objinspeccionasEL . FECHAREVISIONREVISIONFORMULARIO = DateTime . Now ;
int nValorRetornadoRevision = objInspeccionasBL . cancelarRevisionFormulario ( ) ;
//objObservacionesBL.objobservacionesEL.FKNUMSOLICITUD = strNumSolicitudTMP;
objObservacionesBL . objobservacionesEL . OBSERVACIONES = "El usuario " + Session [ "NOMBREEMPLEADO" ] . ToString ( ) + " ha cancelado la revision de inspeccion de agua potable de la solicitud N°" + Session [ "SOLICITUD" ] . ToString ( ) ;
objObservacionesBL . objobservacionesEL . Fecha = DateTime . Now ;
objObservacionesBL . objobservacionesEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
objObservacionesBL . objobservacionesEL . USUARIO = Session [ "LOGIN" ] . ToString ( ) ;
nValorRetornadoObservacion = objObservacionesBL . insertarObservaciones ( ) ;
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . DELETE . ToString ( ) ,
MensajesBitacora . IngresarRegistro + ": Se ha cancelado la revision de inspeccion de agua potable de la solicitud N° " + Session [ "SOLICITUD" ] . ToString ( ) + " por el usuario " + Session [ "NOMBREEMPLEADO" ] . ToString ( ) ,
"frwCriterioAS.aspx" ,
Convert . ToInt32 ( ConfigurationManager . AppSettings [ "pkApp" ] )
) ;
}
#region crea nueva inspeccion
ViewState [ "MODO" ] = "Modificar" ;
EjecutarScript ( "inicializaTab('grid');" ) ;
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . REVISIONREVISIONFORMULARIO = false ;
objInspeccionasBL . objinspeccionasEL . FECHARECIBIDOREVISIONFORMULARIO = DateTime . Now ;
objInspeccionasBL . objinspeccionasEL . FECHAREVISIONREVISIONFORMULARIO = DateTime . Now ;
objInspeccionasBL . objinspeccionasEL . FKUSUARIOXDEPENDENCIA = int . Parse ( ddlEncargadoRevision . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCION = int . Parse ( Session [ "PKINSPECCION" ] . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
nValorRetornado = objInspeccionasBL . insertarRevision ( null ) ;
if ( nValorRetornado ! = 0 )
{
nValorRetornado = 0 ;
objInspeccionasBL . objinspeccionasEL . PKINSPECCION = int . Parse ( Session [ "PKINSPECCION" ] . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . FKESTADOINSPECCION = 2 ; //pendiente revision
nValorRetornado = objInspeccionasBL . modificarEstadoInspecciongeneral ( ) ;
ViewState [ "MODO" ] = "Nuevo" ;
AsignaActividadesUsuarios ( ) ;
if ( nValorRetornado ! = 0 )
{
#region Envio de correo
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.”" ;
AyABL . TRA . correoBL objcorreoBL = new AyABL . TRA . correoBL ( ) ;
objcorreoBL . objcorreoEL . FKNUMSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
// objcorreoBL.objcorreoEL.CORREO = dsActividad.Tables[0].Rows[0]["LOGINUSUARIO"].ToString() + "@aya.go.cr";
objcorreoBL . objcorreoEL . ASUNTO = "Revisión de Criterio Técnico - SIGDD" ;
objcorreoBL . objcorreoEL . CONTENIDO = "La solicitud de disponibilidad " + Session [ "SOLICITUD" ] . ToString ( ) + " se envía para su respectiva aprobación para ver los detalles ingrese al sistema en el siguiente hipervínculo, ingrese al sistema <a href=http://" + HttpContext . Current . Request . Url . Authority + "/Forms/wfrLogin> SIGDD</a>" + strPiePagina ;
objcorreoBL . objcorreoEL . FKUSUARIO = Convert . ToInt32 ( ddlEncargadoRevision . SelectedValue ) ;
objcorreoBL . objcorreoEL . Fecha = DateTime . Now ;
nValorRetornado = objcorreoBL . insertarCorreo ( ) ;
}
}
llenarGridVisitaSolicitud ( ) ;
#endregion
objObservacionesBL = new ObservacionesBL ( ) ;
//objObservacionesBL.objobservacionesEL.FKNUMSOLICITUD = strNumSolicitudTMP;
objObservacionesBL . objobservacionesEL . OBSERVACIONES = "El usuario " + Session [ "NOMBREEMPLEADO" ] . ToString ( ) + " envia formulario de inspección de alcantarillado sanitario de la solicitud N°" + Session [ "SOLICITUD" ] . ToString ( ) + " a revisión con el usuario " + ddlEncargadoRevision . SelectedItem . ToString ( ) + "." ;
objObservacionesBL . objobservacionesEL . Fecha = DateTime . Now ;
objObservacionesBL . objobservacionesEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
objObservacionesBL . objobservacionesEL . USUARIO = Session [ "LOGIN" ] . ToString ( ) ;
nValorRetornadoObservacion = objObservacionesBL . insertarObservaciones ( ) ;
#endregion
}
else
{
MensajeAlerta ( "Debe seleccionar un encargado para la revisión del formulario" ) ;
}
}
catch ( Exception ex )
{
throw ex ;
}
finally
{
EjecutarScript ( "inicializaTab('grid');" ) ;
}
}
protected void rblCuentaPrevista_SelectedIndexChanged ( object sender , EventArgs e )
{
try
{
if ( rblCuentaPrevista . SelectedValue = = "1" )
{
rblDiametroPrevista . Enabled = true ;
rblTipoCajaRegistro . Enabled = true ;
txtObservacionTipoCajaRegistro . Enabled = true ;
}
else
{
rblDiametroPrevista . Enabled = false ;
rblTipoCajaRegistro . Enabled = false ;
txtObservacionTipoCajaRegistro . Enabled = false ;
}
}
catch ( Exception ex )
{
MensajeError ( "Se produjo un error al seleccionar la opcion." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
protected void rblPropiedadFrenteA_SelectedIndexChanged ( object sender , EventArgs e )
{
try
{
if ( rblPropiedadFrenteA . SelectedValue = = "5" ) //otro
{
txtOtroPropiedadFrenteA . Enabled = true ;
}
else
{
txtOtroPropiedadFrenteA . Enabled = false ;
}
}
catch ( Exception ex )
{
MensajeError ( "Se produjo un error al seleccionar la opcion." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
protected void rblServiciosAfectanConexion_SelectedIndexChanged ( object sender , EventArgs e )
{
try
{
if ( rblServiciosAfectanConexion . SelectedValue = = "5" ) //otro
{
txtOtroServiciosAfectanConexion . Enabled = true ;
Div2 . Visible = true ;
}
else
{
txtOtroServiciosAfectanConexion . Enabled = false ;
Div2 . Visible = false ;
}
}
catch ( Exception ex )
{
MensajeError ( "Se produjo un error al seleccionar la opcion." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
protected void chkOtrosOperadores_CheckedChanged ( object sender , EventArgs e )
{
try
{
if ( chkOtrosOperadores . Checked = = true ) //otro
{
txtOtrosOperadores . Enabled = true ;
dvOtrosOperadores . Visible = true ;
}
else
{
txtOtrosOperadores . Enabled = false ;
dvOtrosOperadores . Visible = false ;
}
}
catch ( Exception ex )
{
MensajeError ( "Se produjo un error al seleccionar la opcion." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
protected void chkNoLocalizadoPozoAguaAbajo_CheckedChanged ( object sender , EventArgs e )
{
try
{
if ( chkNoLocalizadoPozoAguaAbajo . Checked = = false )
{
txtCoordenadasPozoAguaAbajo . Enabled = true ;
txtProfundidadPozoAguaAbajo . Enabled = true ;
rblDiametroPozoAguaAbajo . Enabled = true ;
rblMaterialPozoAguaAbajo . Enabled = true ;
}
else
{
txtCoordenadasPozoAguaAbajo . Enabled = false ;
txtProfundidadPozoAguaAbajo . Enabled = false ;
rblDiametroPozoAguaAbajo . Enabled = false ;
rblMaterialPozoAguaAbajo . Enabled = false ;
}
}
catch ( Exception ex )
{
MensajeError ( "Se presento un problema en la selección." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
protected void chkNoLocalizadoPozoAguaArriba_CheckedChanged ( object sender , EventArgs e )
{
try
{
if ( chkNoLocalizadoPozoAguaArriba . Checked = = false )
{
txtCoordenadasPozoAguaArriba . Enabled = true ;
txtProfundidadPozoAguaArriba . Enabled = true ;
rblDiametroPozoAguaArriba . Enabled = true ;
rblMaterialPozoAguaArriba . Enabled = true ;
}
else
{
txtCoordenadasPozoAguaArriba . Enabled = false ;
txtProfundidadPozoAguaArriba . Enabled = false ;
rblDiametroPozoAguaArriba . Enabled = false ;
rblMaterialPozoAguaArriba . Enabled = false ;
}
}
catch ( Exception ex )
{
MensajeError ( "Se presento un problema en la selección." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
protected void rblMaterialPozoAguaArriba_SelectedIndexChanged ( object sender , EventArgs e )
{
try
{
if ( rblMaterialPozoAguaArriba . SelectedValue = = "7" ) //otro
{
txtOtroMaterialPozoAguasArriba . Enabled = true ;
dvOtroMaterialPozoAguasArriba . Visible = true ;
}
else
{
txtOtroMaterialPozoAguasArriba . Enabled = false ;
dvOtroMaterialPozoAguasArriba . Visible = false ;
}
}
catch ( Exception ex )
{
MensajeError ( "Se produjo un error al seleccionar la opcion." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
protected void rblMaterialPozoAguaAbajo_SelectedIndexChanged ( object sender , EventArgs e )
{
try
{
if ( rblMaterialPozoAguaAbajo . SelectedValue = = "7" ) //otro
{
txtOtroMaterialPozoAguasAbajo . Enabled = true ;
dvOtroMaterialPozoAguasAbajo . Visible = true ;
}
else
{
txtOtroMaterialPozoAguasAbajo . Enabled = false ;
dvOtroMaterialPozoAguasAbajo . Visible = false ;
}
}
catch ( Exception ex )
{
MensajeError ( "Se produjo un error al seleccionar la opcion." , ex ) ;
}
finally
{
EjecutarScript ( "inicializaTab('formulario');" ) ;
}
}
//////protected void btnFirmar_Click(object sender, EventArgs e)
//////{
////// try
////// {
////// firmarDocumento(strNumSolicitudTMP);
////// //EjecutarScript("inicializaTab('grid','Exitoso');");
////// //limpiarCampos();
////// //llenarGridVisitaSolicitud();
////// }
////// catch (Exception ex)
////// {
////// MensajeError("Error en R3M6", ex);
////// }
//////}
#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
{
switch ( p_intFila )
{
case 1 : divDatosSuperiores . Visible = true ; divDatosInferiores . Visible = false ; break ;
case 2 : divDatosInferiores . Visible = true ; divDatosSuperiores . Visible = false ; break ;
}
}
catch ( Exception ex )
{
throw ex ;
}
}
/// <summary>
/// Oculta las filas que lo requieran
/// </summary>
/// <param name="p_intFila"></param>
private void ComandosxMenu ( ) //M2
{
try
{
//DataSet dsComandos = getComandos();
//if (dsComandos != null)
//{
// foreach (DataRow drTemp in dsComandos.Tables[0].Rows)
// {
// switch (drTemp["NOMBRECOMANDO"].ToString().ToUpper())
// {
//case "NUEVO":
//Div2.Visible = true;
// break;
//case "MODIFICA":
// //Inicio de variable tipo VIEWSTATE
// ViewState["PUEDEMODIFICAR"] = true;
// break;
// }
// }
//}
}
catch ( Exception ex )
{
throw ex ;
}
}
/// <summary>
/// Metodo que se utiliza para remover el role asignado al usuario
/// </summary>
/// <param name="p_nPk"></param>
private bool removerVisitaSolicitud ( int p_nPk ) //M3
{
bool blnValorRetornado = false ;
try
{
//objInspeccionasBL = new visitaSolicitudBL();
//objInspeccionasBL.objVisitaSolicitudEL.PK = p_nPk;
//objInspeccionasBL.eliminarVisitaSolicitud();
blnValorRetornado = true ;
}
catch ( Exception ex )
{
throw ex ;
}
return blnValorRetornado ;
}
/// <summary>
/// Metodo que se utiliza para contruir el Grid al inicio de la pantalla
/// </summary>
private void construirGridView ( ) //M4
{
try
{
grvListaVisitaSolicitudTemp = ( GridView ) tdLista . FindControl ( "grvListaVisitaSolicitud" ) ;
GridViewBoundField bdfPk = new GridViewBoundField ( "PKINSPECCION" , "PK" , false , false , false ) ;
GridViewBoundField bdfNumeroSolicitud = new GridViewBoundField ( "NUMEROSOLICITUDSOLICITUD" , "Solicitud" , false , false , true ) ;
GridViewBoundField bdfTipoEstructura = new GridViewBoundField ( "TIPOESTRUCTURAINSPECCION" , "Tipo estructura" , true , false , true ) ;
GridViewBoundField bdfOficioObrasCondominio = new GridViewBoundField ( "CONDOMINIOINSPECCION" , "Oficio obras condominio" , true , false , true ) ;
GridViewBoundField bdfFechaAsignacion = new GridViewBoundField ( "FECHAINSPECCION" , "Fecha asignación" , true , true , true ) ;
GridViewBoundField bdfEstadoDocumento = new GridViewBoundField ( "DESCRIPCIONESTADOINSPECCION" , "Estado" , true , false , true ) ;
GridViewBoundField bdfFkReutiliza = new GridViewBoundField ( "FKREUTILIZA" , "Reutiliza" , false , false , false ) ;
GridViewBoundField bdfFkDependenciaSIGDD = new GridViewBoundField ( "FKDEPENDENCIASIGDD" , "FK" , false , false , false ) ;
grvListaVisitaSolicitudTemp . Columns . Add ( bdfPk ) ;
grvListaVisitaSolicitudTemp . Columns . Add ( bdfNumeroSolicitud ) ;
grvListaVisitaSolicitudTemp . Columns . Add ( bdfTipoEstructura ) ;
grvListaVisitaSolicitudTemp . Columns . Add ( bdfOficioObrasCondominio ) ;
grvListaVisitaSolicitudTemp . Columns . Add ( bdfFechaAsignacion ) ;
grvListaVisitaSolicitudTemp . Columns . Add ( bdfEstadoDocumento ) ;
grvListaVisitaSolicitudTemp . Columns [ 0 ] . ItemStyle . Width = 125 ;
grvListaVisitaSolicitudTemp . Columns [ 1 ] . HeaderStyle . HorizontalAlign = HorizontalAlign . Center ;
grvListaVisitaSolicitudTemp . Columns [ 1 ] . ItemStyle . HorizontalAlign = HorizontalAlign . Center ;
grvListaVisitaSolicitudTemp . Columns [ 1 ] . ItemStyle . Width = 125 ;
ButtonField bf = new ButtonField ( ) ;
bf . ButtonType = ButtonType . Image ;
bf . Text = "Ver formulario" ;
bf . HeaderText = "" ;
bf . ImageUrl = "~/Images/MiniBotones/formulario.png" ;
bf . CommandName = "ver" ;
grvListaVisitaSolicitudTemp . Columns . Add ( bf ) ;
//if (Request["d"] != null)
//{
// if (Request["d"].ToString() != "deshabilitar")
// {
// ButtonField bfEnviar = new ButtonField();
// bfEnviar.ButtonType = ButtonType.Image;
// bfEnviar.Text = "Enviar a revisión";
// bfEnviar.HeaderText = "";
// bfEnviar.ImageUrl = "~/Images/MiniBotones/revision.png";
// bfEnviar.CommandName = "enviar";
// grvListaVisitaSolicitud.Columns.Add(bfEnviar);
// ButtonField bfFirmar = new ButtonField();
// bfFirmar.ButtonType = ButtonType.Image;
// bfFirmar.Text = "Firmar";
// bfFirmar.HeaderText = "";
// bfFirmar.ImageUrl = "~/Images/MiniBotones/Firma digittal.png";
// bfFirmar.CommandName = "firmar";
// grvListaVisitaSolicitud.Columns.Add(bfFirmar);
// }
//}
//else
{
ButtonField bfEnviar = new ButtonField ( ) ;
bfEnviar . ButtonType = ButtonType . Image ;
bfEnviar . Text = "Enviar a revisión" ;
bfEnviar . HeaderText = "" ;
bfEnviar . ImageUrl = "~/Images/MiniBotones/revision.png" ;
bfEnviar . CommandName = "enviar" ;
grvListaVisitaSolicitud . Columns . Add ( bfEnviar ) ;
ButtonField bfFirmar = new ButtonField ( ) ;
bfFirmar . ButtonType = ButtonType . Image ;
bfFirmar . Text = "Firmar" ;
bfFirmar . HeaderText = "" ;
bfFirmar . ImageUrl = "~/Images/MiniBotones/Firma digittal.png" ;
bfFirmar . CommandName = "firmar" ;
grvListaVisitaSolicitud . Columns . Add ( bfFirmar ) ;
}
ButtonField bfVer = new ButtonField ( ) ;
bfVer . ButtonType = ButtonType . Image ;
bfVer . Text = "Firmar" ;
bfVer . HeaderText = "" ;
bfVer . ImageUrl = "~/Images/MiniBotones/ConsultarExpediente.png" ;
bfVer . CommandName = "verpdf" ;
grvListaVisitaSolicitud . Columns . Add ( bfVer ) ;
//cuwBusquedaList.LlenarCHKLBusqueda(grvListaVisitaSolicitudTemp);
grvListaVisitaSolicitudTemp . Columns . Add ( bdfFkReutiliza ) ;
grvListaVisitaSolicitudTemp . Columns . Add ( bdfFkDependenciaSIGDD ) ;
}
catch ( Exception ex )
{
throw ex ;
}
}
2021-02-09 20:27:11 +00:00
public void LlenarDatosExistentes ( DataSet dsAguaPotable )
{
txtSistemaAsociado . Text = dsAguaPotable . Tables [ 0 ] . Rows [ 0 ] [ "SISTEMAASOCIADOINSPECCIONAP" ] . ToString ( ) ;
txtLongitud . Text = dsAguaPotable . Tables [ 0 ] . Rows [ 0 ] [ "LONGUITUDCROQUIS" ] . ToString ( ) ;
txtLatitud . Text = dsAguaPotable . Tables [ 0 ] . Rows [ 0 ] [ "LATITUDCROQUIS" ] . ToString ( ) ;
2021-02-16 23:18:53 +00:00
txtOficioRecepcion . Text = dsAguaPotable . Tables [ 0 ] . Rows [ 0 ] [ "CONDOMINIOINSPECCION" ] . ToString ( ) ;
2021-02-09 20:27:11 +00:00
rblExisteNis . SelectedValue = dsAguaPotable . Tables [ 0 ] . Rows [ 0 ] [ "TIENESERVICIOSOLICITUD" ] . ToString ( ) . ToLower ( ) ;
if ( rblExisteNis . SelectedValue = = "true" ) {
txtNisExistente . Enabled = true ;
}
else
{
txtNisExistente . Enabled = false ;
}
txtNisExistente . Text = dsAguaPotable . Tables [ 0 ] . Rows [ 0 ] [ "NUMERONISSOLICITUD" ] . ToString ( ) ;
//2
rblEstructuraExistente . SelectedValue = dsAguaPotable . Tables [ 0 ] . Rows [ 0 ] [ "ESTRUCTURAEXISTENTEINSPECCION" ] . ToString ( ) . ToLower ( ) ;
if ( rblEstructuraExistente . SelectedValue = = "true" )
{
txtTipoEstructuraExistente . Enabled = true ;
}
else
{
txtTipoEstructuraExistente . Enabled = false ;
}
txtTipoEstructuraExistente . Text = dsAguaPotable . Tables [ 0 ] . Rows [ 0 ] [ "TIPOESTRUCTURAINSPECCION" ] . ToString ( ) ;
//2
rblExisteDisponibilidad . SelectedValue = dsAguaPotable . Tables [ 0 ] . Rows [ 0 ] [ "DISPONIBILIDADASOCIADAEXISTENTEINSPECCION" ] . ToString ( ) . ToLower ( ) ;
if ( rblExisteDisponibilidad . SelectedValue = = "true" ) {
txtDisponibilidadAsociada . Enabled = true ;
}
else
{
txtDisponibilidadAsociada . Enabled = false ;
}
txtDisponibilidadAsociada . Text = dsAguaPotable . Tables [ 0 ] . Rows [ 0 ] [ "DESCRIPCIONDISPONIBILIDADEXISTENTEINSPECCION" ] . ToString ( ) ;
}
2021-01-22 14:59:35 +00:00
public void habilitarCampos ( )
{
if ( ! Request . UrlReferrer . ToString ( ) . Contains ( "frwBusquedaSolicitud" ) )
{
//rblExisteNis.ClearSelection();
//txtNisExistente.Text = string.Empty;
//txtNisExistente.Enabled = true;
rblExisteNis . Enabled = true ;
rblEstructuraExistente . Enabled = true ;
txtTipoEstructuraExistente . Enabled = true ;
rblExisteDisponibilidad . Enabled = true ;
txtDisponibilidadAsociada . Enabled = true ;
txtOficioRecepcion . Enabled = true ;
txtSistemaAsociado . Enabled = true ;
txtCoordenadasPozoAguaArriba . Enabled = true ;
txtCoordenadasPozoAguaAbajo . Enabled = true ;
txtProfundidadPozoAguaArriba . Enabled = true ;
txtProfundidadPozoAguaAbajo . Enabled = true ;
rblDiametroPozoAguaArriba . Enabled = true ;
rblDiametroPozoAguaAbajo . Enabled = true ;
rblMaterialPozoAguaArriba . Enabled = true ;
rblMaterialPozoAguaAbajo . Enabled = true ;
chkNoLocalizadoPozoAguaArriba . Enabled = true ;
chkNoLocalizadoPozoAguaAbajo . Enabled = true ;
rblCarpetaRodamiento . Enabled = true ;
rblExisteCajaRegistro . Enabled = true ;
rblExistePosibilidadConexionGravedad . Enabled = true ;
rblExisteRedAlcantarillado . Enabled = true ;
rblCobraServicioManzana . Enabled = true ;
rblExisteRedAlcantarilladoPrevista . Enabled = true ;
rblCuentaPrevista . Enabled = true ;
rblDiametroPrevista . Enabled = true ;
rblTipoCajaRegistro . Enabled = true ;
rblTieneCapacidadHidraulica . Enabled = true ;
rblEnRutaNacional . Enabled = true ;
rblPropiedadFrenteA . Enabled = true ;
rblServiciosAfectanConexion . Enabled = true ;
txtOtroServiciosAfectanConexion . Enabled = true ;
rblNuevoServicio . Enabled = true ;
rblDiametroNuevoServicio . Enabled = true ;
txtDistanciaNuevoServicio . Enabled = true ;
rblDisponibilidadAS . Enabled = true ;
txtDiametroExisteDisponibilidad . Enabled = true ;
txtObservacionesExisteDisponibilidad . Enabled = true ;
txtCaudalReservado . Enabled = true ;
//txtDiametroPrevista.Enabled = true;
txtDiametroExisteDisponibilidad . Enabled = true ;
chkProblemasNiveles . Enabled = true ;
chkNoHayRed . Enabled = true ;
chkRedNoTieneCapacidad . Enabled = true ;
chkRedPrevista . Enabled = true ;
chkSistemaPrivado . Enabled = true ;
chkNoSeUbico . Enabled = true ;
chkOtrosOperadores . Enabled = true ;
txtOtrosOperadores . Enabled = true ;
rblRequiereCCR . Enabled = true ;
txtOtroMaterialPozoAguasAbajo . Enabled = true ;
txtOtroMaterialPozoAguasArriba . Enabled = true ;
txtObservacionesExtensionRamal . Enabled = true ;
rblUbicacionMedidor . Enabled = true ;
txtLindero . Enabled = true ;
txtObservacionesCritec . Enabled = true ;
//rblPrevista.Enabled = true;
//rblTipoPrevista.Enabled = true;
//txtOtrosPrevista.Enabled = true;
//txtDiametroPrevista.Enabled = true;
txtObservacionTipoCajaRegistro . Enabled = true ;
//txtOtrosPrevista.Visible = true;
//rblTipoMedidor.Enabled = true;
//rblDiametroMedidor.Enabled = true;
btnAprobar . Enabled = true ;
btnDenegar . Enabled = true ;
btnNuevo . Enabled = true ;
}
}
public void deshabilitarCampos ( )
{
//rblExisteNis.ClearSelection();
//txtNisExistente.Text = string.Empty;
txtNisExistente . Enabled = false ;
rblExisteNis . Enabled = false ;
rblEstructuraExistente . Enabled = false ;
txtTipoEstructuraExistente . Enabled = false ;
rblExisteDisponibilidad . Enabled = false ;
txtDisponibilidadAsociada . Enabled = false ;
txtOficioRecepcion . Enabled = false ;
txtSistemaAsociado . Enabled = false ;
txtCoordenadasPozoAguaArriba . Enabled = false ;
txtCoordenadasPozoAguaAbajo . Enabled = false ;
txtProfundidadPozoAguaArriba . Enabled = false ;
txtProfundidadPozoAguaAbajo . Enabled = false ;
rblDiametroPozoAguaArriba . Enabled = false ;
rblDiametroPozoAguaAbajo . Enabled = false ;
rblMaterialPozoAguaArriba . Enabled = false ;
rblMaterialPozoAguaAbajo . Enabled = false ;
chkNoLocalizadoPozoAguaArriba . Enabled = false ;
chkNoLocalizadoPozoAguaAbajo . Enabled = false ;
rblCarpetaRodamiento . Enabled = false ;
rblExisteCajaRegistro . Enabled = false ;
rblExistePosibilidadConexionGravedad . Enabled = false ;
rblExisteRedAlcantarillado . Enabled = false ;
rblCobraServicioManzana . Enabled = false ;
rblExisteRedAlcantarilladoPrevista . Enabled = false ;
rblCuentaPrevista . Enabled = false ;
rblDiametroPrevista . Enabled = false ;
rblTipoCajaRegistro . Enabled = false ;
rblTieneCapacidadHidraulica . Enabled = false ;
rblEnRutaNacional . Enabled = false ;
rblPropiedadFrenteA . Enabled = false ;
rblServiciosAfectanConexion . Enabled = false ;
txtOtroServiciosAfectanConexion . Enabled = false ;
rblNuevoServicio . Enabled = false ;
rblDiametroNuevoServicio . Enabled = false ;
txtDistanciaNuevoServicio . Enabled = false ;
rblDisponibilidadAS . Enabled = false ;
txtDiametroExisteDisponibilidad . Enabled = false ;
txtObservacionesExisteDisponibilidad . Enabled = false ;
chkProblemasNiveles . Enabled = false ;
chkNoHayRed . Enabled = false ;
chkRedNoTieneCapacidad . Enabled = false ;
chkRedPrevista . Enabled = false ;
chkSistemaPrivado . Enabled = false ;
chkNoSeUbico . Enabled = false ;
chkOtrosOperadores . Enabled = false ;
txtOtrosOperadores . Enabled = false ;
rblRequiereCCR . Enabled = false ;
txtOtroMaterialPozoAguasAbajo . Enabled = false ;
txtOtroMaterialPozoAguasArriba . Enabled = false ;
txtObservacionesExtensionRamal . Enabled = false ;
rblUbicacionMedidor . Enabled = false ;
txtLindero . Enabled = false ;
txtObservacionesCritec . Enabled = false ;
//rblPrevista.Enabled = false;
//rblTipoPrevista.Enabled = false;
//txtOtrosPrevista.Enabled = false;
txtCaudalReservado . Enabled = true ;
//txtDiametroPrevista.Enabled = false;
txtObservacionTipoCajaRegistro . Enabled = false ;
btnAprobar . Enabled = false ;
btnDenegar . Enabled = false ;
btnNuevo . Enabled = false ;
}
public void limpiarCampos ( )
{
//rblExisteNis.ClearSelection();
//txtNisExistente.Text = string.Empty;
txtLatitud . Text = string . Empty ;
txtLongitud . Text = string . Empty ;
rblEstructuraExistente . ClearSelection ( ) ;
rblEstructuraExistente . SelectedValue = "false" ;
txtTipoEstructuraExistente . Text = string . Empty ;
rblExisteDisponibilidad . ClearSelection ( ) ;
rblExisteDisponibilidad . SelectedValue = "false" ;
txtDisponibilidadAsociada . Text = string . Empty ;
txtOficioRecepcion . Text = string . Empty ;
txtSistemaAsociado . Text = string . Empty ;
txtCoordenadasPozoAguaArriba . Text = string . Empty ;
txtCoordenadasPozoAguaAbajo . Text = string . Empty ;
txtProfundidadPozoAguaArriba . Text = string . Empty ;
txtProfundidadPozoAguaAbajo . Text = string . Empty ;
rblDiametroPozoAguaArriba . SelectedValue = "1" ; //150
rblDiametroPozoAguaAbajo . SelectedValue = "1" ; //150
rblMaterialPozoAguaArriba . Text = "1" ; //concreto
rblMaterialPozoAguaAbajo . Text = "1" ; //concreto
chkNoLocalizadoPozoAguaArriba . Checked = false ;
chkNoLocalizadoPozoAguaAbajo . Checked = false ;
txtDiametroExisteDisponibilidad . Text = string . Empty ;
txtObservacionesExisteDisponibilidad . Text = string . Empty ;
txtObservacionesExtensionRamal . Text = string . Empty ;
txtLindero . Text = string . Empty ;
txtObservacionesCritec . Text = string . Empty ;
//txtOtrosPrevista.Text = string.Empty;
//txtDiametroPrevista.Text = string.Empty;
txtObservacionTipoCajaRegistro . Text = string . Empty ;
txtOtroMaterialPozoAguasAbajo . Text = string . Empty ;
txtOtroMaterialPozoAguasArriba . Text = string . Empty ;
rblCarpetaRodamiento . ClearSelection ( ) ;
rblCarpetaRodamiento . SelectedValue = "1" ; //Asfalto
rblExisteCajaRegistro . ClearSelection ( ) ;
rblExisteCajaRegistro . SelectedValue = "false" ;
rblExistePosibilidadConexionGravedad . ClearSelection ( ) ;
rblExistePosibilidadConexionGravedad . SelectedValue = "false" ;
rblExisteRedAlcantarillado . ClearSelection ( ) ;
rblExisteRedAlcantarillado . SelectedValue = "false" ;
rblCobraServicioManzana . ClearSelection ( ) ;
rblCobraServicioManzana . SelectedValue = "false" ;
rblExisteRedAlcantarilladoPrevista . ClearSelection ( ) ;
rblExisteRedAlcantarilladoPrevista . SelectedValue = "false" ;
rblCuentaPrevista . ClearSelection ( ) ;
rblCuentaPrevista . SelectedValue = "2" ;
rblDiametroPrevista . ClearSelection ( ) ;
rblDiametroPrevista . SelectedValue = "1" ;
rblTipoCajaRegistro . ClearSelection ( ) ;
rblTipoCajaRegistro . SelectedValue = "2" ; //H-100
rblTieneCapacidadHidraulica . ClearSelection ( ) ;
rblTieneCapacidadHidraulica . SelectedValue = "false" ;
rblEnRutaNacional . ClearSelection ( ) ;
rblEnRutaNacional . SelectedValue = "false" ;
rblPropiedadFrenteA . ClearSelection ( ) ;
rblPropiedadFrenteA . SelectedValue = "1" ; //calle publica
rblServiciosAfectanConexion . ClearSelection ( ) ;
rblServiciosAfectanConexion . SelectedValue = "1" ; //pluvial
rblNuevoServicio . ClearSelection ( ) ;
rblNuevoServicio . SelectedValue = "1" ; //2-1
rblDiametroNuevoServicio . ClearSelection ( ) ;
rblDiametroNuevoServicio . SelectedValue = "100" ;
txtDistanciaNuevoServicio . Text = string . Empty ;
rblDisponibilidadAS . ClearSelection ( ) ;
//rblDisponibilidadAS.SelectedValue = "false";
rblRequiereCCR . ClearSelection ( ) ;
//rblRequiereCCR.SelectedValue = "false";
rblUbicacionMedidor . ClearSelection ( ) ;
//rblUbicacionMedidor.SelectedValue = "false";
//rblPrevista.ClearSelection();
//rblPrevista.SelectedValue = "false";
//rblTipoPrevista.ClearSelection();
//rblTipoPrevista.SelectedValue = "1";//asfalto
chkProblemasNiveles . Checked = false ;
chkNoHayRed . Checked = false ;
chkRedNoTieneCapacidad . Checked = false ;
chkRedPrevista . Checked = false ;
chkSistemaPrivado . Checked = false ;
chkNoSeUbico . Checked = false ;
chkOtrosOperadores . Checked = false ;
txtOtrosOperadores . Text = string . Empty ;
txtOtroServiciosAfectanConexion . Text = string . Empty ;
btnNuevo . Visible = true ;
btnAprobar . Visible = false ;
btnDenegar . Visible = false ;
dvOtrosOperadores . Visible = false ;
dvDiametroNuevoServicio . Visible = true ;
dvDistanciaNuevoServicio . Visible = true ;
divNoExisteDisponibilidad . Visible = false ;
divSiExisteDisponibilidad . Visible = false ;
divCCH2 . Visible = false ;
Div2 . Visible = false ;
dvOtroMaterialPozoAguasArriba . Visible = false ;
dvOtroMaterialPozoAguasAbajo . Visible = false ;
}
public bool ValidarCampos ( )
{
try
{
//if (txtLatitud.Text == string.Empty)
//{
// txtOficioRecepcion.Focus();
// EjecutarScript("inicializaTab('formulario','Mensaje','Latitud.'); $('#address').focus();");
// return false;
//}
//if (txtLongitud.Text == string.Empty)
//{
// txtOficioRecepcion.Focus();
// EjecutarScript("inicializaTab('formulario','Mensaje','Longitud.'); $('#address').focus();");
// return false;
//}
//if (rblExisteNis.SelectedValue == "")
//{
// rblExisteNis.Focus();
// return false;
//}
//if (txtNisExistente.Text == string.Empty && rblExisteNis.SelectedValue == "1")
//{
// txtNisExistente.Focus();
// return false;
//}
if ( rblEstructuraExistente . SelectedValue = = "" )
{
rblEstructuraExistente . Focus ( ) ;
return false ;
}
if ( txtTipoEstructuraExistente . Text = = null & & rblEstructuraExistente . SelectedValue = = "1" )
{
txtTipoEstructuraExistente . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Tipo de estructura.');" ) ;
return false ;
}
if ( rblExisteDisponibilidad . SelectedValue = = "" )
{
rblExisteDisponibilidad . Focus ( ) ;
return false ;
}
if ( txtDisponibilidadAsociada . Text = = string . Empty & & rblExisteDisponibilidad . SelectedValue = = "1" )
{
txtDisponibilidadAsociada . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Disponibilidad asociada.');" ) ;
return false ;
}
//if (txtOficioRecepcion.Text == string.Empty)
//{
// txtOficioRecepcion.Focus();
// EjecutarScript("inicializaTab('formulario','Mensaje','Oficio de recepción');");
// return false;
//}
//if (txtSistemaAsociado.Text == string.Empty)
//{
// txtSistemaAsociado.Focus();
// return false;
//}
if ( chkNoLocalizadoPozoAguaArriba . Checked = = false )
{
if ( txtCoordenadasPozoAguaArriba . Text = = string . Empty )
{
txtCoordenadasPozoAguaArriba . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Coordenadas.');" ) ;
return false ;
}
if ( txtProfundidadPozoAguaArriba . Text = = string . Empty )
{
txtProfundidadPozoAguaArriba . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Profundidad.');" ) ;
return false ;
}
if ( rblDiametroPozoAguaArriba . SelectedValue = = string . Empty )
{
rblDiametroPozoAguaArriba . Focus ( ) ;
return false ;
}
if ( rblMaterialPozoAguaArriba . SelectedValue = = string . Empty )
{
rblMaterialPozoAguaArriba . Focus ( ) ;
return false ;
}
else
{
if ( rblMaterialPozoAguaArriba . SelectedValue = = "7" & & txtOtroMaterialPozoAguasArriba . Text = = string . Empty )
{
txtOtroMaterialPozoAguasArriba . Focus ( ) ;
}
}
}
//if (chkNoLocalizadoPozoAguaArriba.Text == string.Empty)
//{
// txtNoLocalizadoPozoAguaArriba.Focus();
// return false;
//}
if ( chkNoLocalizadoPozoAguaAbajo . Checked = = false )
{
if ( txtCoordenadasPozoAguaAbajo . Text = = string . Empty )
{
txtCoordenadasPozoAguaAbajo . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Coordenadas.');" ) ;
return false ;
}
if ( txtProfundidadPozoAguaAbajo . Text = = string . Empty )
{
txtProfundidadPozoAguaAbajo . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Profundidad.');" ) ;
return false ;
}
if ( rblDiametroPozoAguaAbajo . SelectedValue = = string . Empty )
{
rblDiametroPozoAguaAbajo . Focus ( ) ;
return false ;
}
if ( rblMaterialPozoAguaAbajo . Text = = string . Empty )
{
rblMaterialPozoAguaAbajo . Focus ( ) ;
return false ;
}
else
{
if ( rblMaterialPozoAguaAbajo . SelectedValue = = "7" & & txtOtroMaterialPozoAguasAbajo . Text = = string . Empty )
{
txtOtroMaterialPozoAguasAbajo . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Otro material.');" ) ;
}
}
}
//if (chkNoLocalizadoPozoAguaAbajo.Text == string.Empty)
//{
// txtNoLocalizadoPozoAguaAbajo.Focus();
// return false;
//}
if ( rblCarpetaRodamiento . SelectedValue = = "" )
{
rblCarpetaRodamiento . Focus ( ) ;
return false ;
}
if ( rblExisteCajaRegistro . SelectedValue = = "" )
{
rblExisteCajaRegistro . Focus ( ) ;
return false ;
}
if ( rblExistePosibilidadConexionGravedad . SelectedValue = = "" )
{
rblExistePosibilidadConexionGravedad . Focus ( ) ;
return false ;
}
if ( rblExisteRedAlcantarillado . SelectedValue = = "" )
{
rblExisteRedAlcantarillado . Focus ( ) ;
return false ;
}
if ( rblCobraServicioManzana . SelectedValue = = "" )
{
rblCobraServicioManzana . Focus ( ) ;
return false ;
}
if ( rblExisteRedAlcantarilladoPrevista . SelectedValue = = "" )
{
rblExisteRedAlcantarilladoPrevista . Focus ( ) ;
return false ;
}
if ( rblCuentaPrevista . SelectedValue = = "" )
{
rblCuentaPrevista . Focus ( ) ;
return false ;
}
else
{
if ( rblCuentaPrevista . SelectedValue = = "1" )
{
if ( rblDiametroPrevista . SelectedValue = = string . Empty )
{
rblDiametroPrevista . Focus ( ) ;
return false ;
}
}
}
if ( rblTipoCajaRegistro . SelectedValue = = "" )
{
rblTipoCajaRegistro . Focus ( ) ;
return false ;
}
if ( rblTieneCapacidadHidraulica . SelectedValue = = "" )
{
rblTieneCapacidadHidraulica . Focus ( ) ;
return false ;
}
if ( rblEnRutaNacional . SelectedValue = = "" )
{
rblEnRutaNacional . Focus ( ) ;
return false ;
}
if ( rblServiciosAfectanConexion . SelectedValue = = "" )
{
rblServiciosAfectanConexion . Focus ( ) ;
return false ;
}
else
{
if ( rblServiciosAfectanConexion . SelectedValue = = "5" & & txtOtroServiciosAfectanConexion . Text = = string . Empty ) //otros
{
txtOtroServiciosAfectanConexion . Focus ( ) ;
}
}
if ( rblNuevoServicio . SelectedValue = = "" )
{
rblNuevoServicio . Focus ( ) ;
return false ;
}
if ( rblDiametroNuevoServicio . SelectedValue = = "" )
{
rblDiametroNuevoServicio . Focus ( ) ;
return false ;
}
if ( rblNuevoServicio . SelectedValue . ToString ( ) ! = "7" )
{
if ( txtDistanciaNuevoServicio . Text = = string . Empty )
{
txtDistanciaNuevoServicio . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Distancia.');" ) ;
return false ;
}
}
if ( rblDisponibilidadAS . SelectedValue = = "" )
{
rblDisponibilidadAS . Focus ( ) ;
return false ;
}
else
{
if ( rblDisponibilidadAS . SelectedValue = = "true" )
{
if ( txtDiametroExisteDisponibilidad . Text = = string . Empty )
{
txtDiametroExisteDisponibilidad . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Tipo de diámetro.');" ) ;
return false ;
}
if ( txtObservacionesExisteDisponibilidad . Text = = string . Empty )
{
txtObservacionesExisteDisponibilidad . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Observaciones.');" ) ;
return false ;
}
}
if ( rblDisponibilidadAS . SelectedValue = = "false" )
{
if ( chkProblemasNiveles . Checked = = false & &
chkNoHayRed . Checked = = false & &
chkRedNoTieneCapacidad . Checked = = false & &
chkRedPrevista . Checked = = false & &
chkSistemaPrivado . Checked = = false & &
chkNoSeUbico . Checked = = false & &
chkOtrosOperadores . Checked = = false
)
{
chkProblemasNiveles . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Motivo de negación.');" ) ;
return false ;
}
if ( rblRequiereCCR . SelectedValue = = "" )
{
rblRequiereCCR . Focus ( ) ;
return false ;
}
else
{
if ( rblRequiereCCR . SelectedValue = = "true" )
{
if ( txtObservacionesExtensionRamal . Text = = string . Empty )
{
txtObservacionesExtensionRamal . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Observaciones de la mejora.');" ) ;
return false ;
}
}
}
if ( chkOtrosOperadores . Checked = = true )
{
if ( txtOtrosOperadores . Text = = string . Empty )
{
txtOtrosOperadores . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Otros operadores.');" ) ;
}
}
}
}
if ( rblUbicacionMedidor . SelectedValue = = "" )
{
rblUbicacionMedidor . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Ubicación del sevicio.');" ) ;
return false ;
}
if ( txtLindero . Text = = string . Empty )
{
txtLindero . Focus ( ) ;
EjecutarScript ( "inicializaTab('formulario','Mensaje','Lindero.');" ) ;
return false ;
}
//if (rblPrevista.SelectedValue == "")
//{
// rblPrevista.Focus();
// return false;
//}
//if (rblTipoPrevista.SelectedValue == "")
//{
// rblTipoPrevista.Focus();
// return false;
//}
//if (rblTipoPrevista.SelectedValue == "4")//Otro
//{
// if (txtOtrosPrevista.Text == string.Empty)
// {
// txtOtrosPrevista.Focus();
// return false;
// }
//}
}
catch ( Exception ex )
{
throw ex ;
}
return true ;
}
public bool validarSesion ( )
{
if (
Session [ "PKSOLICITUD" ] ! = null & &
Session [ "SOLICITUD" ] ! = null & &
Session [ "PKUSUARIOXDEPENDENCIA" ] ! = null & &
Session [ "LOGIN" ] ! = null & &
Session [ "PKPROGRAMACION" ] ! = null & &
Session [ "NACTIVIDAD" ] ! = null & &
Session [ "NOMBREEMPLEADO" ] ! = null & &
Session [ "DESCRIPCIONACTIVIDAD" ] ! = null
)
return true ;
else
return false ;
}
[System.Web.Services.WebMethod]
public static string CrearDocumentoPDF ( string Cuerpo , string strNombre )
{
string strResult = "" ;
/ *
* SE DEBE DAR PERMISOS DE ESCRITURA EN LA CARPETA PDF DEL WCFPDF AL USUARIO DE RED CON EL QUE ESTA LOGGEADA LA APLICACION EN EL APPPOOL
* /
try
{
//NOTAS:
//en el web.config service se debe tener el tag <binding name="Binding2" maxReceivedMessageSize="10485760"> para que reciba parametros de gran tamaño como el formulario que se esta enviando
//en routeConfig.cs se debe tener la siguiente configuracion settings.AutoRedirectMode = RedirectMode.Off;
//en el web.config de la aplicacion <binding name="BasicHttpBinding_IService1" sendTimeout="00:10:00"/>
ASPDF . Service1Client clsGenerarDocumento = new ASPDF . Service1Client ( ) ;
strResult = clsGenerarDocumento . Generar_Documento_PDF ( Cuerpo , strNombre + "-AS" ) ;
string sourcePath = strResult ;
string strNombreArchivo = System . IO . Path . GetFileName ( strResult ) ;
string pdfPath = ConfigurationManager . AppSettings [ "DocumentosPDF" ] . ToString ( ) + @"\" + strNombre + @"\" + strNombreArchivo ;
//string pdfPath = ConfigurationManager.AppSettings["DocumentosPDF"].ToString() + @"\" + "AS" + @"\" + strNombreArchivo + "-AS";
if ( System . IO . File . Exists ( strResult ) )
{
if ( ! System . IO . Directory . Exists ( ConfigurationManager . AppSettings [ "DocumentosPDF" ] . ToString ( ) + @"\" + strNombre ) )
System . IO . Directory . CreateDirectory ( ConfigurationManager . AppSettings [ "DocumentosPDF" ] . ToString ( ) + @"\" + strNombre ) ;
System . IO . File . Copy ( strResult , pdfPath , true ) ;
}
#region formulario agua potable
//limpiarCampos();
string strNombreCarta = strNombre ;
Documento oDoc = new Documento ( ) ;
//string pdfPathCriterioAP = ConfigurationManager.AppSettings["DocumentosPDF"].ToString() + @"\" + strNombre + @"\" + strNombreArchivo + "-AS.pdf";
//targetURL = "'../../DocumentosPDF/" + strNumSolicitudTMP + "/" + strNombreCarta + "-AP.pdf'";
if ( System . IO . File . Exists ( pdfPath ) )
{
2021-02-10 23:17:05 +00:00
//byte[] bDoc = System.IO.File.ReadAllBytes(pdfPath);
////se carga el archivo y el registro a vision 2020
//string strResultado = oDoc.Archivar_Documento(strNombre.ToString().Trim() + "|" + "Criterio técnico AS", strNombreCarta.ToString().Replace(" ", "_") + "-AS.pdf", bDoc);
//if (strResultado == string.Empty)
//{
// //File.Delete(pdfPath);
//}
2021-01-22 14:59:35 +00:00
}
#endregion
//strResult = strResult;
}
catch ( Exception ex )
{
strResult = ex . Message ;
throw ex ;
}
var uri = new System . Uri ( strResult , UriKind . Absolute ) ;
//System.Diagnostics.Process proc = new System.Diagnostics.Process();
//proc.StartInfo.FileName = strResult;
//proc.Start();
//proc.Close();
return uri . ToString ( ) ;
}
#region Métodos para generar token de seguridad del firmador web
protected void btnGuardarPDF_Click ( object sender , EventArgs e )
{
try
{
//FirmadorWeb.FirmadorWebSvcClient cliente = new FirmadorWeb.FirmadorWebSvcClient();
//if (documento != null && documento.Firmas.Count() > 0)
//{
// byte[] contenido = cliente.ObtenerContenidoDocumento(
// long.Parse(ViewState["DocumentoID"].ToString()),
// CodigoSistema);
// System.IO.File.WriteAllBytes(ConfigurationManager.AppSettings["DocumentosPDF"].ToString() + @"\" + Session["SOLICITUD"].ToString() + @"\" + documento.Nombre, contenido);
// ViewState.Remove("DocumentoID");
// var uri = new System.Uri(ConfigurationManager.AppSettings["DocumentosPDF"].ToString() + @"\" + Session["SOLICITUD"].ToString() + @"\" + documento.Nombre, UriKind.Absolute);
// System.Diagnostics.Process proc = new System.Diagnostics.Process();
// proc.StartInfo.FileName = ConfigurationManager.AppSettings["DocumentosPDF"].ToString() + @"\" + Session["SOLICITUD"].ToString() + @"\" + documento.Nombre;
// proc.Start();
// proc.Close();
//}
//else
//{
// MensajeAlerta("El documento no se firmó correctamente por favor vuelava a intentarlo.");
//}
ViewState [ "MODO" ] = string . Empty ;
ViewState [ "Documento" ] = string . Empty ;
}
catch ( Exception ex )
{
MensajeError ( "Se produjo un error al firmar el documento pdf." , ex ) ;
}
}
#endregion
#endregion
#region Metodos Controles a Datos ( R5 )
/// <summary>
/// guarda y modifica registros en la tabla.
/// </summary>
/// <returns></returns>
private int GuardarDatosVisitaSolicitud ( ) //M0
{
int nValorRetornado = 0 ;
int nPkInspeccion = 0 ;
int nPkInspeccionAS = 0 ;
int nPKNegacionDisponibilidad = 0 ;
int nPKPozoAguas = 0 ;
int nPKDiametroPrevistaAS = 0 ;
int nPKNoExisteDisponibilidadCritTecnico = 0 ;
int nPKCreacionCritTec = 0 ;
int nPKValorNumerico = 0 ;
int nPKOtroServicioAfectaConexion = 0 ;
int nPKOtrosOperadores = 0 ;
int nPKExisteDisponibilidad = 0 ;
int nPKCroquis = 0 ;
int nPKInspeccionUbicaMedidor = 0 ;
int nPKOtroMaterialPozoAguaArriba = 0 ;
int nPKOtroMaterialPozoAguaAbajo = 0 ;
int nPKObservacionesCritec = 0 ;
TransaccionDAL tdlTransaccion = null ; // new TransaccionDAL("SIGDD");
// tdlTransaccion.BeginTransaction();
try
{
string strModo = ViewState [ "MODO" ] . ToString ( ) ;
if ( ValidarCampos ( ) )
{
if ( strModo = = "Nuevo" )
{
nPkInspeccion = GuardarInspeccionGeneral ( tdlTransaccion ) ;
if ( nPkInspeccion ! = 0 )
{
nPkInspeccionAS = GuardarInspeccionAS ( nPkInspeccion , tdlTransaccion ) ;
if ( nPkInspeccionAS ! = 0 )
nPKPozoAguas = GuardarPozoAguas ( nPkInspeccionAS , tdlTransaccion ) ;
if ( nPKPozoAguas ! = 0 & & rblMaterialPozoAguaArriba . SelectedValue = = "7" )
nPKOtroMaterialPozoAguaArriba = GuardarOtroMaterialPozoAguaArriba ( nPkInspeccionAS , tdlTransaccion ) ;
if ( nPKPozoAguas ! = 0 & & rblMaterialPozoAguaAbajo . SelectedValue = = "7" )
nPKOtroMaterialPozoAguaAbajo = GuardarOtroMaterialPozoAguaAbajo ( nPkInspeccionAS , tdlTransaccion ) ;
if ( nPkInspeccionAS ! = 0 & & rblCuentaPrevista . SelectedValue = = "1" )
nPKDiametroPrevistaAS = GuardarDiametroPrevistaAS ( nPkInspeccionAS , tdlTransaccion ) ;
if ( nPkInspeccionAS ! = 0 & & rblDisponibilidadAS . SelectedValue . ToLower ( ) . Trim ( ) = = "false" )
{
nPKNegacionDisponibilidad = GuardarNegaciondisponibilidad ( nPkInspeccionAS , tdlTransaccion ) ;
}
if ( nPkInspeccionAS ! = 0 ) //rblRequiereCCR.SelectedValue == "false")
{
nPKNoExisteDisponibilidadCritTecnico = GuardarNoExisteDisponibilidadCriterioTecnico ( nPkInspeccionAS , tdlTransaccion ) ;
}
if ( nPkInspeccionAS ! = 0 )
{
nPKCreacionCritTec = GuardarCreacionCritTec ( nPKNoExisteDisponibilidadCritTecnico , tdlTransaccion ) ;
if ( nPKCreacionCritTec = = 0 )
{
throw new System . ArgumentException ( "No se pudo finalizar el ingreso del formulario vuelva a intentar de nuevo - CCR" , "Formulario de Agua Potable" ) ;
}
}
if ( chkOtrosOperadores . Checked = = true & & nPKNegacionDisponibilidad ! = 0 & & nPkInspeccionAS ! = 0 )
nPKOtrosOperadores = GuardarOtrosOperadores ( nPkInspeccionAS , tdlTransaccion ) ;
if ( nPkInspeccionAS ! = 0 & & bool . Parse ( rblDisponibilidadAS . SelectedValue ) = = true )
nPKExisteDisponibilidad = GuardarExisteDispAlcantSan ( nPkInspeccionAS , tdlTransaccion ) ;
if ( nPkInspeccion ! = 0 )
nPKInspeccionUbicaMedidor = GuardarInspeccionubicamedidor ( nPkInspeccion , tdlTransaccion ) ;
if ( nPkInspeccionAS ! = 0 & & int . Parse ( rblServiciosAfectanConexion . SelectedValue ) = = 5 )
nPKOtroServicioAfectaConexion = GuardarOtroServicioAfectaConexion ( nPkInspeccionAS , tdlTransaccion ) ;
//if (nPkInspeccionAS != 0 && int.Parse(rblNuevoServicio.SelectedValue) == 5)//diametro nuevo servicio
nPKValorNumerico = GuardarValorNuevoServicio ( nPkInspeccionAS , rblDiametroNuevoServicio . SelectedValue . ToString ( ) , tdlTransaccion , 1 ) ;
//if (nPkInspeccionAS != 0 && int.Parse(rblNuevoServicio.SelectedValue) == 6)//distancia nuevo servicio
nPKValorNumerico = GuardarValorNuevoServicio ( nPkInspeccionAS , txtDistanciaNuevoServicio . Text , tdlTransaccion , 2 ) ;
//if (nPkInspeccionAS != 0 && int.Parse(rblTipoPrevista.SelectedValue) == 4) //Otro
// nPKOtrosprevista = GuardarOtroPrevista(nPkInspeccionAS, tdlTransaccion);
if ( nPkInspeccionAS ! = 0 )
nPKCroquis = GuardarCroquis ( nPkInspeccion , tdlTransaccion ) ;
if ( nPkInspeccionAS ! = 0 )
nPKObservacionesCritec = GuardarObservacionesCritec ( nPkInspeccionAS , tdlTransaccion ) ;
nValorRetornado = nPkInspeccionAS ;
llenarGridVisitaSolicitud ( ) ;
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . INSERT . ToString ( ) ,
MensajesBitacora . IngresarRegistro + ": Se ha ingresado un formulario de criterio técnico de alcantarillado sanitario " + nPkInspeccion . ToString ( ) . Trim ( ) + " para la solicitud " + Session [ "SOLICITUD" ] . ToString ( ) ,
Path . GetFileNameWithoutExtension ( Page . AppRelativeVirtualPath ) ,
Convert . ToInt32 ( ConfigurationManager . AppSettings [ "pkApp" ] )
) ;
}
}
#region modificar
if ( strModo = = "Modificar" )
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . PKINSPECCION = int . Parse ( Session [ "PKINSPECCION" ] . ToString ( ) ) ;
DataSet dsInspeccion = objInspeccionasBL . listarInspeccionesAS ( null ) ;
if ( dsInspeccion . Tables [ 0 ] . Rows . Count ! = 0 )
{
nPkInspeccion = int . Parse ( Session [ "PKINSPECCION" ] . ToString ( ) ) ;
nPkInspeccion = ModificarInspeccionGeneral ( tdlTransaccion ) ;
if ( nPkInspeccion ! = 0 )
{
nPkInspeccionAS = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKINSPECCIONAS" ] . ToString ( ) ) ;
nPkInspeccionAS = ModificarInspeccionAS ( nPkInspeccionAS , tdlTransaccion ) ;
if ( nPkInspeccionAS ! = 0 )
{
nPKPozoAguas = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKPOZOAGUAS" ] . ToString ( ) ) ;
nPKPozoAguas = ModificarPozoAguas ( nPKPozoAguas , tdlTransaccion ) ;
}
if ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKOTROMATERIALPOZOAGUAARRIBA" ] . ToString ( ) = = string . Empty )
{
nPKOtroMaterialPozoAguaArriba = GuardarOtroMaterialPozoAguaArriba ( nPkInspeccionAS , tdlTransaccion ) ;
}
else
{
if ( nPKPozoAguas ! = 0 & & rblMaterialPozoAguaArriba . SelectedValue = = "7" )
{
nPKOtroMaterialPozoAguaArriba = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKOTROMATERIALPOZOAGUAARRIBA" ] . ToString ( ) ) ;
nPKOtroMaterialPozoAguaArriba = ModificarOtroMaterialPozoAguaArriba ( nPKOtroMaterialPozoAguaArriba , tdlTransaccion ) ;
}
}
if ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKOTROMATERIALPOZOAGUAABAJO" ] . ToString ( ) = = string . Empty )
{
nPKOtroMaterialPozoAguaAbajo = GuardarOtroMaterialPozoAguaAbajo ( nPkInspeccionAS , tdlTransaccion ) ;
}
else
{
if ( nPKPozoAguas ! = 0 & & rblMaterialPozoAguaAbajo . SelectedValue = = "7" )
{
nPKOtroMaterialPozoAguaAbajo = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKOTROMATERIALPOZOAGUAABAJO" ] . ToString ( ) ) ;
nPKOtroMaterialPozoAguaAbajo = ModificarOtroMaterialPozoAguaAbajo ( nPKOtroMaterialPozoAguaAbajo , tdlTransaccion ) ;
}
}
if ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKDIAMETROPREVISTAAS" ] . ToString ( ) = = string . Empty )
{
nPKOtroMaterialPozoAguaAbajo = GuardarDiametroPrevistaAS ( nPkInspeccionAS , tdlTransaccion ) ;
}
else
{
if ( nPkInspeccionAS ! = 0 & & rblCuentaPrevista . SelectedValue = = "1" )
{
nPKDiametroPrevistaAS = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKDIAMETROPREVISTAAS" ] . ToString ( ) ) ;
nPKDiametroPrevistaAS = ModificarDiametroPrevistaAS ( nPKDiametroPrevistaAS , tdlTransaccion ) ;
}
}
if ( nPkInspeccionAS ! = 0 & & rblDisponibilidadAS . SelectedValue = = "false" )
{
nPKNegacionDisponibilidad = ModificarNegaciondisponibilidad ( nPkInspeccionAS , tdlTransaccion ) ;
}
if ( rblRequiereCCR . SelectedValue = = "false" )
{
if ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKNOEXISTEDISPONIBILIDAD" ] . ToString ( ) = = string . Empty )
{
nPKNoExisteDisponibilidadCritTecnico = GuardarNoExisteDisponibilidadCriterioTecnico ( nPkInspeccion , tdlTransaccion ) ;
}
else
{
nPKNoExisteDisponibilidadCritTecnico = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKNOEXISTEDISPONIBILIDAD" ] . ToString ( ) ) ;
nPKNoExisteDisponibilidadCritTecnico = ModificarNoExisteDisponibilidadCriterioTecnico ( nPKNoExisteDisponibilidadCritTecnico , tdlTransaccion ) ;
}
}
if ( nPKNoExisteDisponibilidadCritTecnico ! = 0 )
{
if ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKCREACIONCRITTEC" ] . ToString ( ) = = string . Empty )
{
nPKCreacionCritTec = GuardarCreacionCritTec ( nPKNoExisteDisponibilidadCritTecnico , tdlTransaccion ) ;
if ( nPKCreacionCritTec = = 0 )
{
throw new System . ArgumentException ( "No se pudo finalizar el ingreso del formulario vuelva a intentar de nuevo - CCR" , "Formulario de Agua Potable" ) ;
}
}
else
{
nPKCreacionCritTec = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKCREACIONCRITTEC" ] . ToString ( ) ) ;
nPKCreacionCritTec = ModificarCreacionCritTec ( nPKCreacionCritTec , tdlTransaccion ) ;
}
}
if ( chkOtrosOperadores . Checked = = true )
{
if ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKOTROSOPERADORES" ] . ToString ( ) = = string . Empty )
nPKOtrosOperadores = GuardarOtrosOperadores ( nPkInspeccionAS , tdlTransaccion ) ;
else
{
nPKOtrosOperadores = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKOTROSOPERADORES" ] . ToString ( ) ) ;
nPKOtrosOperadores = ModificarOtrosOperadores ( nPKOtrosOperadores , tdlTransaccion ) ;
}
}
if ( nPkInspeccionAS ! = 0 & & bool . Parse ( rblDisponibilidadAS . SelectedValue ) = = true )
{
nPKExisteDisponibilidad = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKEXISTEDISPALCANTSAN" ] . ToString ( ) ) ;
nPKExisteDisponibilidad = ModificarExisteDispAlcantSan ( nPKExisteDisponibilidad , tdlTransaccion ) ;
}
if ( nPkInspeccionAS ! = 0 )
{
nPKInspeccionUbicaMedidor = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKINSPECCIONUBICAMEDIDOR" ] . ToString ( ) ) ;
nPKInspeccionUbicaMedidor = ModificarInspeccionubicamedidor ( nPKInspeccionUbicaMedidor , tdlTransaccion ) ;
}
//if (nPkInspeccionAS != 0)
//{
// nPKTipoprevista = int.Parse(dsInspeccion.Tables[0].Rows[0]["PKTIPOPREVISTA"].ToString());
// nPKTipoprevista = ModificarTipoPrevista(nPKTipoprevista, tdlTransaccion);
//}
if ( nPkInspeccionAS ! = 0 & & int . Parse ( rblServiciosAfectanConexion . SelectedValue ) = = 5 )
{
if ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKOTROSERVICIOAFECTACONEXION" ] . ToString ( ) = = string . Empty )
nPKOtroServicioAfectaConexion = GuardarOtroServicioAfectaConexion ( nPkInspeccionAS , tdlTransaccion ) ;
else
{
nPKOtroServicioAfectaConexion = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKOTROSERVICIOAFECTACONEXION" ] . ToString ( ) ) ;
nPKOtroServicioAfectaConexion = ModificarOtroServicioAfectaConexion ( nPKOtroServicioAfectaConexion , tdlTransaccion ) ;
}
}
nPKValorNumerico = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKVALORNUEVOSERVICIODIAMETRO" ] . ToString ( ) ) ;
nPKValorNumerico = ModificarValorNuevoServicio ( nPKValorNumerico , rblDiametroNuevoServicio . SelectedValue . ToString ( ) , tdlTransaccion ) ;
//if (nPkInspeccionAS != 0 && int.Parse(rblNuevoServicio.SelectedValue) == 5)
//{
// if (dsInspeccion.Tables[0].Rows[0]["PKVALORNUEVOSERVICIO"].ToString() == string.Empty)
// nPKValorNumerico = GuardarValorNuevoServicio(nPkInspeccionAS, rblDiametroNuevoServicio.SelectedValue.ToString(), tdlTransaccion,1);
// else
// {
// nPKValorNumerico = int.Parse(dsInspeccion.Tables[0].Rows[0]["PKVALORNUEVOSERVICIO"].ToString());
// nPKValorNumerico = ModificarValorNuevoServicio(nPKValorNumerico, rblDiametroNuevoServicio.SelectedValue.ToString(), tdlTransaccion);
// }
//}
nPKValorNumerico = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKVALORNUEVOSERVICIODISTANCIA" ] . ToString ( ) ) ;
nPKValorNumerico = ModificarValorNuevoServicio ( nPKValorNumerico , txtDistanciaNuevoServicio . Text , tdlTransaccion ) ;
//if (nPkInspeccionAS != 0 && int.Parse(rblNuevoServicio.SelectedValue) == 6)
//{
// if (dsInspeccion.Tables[0].Rows[0]["PKVALORNUEVOSERVICIO"].ToString() == string.Empty)
// nPKValorNumerico = GuardarValorNuevoServicio(nPkInspeccionAS, txtDistanciaNuevoServicio.Text, tdlTransaccion);
// else
// {
// nPKValorNumerico = int.Parse(dsInspeccion.Tables[0].Rows[0]["PKVALORNUEVOSERVICIO"].ToString());
// nPKValorNumerico = ModificarValorNuevoServicio(nPKValorNumerico, txtDistanciaNuevoServicio.Text, tdlTransaccion);
// }
//}
if ( nPkInspeccionAS ! = 0 )
{
nPKCroquis = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKCROQUIS" ] . ToString ( ) ) ;
nPKCroquis = ModificarCroquis ( nPKCroquis , tdlTransaccion ) ;
}
if ( nPkInspeccionAS ! = 0 & & dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKOBSERVACIONESCRITEC" ] . ToString ( ) ! = string . Empty )
{
nPKObservacionesCritec = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKOBSERVACIONESCRITEC" ] . ToString ( ) ) ;
nPKObservacionesCritec = ModificarObservacionesCritec ( nPKObservacionesCritec , tdlTransaccion ) ;
}
nValorRetornado = nPkInspeccionAS ;
llenarGridVisitaSolicitud ( ) ;
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . INSERT . ToString ( ) ,
MensajesBitacora . IngresarRegistro + ": Se ha modificado el formulario de criterio técnico de alcantarillado sanitario " + nPkInspeccion . ToString ( ) . Trim ( ) ,
"frwCriterioAS.aspx" ,
Convert . ToInt32 ( ConfigurationManager . AppSettings [ "pkApp" ] )
) ;
}
}
}
#endregion
}
else
{
nValorRetornado = 0 ;
}
}
catch ( Exception ex )
{
throw ex ;
}
finally
{
//tdlTransaccion.CommitTransaction();
}
return nValorRetornado ;
}
private int GuardarInspeccionGeneral ( TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . ESTRUCTURAEXISTENTEINSPECCION = bool . Parse ( rblEstructuraExistente . SelectedValue . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . TIPOESTRUCTURA = txtTipoEstructuraExistente . Text ;
objInspeccionasBL . objinspeccionasEL . DISPONIBILIDADASOCIADAEXISTENTEINSPECCION = bool . Parse ( rblExisteDisponibilidad . SelectedValue . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . DESCRIPCIONDISPONIBILIDADEXISTENTEINSPECCION = txtDisponibilidadAsociada . Text ;
objInspeccionasBL . objinspeccionasEL . CONDOMINIO = txtOficioRecepcion . Text ;
objInspeccionasBL . objinspeccionasEL . FECHAINSPECCION = DateTime . Now ;
objInspeccionasBL . objinspeccionasEL . FKESTADOINSPECCION = 1 ; //Asignada
objInspeccionasBL . objinspeccionasEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarInspeccionGeneral ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarInspeccionAS ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . SISTEMAASOCIADOINSPECCIONAP = txtSistemaAsociado . Text ;
objInspeccionasBL . objinspeccionasEL . CAUDALRECOLECCIONINSPECCIONAS = decimal . Parse ( txtCaudalReservado . Text ) ;
objInspeccionasBL . objinspeccionasEL . EXISTECAJAREGVECINOSINSPECCIONAS = bool . Parse ( rblExisteCajaRegistro . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . EXISTECONEXAGRAVEDADNSPECCIONAS = bool . Parse ( rblExistePosibilidadConexionGravedad . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . EXISTEREDALCINSPECCIONAS = bool . Parse ( rblExisteRedAlcantarillado . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . COBRASERVMANZANAINSPECCIONAS = bool . Parse ( rblCobraServicioManzana . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . EXISTEREDALCPREVISTAINSPECCIONAS = bool . Parse ( rblExisteRedAlcantarilladoPrevista . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . ENRUTANACIONALINSPECCIONAS = bool . Parse ( rblEnRutaNacional . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . PROPIEDADFRENTEAINSPECCIONAS = int . Parse ( rblPropiedadFrenteA . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . TIENECAPACIDADHIDRAULICAINSPECCIONAS = bool . Parse ( rblTieneCapacidadHidraulica . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCION = p_nPK ;
objInspeccionasBL . objinspeccionasEL . FKCARPETARODAMIENTO = int . Parse ( rblCarpetaRodamiento . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . FKCUENTAPREVISTA = int . Parse ( rblCuentaPrevista . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . FKTIPOCAJAREGISTRO = int . Parse ( rblTipoCajaRegistro . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . FKSERVICIOSAFECTANCONEXION = int . Parse ( rblServiciosAfectanConexion . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . FKNUEVOSERVICIO = int . Parse ( rblNuevoServicio . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . EXISTEDISPONIBILIDADINSPECCIONAS = bool . Parse ( rblDisponibilidadAS . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . OBSERVACIONESCAJAREGISTRO = txtObservacionTipoCajaRegistro . Text ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarInspeccionAS ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarPozoAguas ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PROFUNDIDADARRIBAPOZOAGUAS = txtProfundidadPozoAguaArriba . Text ;
objInspeccionasBL . objinspeccionasEL . DIAMETROARRIBAPOZOAGUAS = rblDiametroPozoAguaArriba . SelectedValue ;
objInspeccionasBL . objinspeccionasEL . MATERIALARRIBAPOZOAGUAS = rblMaterialPozoAguaArriba . SelectedValue ;
objInspeccionasBL . objinspeccionasEL . NOLOCALIZADOARRIBAPOZOAGUAS = chkNoLocalizadoPozoAguaArriba . Checked ;
objInspeccionasBL . objinspeccionasEL . COORDENADASARRIBAPOZOAGUAS = txtCoordenadasPozoAguaArriba . Text ;
objInspeccionasBL . objinspeccionasEL . PROFUNDIDADABAJOPOZOAGUAS = txtProfundidadPozoAguaAbajo . Text ;
objInspeccionasBL . objinspeccionasEL . DIAMETROABAJOPOZOAGUAS = rblDiametroPozoAguaAbajo . SelectedValue ;
objInspeccionasBL . objinspeccionasEL . MATERIALABAJOPOZOAGUAS = rblMaterialPozoAguaAbajo . SelectedValue ;
objInspeccionasBL . objinspeccionasEL . NOLOCALIZADOABAJOPOZOAGUAS = chkNoLocalizadoPozoAguaAbajo . Checked ;
objInspeccionasBL . objinspeccionasEL . COORDENADASABAJOPOZOAGUAS = txtCoordenadasPozoAguaAbajo . Text ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAS = p_nPK ; //pozo aguas arriba t_adm_tipopozo
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarPozoAguas ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
/// <summary>
/// Inserta el valor para el campo otro material de pozo agua
/// </summary>
/// <param name="p_nPK"></param>
/// <param name="p_tipoPozo"></param>
/// <param name="p_tdlTransaccion"></param>
/// <returns></returns>
private int GuardarOtroMaterialPozoAguaArriba ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . VALOROTROMATERIALPOZOAGUAARRIBA = txtOtroMaterialPozoAguasArriba . Text ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAPAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarOtroMaterialPozoAguaArriba ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
/// <summary>
/// Inserta el valor para el campo otro material de pozo agua
/// </summary>
/// <param name="p_nPK"></param>
/// <param name="p_tipoPozo"></param>
/// <param name="p_tdlTransaccion"></param>
/// <returns></returns>
private int GuardarOtroMaterialPozoAguaAbajo ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . VALOROTROMATERIALPOZOAGUAABAJO = txtOtroMaterialPozoAguasAbajo . Text ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAPAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarOtroMaterialPozoAguaAbajo ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarDiametroPrevistaAS ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . VALORDIAMETROPREVISTA = int . Parse ( rblDiametroPrevista . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAPAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarDiametroPrevistaAS ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarNegaciondisponibilidad ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAPAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . FKTIPOINSPECCION = 2 ; // int.Parse(Session["PKTIPOINSPECCION"].ToString());//alcantarillado sanitario
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
if ( chkProblemasNiveles . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 11 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
if ( chkNoHayRed . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 12 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
if ( chkRedNoTieneCapacidad . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 13 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
if ( chkRedPrevista . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 14 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
if ( chkSistemaPrivado . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 15 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
if ( chkNoSeUbico . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 16 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
if ( chkOtrosOperadores . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 28 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarExisteDispAlcantSan ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . DIAMETRODISPONIBILIDADEXISTEDISPALCANTSAN = txtDiametroExisteDisponibilidad . Text ;
objInspeccionasBL . objinspeccionasEL . OBSERVACIONDISPONIBILIDADEXISTEDISPALCANTSAN = txtObservacionesExisteDisponibilidad . Text ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAPAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarExisteDispAlcantSan ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarNoExisteDisponibilidadCriterioTecnico ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
bool bExisteDisponibilidad = false ;
if ( rblRequiereCCR . SelectedValue . ToString ( ) ! = string . Empty )
bExisteDisponibilidad = bool . Parse ( rblRequiereCCR . SelectedValue . ToString ( ) ) ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . CRITECNICONOEXISTEDISPONIBILIDAD = bExisteDisponibilidad ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarNoExisteDisponibilidad ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarCreacionCritTec ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . OBSERVACIONESCRITTEC = txtObservacionesExtensionRamal . Text ;
objInspeccionasBL . objinspeccionasEL . FKNOEXISTEDISPONIBILIDAD = p_nPK ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarCreacionCritTec ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarInspeccionubicamedidor ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . LINDEROINSPECCIONUBICAMEDIDOR = txtLindero . Text ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCION = p_nPK ;
objInspeccionasBL . objinspeccionasEL . FKUBICAMEDIDOR = int . Parse ( rblUbicacionMedidor . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarInspeccionubicamedidor ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarCroquis ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
if ( txtLongitud . Text = = string . Empty )
txtLongitud . Text = "0.00" ;
if ( txtLatitud . Text = = string . Empty )
txtLatitud . Text = "0.00" ;
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . LONGITUD = decimal . Parse ( txtLongitud . Text . Replace ( "," , "." ) ) ;
objInspeccionasBL . objinspeccionasEL . LATITUD = decimal . Parse ( txtLatitud . Text . Replace ( "," , "." ) ) ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCION = p_nPK ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarCroquis ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
//private int GuardarTipoPrevista(int p_nPK, TransaccionDAL p_tdlTransaccion)
//{
// int pkResult = 0;
// try
// {
// objInspeccionasBL = new inspeccionasBL();
// //objInspeccionasBL.objinspeccionasEL.FKTIPOPREVISTA = int.Parse(rblTipoPrevista.SelectedValue);
// objInspeccionasBL.objinspeccionasEL.FKINSPECCIONAPAS = p_nPK;
// objInspeccionasBL.objinspeccionasEL.FKTIPOINSPECCION = 2;// int.Parse(Session["PKTIPOINSPECCION"].ToString());//ALCANTARILLADO SANITARIO
// objInspeccionasBL.objinspeccionasEL.ASTATE = true;
// pkResult = objInspeccionasBL.insertarTipoprevista(p_tdlTransaccion);
// }
// catch (Exception ex)
// { throw ex; }
// return pkResult;
//}
private int GuardarOtroPropiedadFrenteA ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . DESCRIPCIONOTROPROPIEDADFRENTEA = txtOtroPropiedadFrenteA . Text ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAPAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarOtroPropiedadFrenteA ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarOtroServicioAfectaConexion ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . DESCRIPCIONOTROSERVICIOAFECTANCONEXION = txtOtroServiciosAfectanConexion . Text ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAPAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarOtroServicioAfectaConexion ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarValorNuevoServicio ( int p_nPK , string p_valor , TransaccionDAL p_tdlTransaccion , int p_tipomedida )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . DESCRIPCIONVALORNUEVOSERVICIO = p_valor ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAPAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . FKTIPOMEDIDANUEVOSERVICIO = p_tipomedida ; //1:diametro,2:distancia
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarValorNuevoServicio ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarOtrosOperadores ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . DESCRIPCIONOTROSOPERADORES = txtOtrosOperadores . Text ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAPAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarOtrosOperadores ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarOtroPrevista ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
//objInspeccionasBL.objinspeccionasEL.DESCRIPCIONOTROPREVISTA = txtOtrosPrevista.Text;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAPAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . FKTIPOINSPECCION = 2 ; // int.Parse(Session["PKTIPOINSPECCION"].ToString());//ALCANTARILLADO SANITARIO
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarOtroprevista ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int GuardarObservacionesCritec ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . OBSERVACION = txtObservacionesCritec . Text ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAPAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . FKTIPOINSPECCION = 2 ; // int.Parse(Session["PKTIPOINSPECCION"].ToString());//ALCANTARILLADO SANITARIO
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . insertarObservacionCritec ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarInspeccionGeneral ( TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKINSPECCION = int . Parse ( Session [ "PKINSPECCION" ] . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . ESTRUCTURAEXISTENTEINSPECCION = bool . Parse ( rblEstructuraExistente . SelectedValue . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . TIPOESTRUCTURA = txtTipoEstructuraExistente . Text ;
objInspeccionasBL . objinspeccionasEL . DISPONIBILIDADASOCIADAEXISTENTEINSPECCION = bool . Parse ( rblExisteDisponibilidad . SelectedValue . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . DESCRIPCIONDISPONIBILIDADEXISTENTEINSPECCION = txtDisponibilidadAsociada . Text ;
objInspeccionasBL . objinspeccionasEL . CONDOMINIO = txtOficioRecepcion . Text ;
objInspeccionasBL . objinspeccionasEL . FECHAINSPECCION = DateTime . Now ;
objInspeccionasBL . objinspeccionasEL . FKESTADOINSPECCION = 1 ; //Asignada
objInspeccionasBL . objinspeccionasEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarInspecciongeneral ( ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarInspeccionAS ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . SISTEMAASOCIADOINSPECCIONAP = txtSistemaAsociado . Text ;
objInspeccionasBL . objinspeccionasEL . CAUDALRECOLECCIONINSPECCIONAS = decimal . Parse ( txtCaudalReservado . Text ) ;
objInspeccionasBL . objinspeccionasEL . EXISTECAJAREGVECINOSINSPECCIONAS = bool . Parse ( rblExisteCajaRegistro . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . EXISTECONEXAGRAVEDADNSPECCIONAS = bool . Parse ( rblExistePosibilidadConexionGravedad . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . EXISTEREDALCINSPECCIONAS = bool . Parse ( rblExisteRedAlcantarillado . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . COBRASERVMANZANAINSPECCIONAS = bool . Parse ( rblCobraServicioManzana . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . EXISTEREDALCPREVISTAINSPECCIONAS = bool . Parse ( rblExisteRedAlcantarilladoPrevista . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . TIENECAPACIDADHIDRAULICAINSPECCIONAS = bool . Parse ( rblTieneCapacidadHidraulica . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . ENRUTANACIONALINSPECCIONAS = bool . Parse ( rblEnRutaNacional . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . PROPIEDADFRENTEAINSPECCIONAS = int . Parse ( rblPropiedadFrenteA . SelectedValue ) ;
//objInspeccionasBL.objinspeccionasEL.FKINSPECCION = p_nPK;
objInspeccionasBL . objinspeccionasEL . FKCARPETARODAMIENTO = int . Parse ( rblCarpetaRodamiento . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . FKCUENTAPREVISTA = int . Parse ( rblCuentaPrevista . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . FKTIPOCAJAREGISTRO = int . Parse ( rblTipoCajaRegistro . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . FKSERVICIOSAFECTANCONEXION = int . Parse ( rblServiciosAfectanConexion . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . FKNUEVOSERVICIO = int . Parse ( rblNuevoServicio . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . EXISTEDISPONIBILIDADINSPECCIONAS = bool . Parse ( rblDisponibilidadAS . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . OBSERVACIONESCAJAREGISTRO = txtObservacionTipoCajaRegistro . Text ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarInspeccionas ( ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarNegaciondisponibilidad ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAPAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . FKTIPOINSPECCION = 2 ; // int.Parse(Session["PKTIPOINSPECCION"].ToString());//alcantarillado sanitario
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
//eliminar todos los registros e insertarlos de nuevo
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 11 ;
pkResult = objInspeccionasBL . eliminarNegaciondisponibilidad ( ) ;
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 12 ;
pkResult = objInspeccionasBL . eliminarNegaciondisponibilidad ( ) ;
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 13 ;
pkResult = objInspeccionasBL . eliminarNegaciondisponibilidad ( ) ;
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 14 ;
pkResult = objInspeccionasBL . eliminarNegaciondisponibilidad ( ) ;
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 15 ;
pkResult = objInspeccionasBL . eliminarNegaciondisponibilidad ( ) ;
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 16 ;
pkResult = objInspeccionasBL . eliminarNegaciondisponibilidad ( ) ;
if ( chkProblemasNiveles . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 11 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
if ( chkNoHayRed . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 12 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
if ( chkRedNoTieneCapacidad . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 13 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
if ( chkRedPrevista . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 14 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
if ( chkSistemaPrivado . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 15 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
if ( chkNoSeUbico . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 16 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
if ( chkOtrosOperadores . Checked )
{
objInspeccionasBL . objinspeccionasEL . FKTIPONEGACIONDISPONIBILIDAD = 28 ;
pkResult = objInspeccionasBL . insertarNegaciondisponibilidad ( p_tdlTransaccion ) ;
}
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarDiametroPrevistaAS ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKDIAMETROPREVISTAAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . VALORDIAMETROPREVISTA = int . Parse ( rblDiametroPrevista . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarDiametroPrevistaAS ( ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarExisteDispAlcantSan ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKEXISTEDISPALCANTSAN = p_nPK ;
objInspeccionasBL . objinspeccionasEL . DIAMETRODISPONIBILIDADEXISTEDISPALCANTSAN = txtDiametroExisteDisponibilidad . Text ;
objInspeccionasBL . objinspeccionasEL . OBSERVACIONDISPONIBILIDADEXISTEDISPALCANTSAN = txtObservacionesExisteDisponibilidad . Text . ToString ( ) ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarExisteDispAlcantSan ( ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarPozoAguas ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKPOZOAGUAS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . PROFUNDIDADARRIBAPOZOAGUAS = txtProfundidadPozoAguaArriba . Text ;
objInspeccionasBL . objinspeccionasEL . DIAMETROARRIBAPOZOAGUAS = rblDiametroPozoAguaArriba . SelectedValue ;
objInspeccionasBL . objinspeccionasEL . MATERIALARRIBAPOZOAGUAS = rblMaterialPozoAguaArriba . SelectedValue ;
objInspeccionasBL . objinspeccionasEL . NOLOCALIZADOARRIBAPOZOAGUAS = chkNoLocalizadoPozoAguaArriba . Checked ;
objInspeccionasBL . objinspeccionasEL . COORDENADASARRIBAPOZOAGUAS = txtCoordenadasPozoAguaArriba . Text ;
objInspeccionasBL . objinspeccionasEL . PROFUNDIDADABAJOPOZOAGUAS = txtProfundidadPozoAguaAbajo . Text ;
objInspeccionasBL . objinspeccionasEL . DIAMETROABAJOPOZOAGUAS = rblDiametroPozoAguaAbajo . SelectedValue ;
objInspeccionasBL . objinspeccionasEL . MATERIALABAJOPOZOAGUAS = rblMaterialPozoAguaAbajo . SelectedValue ;
objInspeccionasBL . objinspeccionasEL . NOLOCALIZADOABAJOPOZOAGUAS = chkNoLocalizadoPozoAguaAbajo . Checked ;
objInspeccionasBL . objinspeccionasEL . COORDENADASABAJOPOZOAGUAS = txtCoordenadasPozoAguaAbajo . Text ;
// objInspeccionasBL.objinspeccionasEL.FKINSPECCIONAS = p_nPK;//pozo aguas arriba t_adm_tipopozo
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarPozoAguas ( ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarNoExisteDisponibilidadCriterioTecnico ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKNOEXISTEDISPONIBILIDAD = p_nPK ;
objInspeccionasBL . objinspeccionasEL . CRITECNICONOEXISTEDISPONIBILIDAD = bool . Parse ( rblRequiereCCR . SelectedValue . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarNoExisteDisponibilidad ( ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarCreacionCritTec ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKCREACIONCRITTEC = p_nPK ;
objInspeccionasBL . objinspeccionasEL . OBSERVACIONESCRITTEC = txtObservacionesExtensionRamal . Text ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarCreacionCritTec ( ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarCroquis ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKCROQUIS = p_nPK ;
objInspeccionasBL . objinspeccionasEL . LONGITUD = decimal . Parse ( txtLongitud . Text ) ;
objInspeccionasBL . objinspeccionasEL . LATITUD = decimal . Parse ( txtLatitud . Text ) ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarCroquis ( ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarInspeccionubicamedidor ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKINSPECCIONUBICAMEDIDOR = p_nPK ;
objInspeccionasBL . objinspeccionasEL . LINDEROINSPECCIONUBICAMEDIDOR = txtLindero . Text ;
objInspeccionasBL . objinspeccionasEL . FKUBICAMEDIDOR = int . Parse ( rblUbicacionMedidor . SelectedValue ) ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarInspeccionubicamedidor ( ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
//private int ModificarTipoPrevista(int p_nPK, TransaccionDAL p_tdlTransaccion)
//{
// int pkResult = 0;
// try
// {
// objInspeccionasBL = new inspeccionasBL();
// objInspeccionasBL.objinspeccionasEL.PKTIPOPREVISTA = p_nPK;
// //objInspeccionasBL.objinspeccionasEL.FKTIPOPREVISTA = int.Parse(rblTipoPrevista.SelectedValue);
// objInspeccionasBL.objinspeccionasEL.ASTATE = true;
// pkResult = objInspeccionasBL.modificarTipoprevista();
// }
// catch (Exception ex)
// { throw ex; }
// return pkResult;
//}
private int ModificarOtroPropiedadFrenteA ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKOTROPROPIEDADFRENTEA = p_nPK ;
objInspeccionasBL . objinspeccionasEL . DESCRIPCIONOTROPROPIEDADFRENTEA = txtOtroPropiedadFrenteA . Text ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarOtroPropiedadFrenteA ( ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarObservacionesCritec ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKOBSERVACIONESCRITEC = p_nPK ;
objInspeccionasBL . objinspeccionasEL . OBSERVACION = txtObservacionesCritec . Text ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarObservacionCritec ( ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarOtroServicioAfectaConexion ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKOTROSERVICIOAFECTANCONEXION = p_nPK ;
objInspeccionasBL . objinspeccionasEL . DESCRIPCIONOTROSERVICIOAFECTANCONEXION = txtOtroServiciosAfectanConexion . Text ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarOtroServicioAfectaConexion ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarValorNuevoServicio ( int p_nPK , string p_valor , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKVALORNUEVOSERVICIO = p_nPK ;
objInspeccionasBL . objinspeccionasEL . DESCRIPCIONVALORNUEVOSERVICIO = p_valor ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarValorNuevoServicio ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
private int ModificarOtrosOperadores ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKOTROSOPERADORES = p_nPK ;
objInspeccionasBL . objinspeccionasEL . DESCRIPCIONOTROSOPERADORES = txtOtrosOperadores . Text ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarOtrosOperadores ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
/// <summary>
/// Inserta el valor para el campo otro material de pozo agua
/// </summary>
/// <param name="p_nPK"></param>
/// <param name="p_tipoPozo"> Cuando llega el valor 1 es pozoaguaarriba y 2 pozoaguaabajo </param>
/// <param name="p_tdlTransaccion"></param>
/// <returns></returns>
private int ModificarOtroMaterialPozoAguaArriba ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKOTROMATERIALPOZOAGUAARRIBA = p_nPK ;
objInspeccionasBL . objinspeccionasEL . VALOROTROMATERIALPOZOAGUAARRIBA = txtOtroMaterialPozoAguasArriba . Text ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarOtroMaterialPozoAguaArriba ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
/// <summary>
/// Inserta el valor para el campo otro material de pozo agua
/// </summary>
/// <param name="p_nPK"></param>
/// <param name="p_tipoPozo"> Cuando llega el valor 1 es pozoaguaarriba y 2 pozoaguaabajo </param>
/// <param name="p_tdlTransaccion"></param>
/// <returns></returns>
private int ModificarOtroMaterialPozoAguaAbajo ( int p_nPK , TransaccionDAL p_tdlTransaccion )
{
int pkResult = 0 ;
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . PKOTROMATERIALPOZOAGUAABAJO = p_nPK ;
objInspeccionasBL . objinspeccionasEL . VALOROTROMATERIALPOZOAGUAABAJO = txtOtroMaterialPozoAguasAbajo . Text ;
objInspeccionasBL . objinspeccionasEL . ASTATE = true ;
pkResult = objInspeccionasBL . modificarOtroMaterialPozoAguaAbajo ( p_tdlTransaccion ) ;
}
catch ( Exception ex )
{ throw ex ; }
return pkResult ;
}
/// <summary>
/// guarda y modifica registros en la tabla.
/// </summary>
/// <returns></returns>
///
private int GuardarDatosActividad ( string p_accion )
{
int nValorRetornado = 0 ;
try
{
AyABL . TRA . correoBL objcorreoBL = new AyABL . TRA . correoBL ( ) ;
string strModo = ViewState [ "MODO" ] . ToString ( ) ;
int nPkSolicitud = 0 ;
int nResultadoActualizar = 0 ;
string strMensajeContenido = "" ;
string strAsuntoCorreo = "" ;
string strPiePagina = "</BR> </BR></BR>AVISO DE CONFIDENCIALIDAD: este mensaje y la información incluida en él es confidencial y está dirigida únicamente al destinatario. Puede contener información privilegiada, confidencial, amparada por el secreto profesional o que no debe ser revelada. Si usted ha recibido este correo por error, por favor comunicarlo inmediatamente vía correo y tener la amabilidad de eliminarlo de su sistema. Queda notificado que no deberá copiar este mensaje, ni utilizar, divulgar, publicar o distribuir su contenido de modo alguno. Todo mensaje enviado a esta dirección de correo electrónico puede ser sujeto a inspección por alguien distinto de su receptor originario. La transmisión de correos no garantiza que el correo electrónico sea seguro o libre de error. Por consiguiente, se advierte que esta información pueda estar incompleta o ser poco precisa ya que toda información está sujeta a alterarse sin previo aviso.”" ;
solicitudBL objSolicitudBL = new solicitudBL ( ) ;
objSolicitudBL . objSolicitudEL . PK = int . Parse ( Session [ "PKPROGRAMACION" ] . ToString ( ) ) ;
objSolicitudBL . objSolicitudEL . ORDEN = int . Parse ( Session [ "NACTIVIDAD" ] . ToString ( ) ) ;
DataSet dsEncargadosActividades = objSolicitudBL . dsListaActividadesEncargado ( null ) ;
if ( dsEncargadosActividades . Tables [ 0 ] . Rows . Count > 0 )
{
string strEncargadoActividad = dsEncargadosActividades . Tables [ 0 ] . Rows [ 0 ] [ "PKRESPONSABLEACTIVIDAD" ] . ToString ( ) ;
ObservacionesActividadesBL objObservacionesBL = new ObservacionesActividadesBL ( ) ;
//objObservacionesBL.objobservacionesEL.FKNUMSOLICITUD = strNumSolicitudTMP;
objObservacionesBL . objobservacionesEL . DESCRIPCION = "\n" + DateTime . Now . ToString ( ) + " - " + Session [ "NOMBREEMPLEADO" ] . ToString ( ) + " - Se " + p_accion + " el formulario por parte del encargado de la revisión: " + Session [ "NOMBREEMPLEADO" ] . ToString ( ) ;
objObservacionesBL . objobservacionesEL . FKUSUARIOXDEPENDENCIA = int . Parse ( Session [ "PKUSUARIOXDEPENDENCIA" ] . ToString ( ) ) ;
objObservacionesBL . objobservacionesEL . PKRESPONSABLEACTIVIDAD = int . Parse ( strEncargadoActividad ) ;
objObservacionesBL . objobservacionesEL . Fecha = DateTime . Now ;
objObservacionesBL . objobservacionesEL . TIPO = 1 ;
//objObservacionesBL.objobservacionesEL.FKSOLICITUD = nPKSolicitud;
//objObservacionesBL.objobservacionesEL.USUARIO = Session["LOGIN"].ToString();
nValorRetornado = objObservacionesBL . insertarObservacionActividad ( ) ;
if ( nValorRetornado ! = 0 )
{
solicitudBL objSolicitud = new solicitudBL ( ) ;
//objSolicitud.objresponsableActividadEL.PK = int.Parse(Session["PKRESPONSABLEACTIVIDAD"].ToString());
//poner la actividad actual en estado correspondiente
objSolicitud . objresponsableActividadEL . FECHADEVOLUCION = DateTime . Now ;
foreach ( DataRow row in dsEncargadosActividades . Tables [ 0 ] . Rows )
{
objSolicitud . objresponsableActividadEL . PK = int . Parse ( row [ "PKRESPONSABLEACTIVIDAD" ] . ToString ( ) ) ;
if ( p_accion = = "aprueba" )
{
decimal nTiempoActividad = 0 ;
if ( row [ "CLASIFICACIONSOLICITUD" ] . ToString ( ) = = "Crecimiento vegetativo" )
nTiempoActividad = decimal . Parse ( row [ "TIEMPOCVACTIVIDAD" ] . ToString ( ) ) ;
if ( row [ "CLASIFICACIONSOLICITUD" ] . ToString ( ) = = "Desarrollo urbanistico" )
nTiempoActividad = decimal . Parse ( row [ "TIEMPODUACTIVIDAD" ] . ToString ( ) ) ;
char [ ] separadorColumna = { '.' } ;
string [ ] strArrayTiempo = nTiempoActividad . ToString ( ) . Replace ( "," , "." ) . Split ( separadorColumna ) ;
DateTime dtFechaRecibido = DateTime . Parse ( row [ "FECHAASIGNACIONRESPONSABLEACTIVIDAD" ] . ToString ( ) ) . AddDays ( double . Parse ( strArrayTiempo [ 0 ] . ToString ( ) ) ) ;
if ( double . Parse ( strArrayTiempo [ 1 ] . ToString ( ) ) > 0 )
dtFechaRecibido = dtFechaRecibido . AddHours ( 4 ) ;
if ( dtFechaRecibido > DateTime . Now )
objSolicitud . objresponsableActividadEL . FKESTADO = 5 ; //finalizada a tiempo t_sgm_estadoactividad
else
objSolicitud . objresponsableActividadEL . FKESTADO = 8 ; //finalizada fuera de tiempo t_sgm_estadoactividad
strMensajeContenido = "La actividad " + Session [ "DESCRIPCIONACTIVIDAD" ] . ToString ( ) + " de la solicitud N° " + Session [ "SOLICITUD" ] . ToString ( ) + " ha sido concluida para ver los detalles, ingrese al sistema <a href=http://" + HttpContext . Current . Request . Url . Authority + "/Forms/wfrLogin.> SIGDD</a>" + strPiePagina ;
strAsuntoCorreo = "Conclusión de actividad - SIGDD" ;
//cancelar notificacion
notificacionBL objNotificacionBL = new notificacionBL ( ) ;
objNotificacionBL . objnotificacionEL . ID_DOCUMENTO = Session [ "SOLICITUD" ] . ToString ( ) + " - Confección del Criterio técnico de alcantarillado sanitario" ;
objNotificacionBL . objnotificacionEL . status = "00" ;
objNotificacionBL . objnotificacionEL . message = "OK" ;
nValorRetornado = objNotificacionBL . cancelarNotificacion ( objNotificacionBL . objnotificacionEL ) ;
}
else
{
objSolicitud . objresponsableActividadEL . FKESTADO = 4 ; //reinspeccion t_sgm_estadoactividad
strMensajeContenido = "La actividad " + Session [ "DESCRIPCIONACTIVIDAD" ] . ToString ( ) + " de la solicitud N° " + Session [ "SOLICITUD" ] . ToString ( ) + " no ha sido aprobada para ver los detalles, ingrese al sistema <a href=http://" + HttpContext . Current . Request . Url . Authority + "/Forms/wfrLogin.> SIGDD</a>" + strPiePagina ;
strAsuntoCorreo = "Reinspección de actividad - SIGDD" ;
}
nResultadoActualizar = objSolicitud . actualizarActividadSolicitud ( ) ;
if ( objSolicitud . objresponsableActividadEL . FKESTADO = = 8 | | objSolicitud . objresponsableActividadEL . FKESTADO = = 5 )
{
objcorreoBL = new AyABL . TRA . correoBL ( ) ;
//poner la siguiente actividad en pendiente
objSolicitudBL = new solicitudBL ( ) ;
objSolicitudBL . objSolicitudEL . PK = int . Parse ( Session [ "PKPROGRAMACION" ] . ToString ( ) ) ;
objSolicitudBL . objSolicitudEL . ORDEN = 5 ;
DataSet dsEncargadosActividadesSiguiente = objSolicitudBL . dsListaActividadesEncargado ( null ) ;
foreach ( DataRow row6 in dsEncargadosActividadesSiguiente . Tables [ 0 ] . Rows )
{
objSolicitud . objresponsableActividadEL . PK = int . Parse ( row6 [ "PKRESPONSABLEACTIVIDAD" ] . ToString ( ) ) ; ;
objSolicitud . objresponsableActividadEL . FKESTADO = 3 ; //pendiente t_sgm_estadoactividad
objSolicitud . objresponsableActividadEL . FECHARECIBIDO = DateTime . Now ;
nResultadoActualizar = objSolicitud . actualizarActividadSolicitudSiguiente ( ) ;
objcorreoBL . objcorreoEL . ASUNTO = strAsuntoCorreo ;
objcorreoBL . objcorreoEL . CONTENIDO = strMensajeContenido ;
objcorreoBL . objcorreoEL . FKUSUARIO = Convert . ToInt32 ( row6 [ "FKUSUARIOXDEPENDENCIA" ] . ToString ( ) ) ;
objcorreoBL . objcorreoEL . Fecha = DateTime . Now ;
nValorRetornado = objcorreoBL . insertarCorreo ( ) ;
}
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . INSERT . ToString ( ) ,
MensajesBitacora . IngresarRegistro + ": La actividad " + Session [ "DESCRIPCIONACTIVIDAD" ] . ToString ( ) + " de la solicitud N° " + Session [ "SOLICITUD" ] . ToString ( ) + " ha sido finalizada por parte del encargado de la actividad: " + Session [ "NOMBREEMPLEADO" ] . ToString ( ) . Trim ( ) ,
Path . GetFileNameWithoutExtension ( Page . AppRelativeVirtualPath ) ,
Convert . ToInt32 ( ConfigurationManager . AppSettings [ "pkApp" ] )
) ;
}
if ( objSolicitud . objresponsableActividadEL . FKESTADO = = 4 ) //no aprobo en la revision
{
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . INSERT . ToString ( ) ,
MensajesBitacora . IngresarRegistro + ": La actividad " + Session [ "DESCRIPCIONACTIVIDAD" ] . ToString ( ) + " de la solicitud N° " + Session [ "SOLICITUD" ] . ToString ( ) + " no ha sido aprobada en la revisión por parte del encargado de la actividad: " + Session [ "NOMBREEMPLEADO" ] . ToString ( ) . Trim ( ) ,
Path . GetFileNameWithoutExtension ( Page . AppRelativeVirtualPath ) ,
Convert . ToInt32 ( ConfigurationManager . AppSettings [ "pkApp" ] )
) ;
}
}
if ( p_accion = = "deniega" )
{
//Poner la actividad 2 programacion en pendiente(3)
//objSolicitudBL = new solicitudBL();
//objSolicitudBL.objSolicitudEL.PK = int.Parse(Session["PKPROGRAMACION"].ToString());
//objSolicitudBL.objSolicitudEL.ORDEN = 2;
//dsEncargadosActividades = objSolicitudBL.dsListaActividadesEncargado(null);
//foreach (DataRow row in dsEncargadosActividades.Tables[0].Rows)
//{
// objSolicitud.objresponsableActividadEL.PK = int.Parse(row["PKRESPONSABLEACTIVIDAD"].ToString()); ;
// objSolicitud.objresponsableActividadEL.FKESTADO = 3;//pendiente t_sgm_estadoactividad
// nResultadoActualizar = objSolicitud.actualizarActividadSolicitud();
//}
}
#region Envio de correo
int nActividad = int . Parse ( Session [ "NACTIVIDAD" ] . ToString ( ) ) ;
//if (nActividad > 2)
// nActividad = 2;//SE ENVIA PARA REPROGRAMAR11
//else
// nActividad = 1;
//se envia correo a los encargados de la actividad 3
objSolicitudBL . objSolicitudEL . PK = int . Parse ( Session [ "PKPROGRAMACION" ] . ToString ( ) ) ;
objSolicitudBL . objSolicitudEL . ORDEN = nActividad ;
dsEncargadosActividades = objSolicitudBL . dsListaActividadesEncargado ( null ) ;
if ( dsEncargadosActividades . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( DataRow row in dsEncargadosActividades . Tables [ 0 ] . Rows )
{
nPkSolicitud = Convert . ToInt32 ( row [ 1 ] . ToString ( ) ) ; //AQUI INSERTAMOS LA PK DE LA SOLICITUD
objcorreoBL . objcorreoEL . FKNUMSOLICITUD = nPkSolicitud ;
// objcorreoBL.objcorreoEL.CORREO = dsActividad.Tables[0].Rows[0]["LOGINUSUARIO"].ToString() + "@aya.go.cr";
objcorreoBL . objcorreoEL . ASUNTO = strAsuntoCorreo ;
objcorreoBL . objcorreoEL . CONTENIDO = strMensajeContenido ;
objcorreoBL . objcorreoEL . FKUSUARIO = Convert . ToInt32 ( row [ "FKUSUARIOXDEPENDENCIA" ] . ToString ( ) ) ;
objcorreoBL . objcorreoEL . Fecha = DateTime . Now ;
nValorRetornado = objcorreoBL . insertarCorreo ( ) ;
}
}
//se envia correo a los encargados de la actividad 2 para reprogramar la tarea
objSolicitudBL . objSolicitudEL . PK = int . Parse ( Session [ "PKPROGRAMACION" ] . ToString ( ) ) ;
objSolicitudBL . objSolicitudEL . ORDEN = 2 ;
dsEncargadosActividades = objSolicitudBL . dsListaActividadesEncargado ( null ) ;
if ( dsEncargadosActividades . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( DataRow row in dsEncargadosActividades . Tables [ 0 ] . Rows )
{
nPkSolicitud = Convert . ToInt32 ( row [ 1 ] . ToString ( ) ) ; //AQUI INSERTAMOS LA PK DE LA SOLICITUD
objcorreoBL . objcorreoEL . FKNUMSOLICITUD = nPkSolicitud ;
// objcorreoBL.objcorreoEL.CORREO = dsActividad.Tables[0].Rows[0]["LOGINUSUARIO"].ToString() + "@aya.go.cr";
objcorreoBL . objcorreoEL . ASUNTO = "Conclusión de actividad - SIGDD" ;
objcorreoBL . objcorreoEL . CONTENIDO = strMensajeContenido ;
objcorreoBL . objcorreoEL . FKUSUARIO = Convert . ToInt32 ( row [ "FKUSUARIOXDEPENDENCIA" ] . ToString ( ) ) ;
objcorreoBL . objcorreoEL . Fecha = DateTime . Now ;
nValorRetornado = objcorreoBL . insertarCorreo ( ) ;
}
}
//se envia correo a los encargados de la actividad 5 para iniciar la tarea de constancia de actividad
objSolicitudBL . objSolicitudEL . PK = int . Parse ( Session [ "PKPROGRAMACION" ] . ToString ( ) ) ;
objSolicitudBL . objSolicitudEL . ORDEN = 5 ;
dsEncargadosActividades = objSolicitudBL . dsListaActividadesEncargado ( null ) ;
if ( dsEncargadosActividades . Tables [ 0 ] . Rows . Count > 0 )
{
foreach ( DataRow row in dsEncargadosActividades . Tables [ 0 ] . Rows )
{
nPkSolicitud = Convert . ToInt32 ( row [ 1 ] . ToString ( ) ) ; //AQUI INSERTAMOS LA PK DE LA SOLICITUD
objcorreoBL . objcorreoEL . FKNUMSOLICITUD = nPkSolicitud ;
// objcorreoBL.objcorreoEL.CORREO = dsActividad.Tables[0].Rows[0]["LOGINUSUARIO"].ToString() + "@aya.go.cr";
objcorreoBL . objcorreoEL . ASUNTO = "Conclusión de actividad - SIGDD" ;
objcorreoBL . objcorreoEL . CONTENIDO = strMensajeContenido ;
objcorreoBL . objcorreoEL . FKUSUARIO = Convert . ToInt32 ( row [ "FKUSUARIOXDEPENDENCIA" ] . ToString ( ) ) ;
objcorreoBL . objcorreoEL . Fecha = DateTime . Now ;
nValorRetornado = objcorreoBL . insertarCorreo ( ) ;
}
}
#endregion
}
}
//GuardarEventoBitacora(
// Session["LOGIN"].ToString(),
// AccionBitacora.INSERT.ToString(),
// MensajesBitacora.IngresarRegistro + ": Se ingreso una nueva observación a la actividad: Se aprueba el formulario por parte del encargado de la revisión: " + Session["NOMBREEMPLEADO"].ToString().Trim(),
// "frwCriterioAS.aspx",
// Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
// );
}
catch ( Exception ex )
{
throw ex ;
}
return nValorRetornado ;
}
#endregion
#region Metodos Datos a Controles ( R6 )
/// <summary>
/// Llena el dropdownlist de tipo de consulta
/// Se cargan dos dataset uno con los datos de configuracion de la aplicacion y el otro viene del ADS que contiene el nombre
/// luego se hace un merge manual, se crea una tabla aparte con los valores requeridos
/// Asi mantenemos actualizados los nombre de los usuarios con los datos del ADS
/// </summary>
private void llenarDDLInspector ( ) //M2
{
try
{
//ddlInspector.Items.Clear();
//ArrayList arlCondicionesFiltroBusqueda = new ArrayList();
//DataSet ds;
//objUsuarioBL = new UsuarioBL();
//objUsuarioBL.objUsuarioEL.FKTIPOINSPECCION = int.Parse(ddlTipoInspeccion.SelectedValue);
//ds = objUsuarioBL.dsUsuarioInspector(objUsuarioBL.objUsuarioEL);
//DataSet ds2 = objUsuarioBL.dsListaUsuarios(arlCondicionesFiltroBusqueda);
//DataTable dtInspectores = new DataTable();
//dtInspectores.Columns.Add("PKUSUARIOXDEPENDENCIA");
//dtInspectores.Columns.Add("NOMBRECOMPLETO");
//if (ds.Tables[0].Rows.Count != 0)
//{
// foreach (DataRow row in ds.Tables[0].Rows)
// {
// foreach (DataRow rowUsuario in ds2.Tables[0].Rows)
// {
// if (row[1].ToString() == rowUsuario[1].ToString())
// {
// DataRow rowFinal = dtInspectores.NewRow();
// rowFinal["PKUSUARIOXDEPENDENCIA"] = row[0].ToString();
// rowFinal["NOMBRECOMPLETO"] = rowUsuario[12].ToString();
// dtInspectores.Rows.Add(rowFinal);
// }
// }
// }
//}
//if (dtInspectores.Rows.Count != 0)
//{
// ddlInspector.DataSource = dtInspectores;
// ddlInspector.DataTextField = dtInspectores.Columns["NOMBRECOMPLETO"].ColumnName;
// ddlInspector.DataValueField = dtInspectores.Columns["PKUSUARIOXDEPENDENCIA"].ColumnName;
// ddlInspector.DataBind();
// ddlInspector.Items.Insert(0, new ListItem("Seleccione", "-1"));
//}
//else
// ddlInspector.Items.Insert(0, new ListItem("----- No existen opciones -----", "-1"));
}
catch ( Exception ex )
{
throw ex ;
}
}
/// <summary>
/// LLena el listado de roles de usuario
/// </summary>
private void llenarGridVisitaSolicitud ( ) //M3
{
try
{
Session [ "ACTIVIDADFINALIZADA" ] = null ;
solicitudBL objSolicitudBL = new solicitudBL ( ) ;
objSolicitudBL . objSolicitudEL . PK = int . Parse ( Session [ "PKPROGRAMACION" ] . ToString ( ) ) ;
objSolicitudBL . objSolicitudEL . FKUSUARIOXDEPENDENCIA = int . Parse ( Session [ "PKUSUARIOXDEPENDENCIA" ] . ToString ( ) ) ;
objSolicitudBL . objSolicitudEL . ORDEN = 4 ;
objSolicitudBL . objSolicitudEL . FKESTADO = 5 ;
objSolicitudBL . objSolicitudEL . FKESTADO2 = 8 ;
DataSet dsEncargadosActividades = objSolicitudBL . dsListaActividadesEncargado ( null ) ;
if ( dsEncargadosActividades . Tables [ 0 ] . Rows . Count > 0 )
{
Session [ "ACTIVIDADFINALIZADA" ] = true ;
}
objInspeccionasBL = new inspeccionasBL ( ) ;
objInspeccionasBL . objinspeccionasEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
objInspeccionasBL . objinspeccionasEL . FKREUTILIZA = nPKReutilizaTMP ;
char [ ] separadorColumna = { '-' } ;
string [ ] arrSolicitud = Session [ "SOLICITUD" ] . ToString ( ) . Split ( separadorColumna ) ;
objInspeccionasBL . objinspeccionasEL . NUMEROSOLICITUD = arrSolicitud [ 1 ] . ToString ( ) ;
DataSet dsInspeccionBL = objInspeccionasBL . listarInspeccionesAS ( null ) ;
General . detalleGridView ( dsInspeccionBL , grvListaVisitaSolicitud , lblTotalDatos ) ;
}
catch ( Exception ex )
{
throw ex ;
}
}
/// <summary>
/// LLena el listado de roles de usuario
/// </summary>
private void cargarFormularioCriterioAS ( int p_nPKInspeccion ) //M3
{
try
{
objInspeccionasBL = new inspeccionasBL ( ) ;
//objInspeccionasBL.objinspeccionasEL.FKSOLICITUD = int.Parse(Session["PKSOLICITUD"].ToString());
objInspeccionasBL . objinspeccionasEL . PKINSPECCION = p_nPKInspeccion ;
DataSet dsInspeccion = objInspeccionasBL . listarInspeccionesAS ( null ) ;
if ( dsInspeccion . Tables [ 0 ] . Rows . Count ! = 0 )
{
Session [ "PKTIPOINSPECCION" ] = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "FKTIPOINSPECCION" ] . ToString ( ) ;
objInspeccionasBL . objinspeccionasEL . FKINSPECCIONAPAS = int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKINSPECCIONAS" ] . ToString ( ) ) ;
rblExisteNis . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "TIENESERVICIOSOLICITUD" ] . ToString ( ) . ToLower ( ) ;
if ( rblExisteNis . SelectedValue = = "true" )
txtNisExistente . Enabled = true ;
else
txtNisExistente . Enabled = false ;
txtNisExistente . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "NUMERONISSOLICITUD" ] . ToString ( ) ;
rblEstructuraExistente . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "ESTRUCTURAEXISTENTEINSPECCION" ] . ToString ( ) . ToLower ( ) ;
if ( rblEstructuraExistente . SelectedValue = = "true" )
txtTipoEstructuraExistente . Enabled = true ;
else
txtTipoEstructuraExistente . Enabled = false ;
txtTipoEstructuraExistente . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "TIPOESTRUCTURAINSPECCION" ] . ToString ( ) ;
rblExisteDisponibilidad . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "DISPONIBILIDADASOCIADAEXISTENTEINSPECCION" ] . ToString ( ) . ToLower ( ) ;
if ( rblExisteDisponibilidad . SelectedValue = = "true" )
txtDisponibilidadAsociada . Enabled = true ;
else
txtDisponibilidadAsociada . Enabled = false ;
txtDisponibilidadAsociada . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "DESCRIPCIONDISPONIBILIDADEXISTENTEINSPECCION" ] . ToString ( ) ;
txtOficioRecepcion . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "CONDOMINIOINSPECCION" ] . ToString ( ) ;
txtSistemaAsociado . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "SISTEMAASOCIADOINSPECCIONAS" ] . ToString ( ) ;
decimal dCaudal = decimal . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "CAUDALRECOLECCIONINSPECCIONAS" ] . ToString ( ) ) ;
txtCaudalReservado . Text = dCaudal . ToString ( "N2" ) ;
//txtCaudalReservado.Text = dsInspeccion.Tables[0].Rows[0]["CAUDALRECOLECCIONINSPECCIONAS"].ToString();
chkNoLocalizadoPozoAguaArriba . Checked = bool . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "NOLOCALIZADOARRIBAPOZOAGUAS" ] . ToString ( ) . ToLower ( ) ) ;
if ( chkNoLocalizadoPozoAguaArriba . Checked = = false )
{
txtCoordenadasPozoAguaArriba . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "COORDENADASARRIBAPOZOAGUAS" ] . ToString ( ) ;
txtProfundidadPozoAguaArriba . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PROFUNDIDADARRIBAPOZOAGUAS" ] . ToString ( ) ;
rblDiametroPozoAguaArriba . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "DIAMETROARRIBAPOZOAGUAS" ] . ToString ( ) ;
rblMaterialPozoAguaArriba . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "MATERIALARRIBAPOZOAGUAS" ] . ToString ( ) ;
if ( rblMaterialPozoAguaArriba . SelectedValue = = "7" )
{
txtOtroMaterialPozoAguasArriba . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "VALOROTROMATERIALPOZOAGUAARRIBA" ] . ToString ( ) ;
}
}
chkNoLocalizadoPozoAguaAbajo . Checked = bool . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "NOLOCALIZADOABAJOPOZOAGUAS" ] . ToString ( ) . ToLower ( ) ) ;
if ( chkNoLocalizadoPozoAguaAbajo . Checked = = false )
{
txtCoordenadasPozoAguaAbajo . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "COORDENADASABAJOPOZOAGUAS" ] . ToString ( ) ;
txtProfundidadPozoAguaAbajo . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PROFUNDIDADABAJOPOZOAGUAS" ] . ToString ( ) ;
rblDiametroPozoAguaAbajo . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "DIAMETROABAJOPOZOAGUAS" ] . ToString ( ) ;
rblMaterialPozoAguaAbajo . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "MATERIALABAJOPOZOAGUAS" ] . ToString ( ) ;
if ( rblMaterialPozoAguaAbajo . SelectedValue = = "7" )
{
txtOtroMaterialPozoAguasAbajo . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "VALOROTROMATERIALPOZOAGUAABAJO" ] . ToString ( ) ;
}
}
if ( chkNoLocalizadoPozoAguaAbajo . Checked = = false )
{
txtCoordenadasPozoAguaAbajo . Enabled = true ;
txtProfundidadPozoAguaAbajo . Enabled = true ;
rblDiametroPozoAguaAbajo . Enabled = true ;
rblMaterialPozoAguaAbajo . Enabled = true ;
}
else
{
txtCoordenadasPozoAguaAbajo . Enabled = false ;
txtProfundidadPozoAguaAbajo . Enabled = false ;
rblDiametroPozoAguaAbajo . Enabled = false ;
rblMaterialPozoAguaAbajo . Enabled = false ;
}
if ( chkNoLocalizadoPozoAguaArriba . Checked = = false )
{
txtCoordenadasPozoAguaArriba . Enabled = true ;
txtProfundidadPozoAguaArriba . Enabled = true ;
rblDiametroPozoAguaArriba . Enabled = true ;
rblMaterialPozoAguaArriba . Enabled = true ;
}
else
{
txtCoordenadasPozoAguaArriba . Enabled = false ;
txtProfundidadPozoAguaArriba . Enabled = false ;
rblDiametroPozoAguaArriba . Enabled = false ;
rblMaterialPozoAguaArriba . Enabled = false ;
}
rblCarpetaRodamiento . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "FKCARPETARODAMIENTO" ] . ToString ( ) ;
rblExisteCajaRegistro . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "EXISTECAJAREGVECINOSINSPECCIONAS" ] . ToString ( ) . ToLower ( ) ;
rblExistePosibilidadConexionGravedad . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "EXISTECONEXAGRAVEDADINSPECCIONAS" ] . ToString ( ) . ToLower ( ) ;
rblExisteRedAlcantarillado . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "EXISTEREDALCINSPECCIONAS" ] . ToString ( ) . ToLower ( ) ;
rblCobraServicioManzana . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "COBRASERVMANZANAINSPECCIONAS" ] . ToString ( ) . ToLower ( ) ;
rblExisteRedAlcantarilladoPrevista . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "EXISTEREDALCPREVISTAINSPECCIONAS" ] . ToString ( ) . ToLower ( ) ;
rblCuentaPrevista . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "FKCUENTAPREVISTA" ] . ToString ( ) ;
if ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "FKCUENTAPREVISTA" ] . ToString ( ) = = "1" )
rblDiametroPrevista . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "VALORDIAMETROPREVISTAAS" ] . ToString ( ) ;
rblTipoCajaRegistro . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "FKTIPOCAJAREGISTRO" ] . ToString ( ) ;
rblServiciosAfectanConexion . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "FKSERVICIOSAFECTANCONEXION" ] . ToString ( ) ;
if ( int . Parse ( rblServiciosAfectanConexion . SelectedValue ) = = 5 )
txtOtroServiciosAfectanConexion . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "DESCRIPCIONOTROSERVICIOAFECTACONEXION" ] . ToString ( ) ;
rblNuevoServicio . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "FKNUEVOSERVICIO" ] . ToString ( ) ;
//if (int.Parse(rblNuevoServicio.SelectedValue) == 5)
rblDiametroNuevoServicio . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "DESCRIPCIONVALORNUEVOSERVICIODIAMETRO" ] . ToString ( ) ;
//if (int.Parse(rblNuevoServicio.SelectedValue) == 6)
txtDistanciaNuevoServicio . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "DESCRIPCIONVALORNUEVOSERVICIODISTANCIA" ] . ToString ( ) ;
txtObservacionTipoCajaRegistro . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "OBSERVACIONESCAJAREGISTROINSPECCIONAS" ] . ToString ( ) ;
rblTieneCapacidadHidraulica . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "TIENECAPACIDADHIDRAULICAINSPECCIONAS" ] . ToString ( ) . ToLower ( ) ;
rblEnRutaNacional . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "ENRUTANACIONALINSPECCIONAS" ] . ToString ( ) . ToLower ( ) ;
rblPropiedadFrenteA . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PROPIEDADFRENTEAINSPECCIONAS" ] . ToString ( ) . ToLower ( ) ;
if ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PROPIEDADFRENTEAINSPECCIONAS" ] . ToString ( ) . ToLower ( ) = = "6" )
txtOtroPropiedadFrenteA . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "DESCRIPCIONOTROPROPIEDADFRENTEA" ] . ToString ( ) ;
rblDisponibilidadAS . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "EXISTEDISPONIBILIDADINSPECCIONAS" ] . ToString ( ) . ToLower ( ) ;
if ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "EXISTEDISPONIBILIDADINSPECCIONAS" ] . ToString ( ) . ToLower ( ) = = "true" )
{
rblDisponibilidadAS . SelectedValue = "true" ;
txtDiametroExisteDisponibilidad . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "DIAMETRODISPONIBILIDADEXISTEDISPALCANTSAN" ] . ToString ( ) ;
txtObservacionesExisteDisponibilidad . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "OBSERVACIONESDISPONIBILIDADEXISTEDISPALCANTSAN" ] . ToString ( ) ;
}
if ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "EXISTEDISPONIBILIDADINSPECCIONAS" ] . ToString ( ) . ToLower ( ) = = "false" )
{
objInspeccionasBL . objinspeccionasEL . FKTIPOINSPECCION = 2 ; // int.Parse(Session["PKTIPOINSPECCION"].ToString());//ALCANTARILLADO SANITARIO
DataSet dsNegacionDisponibilidad = objInspeccionasBL . listarNegacionInspeccion ( null ) ;
if ( dsNegacionDisponibilidad . Tables [ 0 ] . Rows . Count ! = 0 )
{
foreach ( DataRow row in dsNegacionDisponibilidad . Tables [ 0 ] . Rows )
{
if ( int . Parse ( row [ "FKTIPONEGACIONDISPONIBILIDAD" ] . ToString ( ) ) = = 11 )
chkProblemasNiveles . Checked = true ;
if ( int . Parse ( row [ "FKTIPONEGACIONDISPONIBILIDAD" ] . ToString ( ) ) = = 12 )
chkNoHayRed . Checked = true ;
if ( int . Parse ( row [ "FKTIPONEGACIONDISPONIBILIDAD" ] . ToString ( ) ) = = 13 )
chkRedNoTieneCapacidad . Checked = true ;
if ( int . Parse ( row [ "FKTIPONEGACIONDISPONIBILIDAD" ] . ToString ( ) ) = = 14 )
chkRedPrevista . Checked = true ;
if ( int . Parse ( row [ "FKTIPONEGACIONDISPONIBILIDAD" ] . ToString ( ) ) = = 15 )
chkSistemaPrivado . Checked = true ;
if ( int . Parse ( row [ "FKTIPONEGACIONDISPONIBILIDAD" ] . ToString ( ) ) = = 16 )
chkNoSeUbico . Checked = true ;
if ( int . Parse ( row [ "FKTIPONEGACIONDISPONIBILIDAD" ] . ToString ( ) ) = = 28 )
{
chkOtrosOperadores . Checked = true ;
dvOtrosOperadores . Visible = true ;
txtOtrosOperadores . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "DESCRIPCIONOTROSOPERADORES" ] . ToString ( ) ;
}
}
// if (dsInspeccion.Tables[0].Rows[0]["CRITECNICONOEXISTEDISPONIBILIDAD"].ToString().ToLower() == "true")
{
}
}
}
rblRequiereCCR . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "CRITECNICONOEXISTEDISPONIBILIDAD" ] . ToString ( ) . ToLower ( ) ;
txtObservacionesExtensionRamal . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "OBSERVACIONESCREACIONCRITTEC" ] . ToString ( ) ;
rblUbicacionMedidor . SelectedValue = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKUBICAMEDIDOR" ] . ToString ( ) ;
txtLindero . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "LINDEROINSPECCIONUBICAMEDIDOR" ] . ToString ( ) ;
txtLongitud . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "LONGUITUDCROQUIS" ] . ToString ( ) ;
txtLatitud . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "LATITUDCROQUIS" ] . ToString ( ) ;
txtObservacionesCritec . Text = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "DESCRIPCIONOBSERVACIONESCRITEC" ] . ToString ( ) ;
//rblPrevista.SelectedValue = dsInspeccion.Tables[0].Rows[0]["PREVISTAINSPECCIONAS"].ToString().ToLower();
//rblTipoPrevista.SelectedValue = dsInspeccion.Tables[0].Rows[0]["FKTIPOPREVISTA"].ToString();
//if (dsInspeccion.Tables[0].Rows[0]["DESCRIPCIONOTROPREVISTA"].ToString().ToLower() != "")
//{
// txtOtrosPrevista.Text = dsInspeccion.Tables[0].Rows[0]["DESCRIPCIONOTROPREVISTA"].ToString();
// txtOtrosPrevista.Visible = true;
//}
//rblTuberiaDistribucion.SelectedValue = dsInspeccion.Tables[0].Rows[0]["TUBERIAINSPECCIONAP"].ToString().ToLower();
//if (dsInspeccion.Tables[0].Rows[0]["TUBERIAINSPECCIONAP"].ToString().ToLower() == "true")
//{
// rblMaterial.SelectedValue = dsInspeccion.Tables[0].Rows[0]["MATERIALTUBERIAINSPECCIONAP"].ToString();
// rblDiametro.SelectedValue = dsInspeccion.Tables[0].Rows[0]["DIAMETROINSPECCIONAP"].ToString();
//}
//
//rblTipoMedidor.SelectedValue = dsInspeccion.Tables[0].Rows[0]["FKTIPOMEDIDOR"].ToString();
//if (dsInspeccion.Tables[0].Rows[0]["DESCRIPCIONOTROTUBERIAAP"].ToString().ToLower() != "")
// txtOtroDiametro.Text = dsInspeccion.Tables[0].Rows[0]["DESCRIPCIONOTROTUBERIAAP"].ToString();
//
//rblDiametroMedidor.SelectedValue = dsInspeccion.Tables[0].Rows[0]["VALORDIAMETROMEDIDOR"].ToString();
//if (dsInspeccion.Tables[0].Rows[0]["EXISTEDISPONIBILIDADINSPECCIONAP"].ToString().ToLower() == "true")
//{
// rblExisteCCH.SelectedValue = dsInspeccion.Tables[0].Rows[0]["EXISTECAPACIDADHIDRICAEXISTEDISPONIBILIDADAP"].ToString().ToLower();
// txtObservacionesExtensionRamal.Text = dsInspeccion.Tables[0].Rows[0]["OBSERVACIONEXTENSIONRAMALEXISTEDISPONIBILIDADAP"].ToString();
//}
}
if ( rblDisponibilidadAS . SelectedValue . ToString ( ) . ToLower ( ) = = "true" )
{
divSiExisteDisponibilidad . Visible = true ;
divNoExisteDisponibilidad . Visible = false ;
}
else
{
divSiExisteDisponibilidad . Visible = false ;
divNoExisteDisponibilidad . Visible = true ;
}
if ( rblRequiereCCR . SelectedValue . ToString ( ) = = "true" )
{
divCCH2 . Visible = true ;
}
else
{
divCCH2 . Visible = false ;
}
if ( int . Parse ( rblServiciosAfectanConexion . SelectedValue ) = = 5 )
Div2 . Visible = true ;
if ( int . Parse ( rblMaterialPozoAguaArriba . SelectedValue ) = = 7 )
dvOtroMaterialPozoAguasArriba . Visible = true ;
else
dvOtroMaterialPozoAguasArriba . Visible = false ;
if ( int . Parse ( rblMaterialPozoAguaAbajo . SelectedValue ) = = 7 )
dvOtroMaterialPozoAguasAbajo . Visible = true ;
else
dvOtroMaterialPozoAguasAbajo . Visible = false ;
//dvDiametroNuevoServicio.Visible = false;
//dvDistanciaNuevoServicio.Visible = false;
//if (int.Parse(rblNuevoServicio.SelectedValue) == 5)
//{
// dvDiametroNuevoServicio.Visible = true;
//}
//if (int.Parse(rblNuevoServicio.SelectedValue) == 6)
//{
// dvDistanciaNuevoServicio.Visible = true;
//}
if ( rblNuevoServicio . SelectedValue . ToString ( ) = = "7" )
{
rblDiametroNuevoServicio . Enabled = false ;
txtDistanciaNuevoServicio . Enabled = false ;
}
else
{
rblDiametroNuevoServicio . Enabled = true ;
txtDistanciaNuevoServicio . Enabled = true ;
}
if ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "FKUSUARIOXDEPENDENCIA" ] . ToString ( ) . ToLower ( ) = = Session [ "PKUSUARIOXDEPENDENCIA" ] . ToString ( ) . ToLower ( ) & &
int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKESTADOINSPECCION" ] . ToString ( ) ) = = 2 )
{
habilitarCampos ( ) ;
chkNoLocalizadoPozoAguaArriba . Enabled = true ;
chkNoLocalizadoPozoAguaAbajo . Enabled = true ;
if ( chkNoLocalizadoPozoAguaArriba . Checked = = true )
{
txtCoordenadasPozoAguaArriba . Enabled = false ;
txtProfundidadPozoAguaArriba . Enabled = false ;
rblDiametroPozoAguaArriba . Enabled = false ;
rblMaterialPozoAguaArriba . Enabled = false ;
}
if ( chkNoLocalizadoPozoAguaArriba . Checked = = true )
{
txtCoordenadasPozoAguaAbajo . Enabled = false ;
txtProfundidadPozoAguaAbajo . Enabled = false ;
rblDiametroPozoAguaAbajo . Enabled = false ;
rblMaterialPozoAguaAbajo . Enabled = false ;
}
if ( rblEstructuraExistente . SelectedValue = = "false" )
txtTipoEstructuraExistente . Enabled = false ;
if ( rblExisteDisponibilidad . SelectedValue = = "false" )
txtDisponibilidadAsociada . Enabled = false ;
if ( rblCuentaPrevista . SelectedValue ! = "1" )
{
rblDiametroPrevista . Enabled = false ;
rblTipoCajaRegistro . Enabled = false ;
txtObservacionTipoCajaRegistro . Enabled = false ;
}
//if (rblTipoPrevista.SelectedValue == "4")
//{
// txtOtrosPrevista.Visible = true;
// txtOtrosPrevista.Enabled = true;
//}
btnAprobar . Visible = true ;
btnDenegar . Visible = true ;
btnNuevo . Visible = false ;
ViewState [ "PKREVISIONFORMULARIO" ] = dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKREVISIONFORMULARIO" ] . ToString ( ) ;
}
//else
//{
// deshabilitarCampos();
//}
if ( int . Parse ( dsInspeccion . Tables [ 0 ] . Rows [ 0 ] [ "PKESTADOINSPECCION" ] . ToString ( ) ) = = 3 ) //si el estado es de reinspeccion se deshabilitan los campos
deshabilitarCampos ( ) ;
//else
// habilitarCampos();
}
catch ( Exception ex )
{
throw ex ;
}
}
/// <summary>
/// Carga el grid principal
/// </summary>
/// <param name="p_Llenar"></param>
private void llenarDDLEncargado ( bool p_Llenar ) //M0
{
try
{
ddlEncargadoRevision . Items . Clear ( ) ;
ArrayList arlCondicionesFiltroBusqueda = new ArrayList ( ) ;
ActividadesBL objActividadesBL = new ActividadesBL ( ) ;
objActividadesBL . objactividadesEL . Activo = true ;
objActividadesBL . objactividadesEL . ORDEN = 4 ; //Criterio tecnico AS
objActividadesBL . objactividadesEL . FKDEPENDENCIA = int . Parse ( Session [ "FKDEPENDENCIASIGDD" ] . ToString ( ) ) ;
DataSet dsActividad = objActividadesBL . dsListaActividad ( arlCondicionesFiltroBusqueda ) ;
if ( dsActividad . Tables [ 0 ] . Rows . Count ! = 0 )
{
ddlEncargadoRevision . DataSource = dsActividad ;
ddlEncargadoRevision . DataTextField = dsActividad . Tables [ 0 ] . Columns [ "NOMBRECOMPLETO" ] . ColumnName ;
ddlEncargadoRevision . DataValueField = dsActividad . Tables [ 0 ] . Columns [ "PKUSUARIOXDEPENDENCIA" ] . ColumnName ;
ddlEncargadoRevision . DataBind ( ) ;
ddlEncargadoRevision . Items . Insert ( 0 , new ListItem ( "Seleccione" , "-1" ) ) ;
}
else
ddlEncargadoRevision . Items . Insert ( 0 , new ListItem ( "----- No existen opciones -----" , "-1" ) ) ;
}
catch ( Exception ex )
{
throw ex ;
}
}
#endregion
#region Métodos para generar token de seguridad del firmador web
/// <summary>
/// Identificador único definido por el sistema cliente para el documento incluído en el firmador web
/// </summary>
private string IdCorrelacionFirmadorWeb
{
get
{
return "01" ;
}
}
private FirmadorWeb . Documento _documento ;
protected FirmadorWeb . Documento documento
{
get
{
if ( _documento = = null )
{
using ( FirmadorWeb . FirmadorWebSvcClient cliente = new FirmadorWeb . FirmadorWebSvcClient ( ) )
{
// recuperar el documento usando el identificador de correlación
_documento = cliente . ObtenerDocumentoXIdCorrelacion (
IdCorrelacionFirmadorWeb , CodigoSistema ) ;
}
}
return _documento ;
}
}
private string _UrlFirmadorWeb ;
protected string UrlFirmadorWeb
{
get
{
if ( string . IsNullOrEmpty ( _UrlFirmadorWeb ) )
{
try
{
if ( IsPostBack )
_UrlFirmadorWeb = GenerarUrlFirmadorWeb ( documento . DocumentoID , ( string ) Session [ "Cedula" ] ) ;
}
catch ( Exception ex )
{
MensajeError ( "Se presentó un error con el servicio de firma digital." , ex ) ;
}
}
return _UrlFirmadorWeb ;
}
}
/// <summary>
/// Genera un url para la página del documento en el firmador web
/// Incluye en el url un token de seguridad para el firmador web
/// </summary>
/// <param name="idDocumento">Documento que se va a abrir en el firmador web</param>
/// <param name="cedula">Cédula del usuario actual</param>
/// <returns></returns>
private string GenerarUrlFirmadorWeb ( long idDocumento , string cedula )
{
return string . Format (
ConfigurationManager . AppSettings [ "UrlFirmadorWeb" ] ,
idDocumento ,
cedula ,
Server . UrlEncode (
Cipher (
string . Format ( "{0},{1}" , idDocumento , cedula )
)
)
) ;
}
/// <summary>
/// Encripta un valor usando la llave de encripción especificada en el parámetro LlaveEncripcionFW
/// Debe ser la misma llave que está configurada en el servicio
/// </summary>
/// <param name="value">Valor que se va a encriptar</param>
/// <returns>Valor encriptado</returns>
private static string Cipher ( string value )
{
string llaveEncripcionFW = ConfigurationManager . AppSettings [ "LlaveEncripcionFW" ] ;
Random rnd = new Random ( DateTime . Now . Millisecond ) ;
for ( int i = 0 ; i < 8 ; i + + )
value = "1234567890" [ rnd . Next ( 10 ) ] + value ;
value = "XYZ" + value ;
UTF7Encoding enc = new System . Text . UTF7Encoding ( ) ;
byte [ ] keyBytes = enc . GetBytes ( GetHash ( llaveEncripcionFW ) ) ;
TripleDES tdes = TripleDES . Create ( ) ;
byte [ ] desKey = new byte [ tdes . KeySize / 8 ] ;
for ( int i = 0 ; i < desKey . Length ; i + + )
desKey [ i ] = keyBytes [ i ] ;
tdes . Mode = CipherMode . CBC ;
tdes . Padding = PaddingMode . Zeros ;
byte [ ] plain = enc . GetBytes ( value ) ;
int cipheredSize = plain . Length / tdes . BlockSize ;
if ( plain . Length % tdes . BlockSize > 0 )
cipheredSize + + ;
cipheredSize * = tdes . BlockSize ;
byte [ ] ciphered = new byte [ cipheredSize ] ;
ICryptoTransform cry = tdes . CreateEncryptor ( desKey , desKey ) ;
byte [ ] input = new byte [ tdes . BlockSize ] ;
byte [ ] output = new byte [ tdes . BlockSize ] ;
int iPlain = 0 ;
int iCiphered = 0 ;
while ( iPlain < plain . Length )
{
int iInput = 0 ;
for ( ; iPlain < plain . Length & & iInput < input . Length ; iPlain + + )
input [ iInput + + ] = plain [ iPlain ] ;
for ( ; iInput < input . Length ; iInput + + )
input [ iInput ] = 0 ;
cry . TransformBlock ( input , 0 , input . Length , output , 0 ) ;
foreach ( Byte outputByte in output )
ciphered [ iCiphered + + ] = outputByte ;
}
return Convert . ToBase64String ( ciphered ) ;
}
public static string GetHash ( string value )
{
UTF7Encoding enc = new UTF7Encoding ( ) ;
byte [ ] bytes = enc . GetBytes ( value ) ;
return GetHash ( bytes ) ;
}
public static string GetHash ( byte [ ] value )
{
using ( SHA1Managed sha1 = new SHA1Managed ( ) )
{
sha1 . Initialize ( ) ;
byte [ ] hash = sha1 . ComputeHash ( value ) ;
return BitConverter . ToString ( hash ) . ToLower ( ) . Replace ( "-" , "" ) ;
}
}
#region variable firma digital
int nNumSolicitudTMP = 0 ;
int nPKReutilizaTMP = 0 ;
/// <summary>
/// Código del sistema cliente del servicio de firma digital. Cada sistema cliente debe usar un código diferente.
/// </summary>
private const string CodigoSistema = "SIGPC" ;
/// <summary>
/// Identificador del usuario definido para el sistema cliente
/// </summary>
private long IdUsuarioSistemaCliente
{
get
{
return long . Parse ( ConfigurationManager . AppSettings [ "IdUsuarioSistemaCliente" ] ) ;
}
}
#endregion
private void firmarDocumento ( string strNombre )
{
try
{
string strNombreArchivo = strNombre + "-AS.pdf" ;
//string sourcePath = ConfigurationManager.AppSettings["DocumentosMachote"].ToString() + @"\SIGPC_firma_electronica .odt";
//string targetPath = ConfigurationManager.AppSettings["DocumentosODT"].ToString() + @"\" + pstrDocumento + "_" + Session["SOLICITUD"].ToString() + "_.odt";
//string pdfPath = ConfigurationManager.AppSettings["DocumentosPDF"].ToString() + @"\" + Session["SOLICITUD"].ToString() + @"\" + pstrDocumento + ".pdf";
string pdfPath = ConfigurationManager . AppSettings [ "DocumentosPDF" ] . ToString ( ) + @"\" + strNombre + @"\" + strNombreArchivo ;
List < string > signatarios = new List < string > ( ) ;
List < string > emails = new List < string > ( ) ;
if ( ! string . IsNullOrEmpty ( ConfigurationManager . AppSettings [ "CedulaFirmaSIGPC" ] . ToString ( ) ) )
{
signatarios . Add ( ConfigurationManager . AppSettings [ "CedulaFirmaSIGPC" ] . ToString ( ) ) ;
//emails.Add("jmonged@aya.go.cr");
}
//obtener la constancia y ponerla en la carpeta compartida para el envio de correo
//se el registro de vision 2020
Documento oDoc = new Documento ( ) ;
string strAlmacenado = oDoc . Visor_Documento ( lblNumSolicitud . Text . Trim ( ) + "|" + "Criterio técnico AS" , lblNumSolicitud . Text . Trim ( ) , pdfPath , strNombreArchivo ) ;
if ( System . IO . File . Exists ( pdfPath ) )
{
byte [ ] bytes = System . IO . File . ReadAllBytes ( pdfPath ) ;
//verificar si el documento ya se habia firmado
using ( FirmadorWeb . FirmadorWebSvcClient cliente = new FirmadorWeb . FirmadorWebSvcClient ( ) )
{
long idDocumentoFirmado = cliente . CrearDocumento (
strNombreArchivo ,
"Firma de documentos" ,
bytes ,
IdUsuarioSistemaCliente ,
signatarios . ToArray ( ) ,
emails . ToArray ( ) ,
CodigoSistema ,
"01" ) ;
// cliente.PonerOpcionesDocumento(idDocumentoFirmado, CodigoSistema, false, false, false);
documento . DocumentoID = idDocumentoFirmado ;
ViewState [ "DocumentoID" ] = idDocumentoFirmado ;
Session [ "Cedula" ] = ConfigurationManager . AppSettings [ "CedulaFirmaSIGPC" ] . ToString ( ) ;
EjecutarScript ( "AbrirFirmadorWeb();" ) ;
ViewState [ "MODO" ] = "Firmador" ;
ViewState [ "Documento" ] = strNombre ;
ObservacionesBL objObservacionesBL = new ObservacionesBL ( ) ;
//objObservacionesBL.objobservacionesEL.FKNUMSOLICITUD = strNumSolicitudTMP;
objObservacionesBL . objobservacionesEL . OBSERVACIONES = "El usuario" + Session [ "NOMBREEMPLEADO" ] . ToString ( ) + " firmó la constancia " + strNombreArchivo ;
objObservacionesBL . objobservacionesEL . Fecha = DateTime . Now ;
objObservacionesBL . objobservacionesEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
objObservacionesBL . objobservacionesEL . USUARIO = Session [ "LOGIN" ] . ToString ( ) ;
//FirmadorWeb.Documento documentoFirmado = cliente.ObtenerDocumento(
// idDocumentoFirmado,
// CodigoSistema);
//if (documentoFirmado.Firmas.Count() == 0)
//{
// documento.DocumentoID = idDocumentoFirmado;
// ViewState["DocumentoID"] = idDocumentoFirmado;
// Session["Cedula"] = ConfigurationManager.AppSettings["CedulaFirmaSIGPC"].ToString();
// EjecutarScript("AbrirFirmadorWeb();");
//}
//else
//{
// MensajeInformativo("El documento ya fue firmado.");
//}
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . FIRMAR . ToString ( ) ,
MensajesBitacora . IngresarRegistro + ": Se firmo la constancia " + strNombreArchivo ,
"frwCriterioAS.aspx" ,
Convert . ToInt32 ( ConfigurationManager . AppSettings [ "pkApp" ] )
) ;
}
// System.IO.File.Copy(sourcePath, targetPath, true);
// string targetUrl = "'../../../DocumentosODT/" + pstrDocumento + "_" + Session["SOLICITUD"].ToString() + "_.odt'";
//// string targetUrl = "'../../../../DocumentosODT/" + pstrDocumento + ".odt'";
// if (System.IO.File.Exists(targetPath))
// {
// EjecutarScript("abrirOdt(" + targetUrl + ");");
// }
}
else
{
{ ClientScript . RegisterStartupScript ( this . GetType ( ) , "Error" , "<script>javascript: MensajeInformativo('No se ha generado el documento PDF." + pdfPath + "');</script>" ) ; }
}
}
catch ( Exception ex )
{
throw ex ;
}
}
private void obtenerDocumentoFirmado ( )
{
try
{
//string sourcePath = ConfigurationManager.AppSettings["DocumentosMachote"].ToString() + @"\SIGPC_firma_electronica .odt";
//string targetPath = ConfigurationManager.AppSettings["DocumentosODT"].ToString() + @"\" + pstrDocumento + "_" + Session["SOLICITUD"].ToString() + "_.odt";
//string pdfPath = ConfigurationManager.AppSettings["DocumentosPDF"].ToString() + @"\" + Session["SOLICITUD"].ToString() + @"\" + ViewState["Documento"] + ".pdf";
string pdfPath = ConfigurationManager . AppSettings [ "DocumentosPDF" ] . ToString ( ) + @"\" + ViewState [ "Documento" ] + @"\" + ViewState [ "Documento" ] + "-AS.pdf" ;
if ( System . IO . File . Exists ( pdfPath ) )
{
byte [ ] bytes = System . IO . File . ReadAllBytes ( pdfPath ) ;
//verificar si el documento ya se habia firmado
using ( FirmadorWeb . FirmadorWebSvcClient cliente = new FirmadorWeb . FirmadorWebSvcClient ( ) )
{
byte [ ] contenido = cliente . ObtenerContenidoDocumento ( long . Parse ( ViewState [ "DocumentoID" ] . ToString ( ) ) , CodigoSistema ) ;
File . WriteAllBytes ( pdfPath , contenido ) ;
Documento oDoc = new Documento ( ) ;
if ( System . IO . File . Exists ( pdfPath ) )
{
byte [ ] bDoc = System . IO . File . ReadAllBytes ( pdfPath ) ;
//se carga el archivo y el registro a vision 2020
string strResultado = oDoc . Archivar_Documento ( ViewState [ "Documento" ] . ToString ( ) . Trim ( ) + "|" + "Criterio técnico AS" , ViewState [ "Documento" ] . ToString ( ) . Replace ( " " , "_" ) + "-AS.pdf" , bDoc ) ;
if ( strResultado = = string . Empty )
{
//File.Delete(pdfPath);
}
}
}
}
else
{
{ ClientScript . RegisterStartupScript ( this . GetType ( ) , "Error" , "<script>javascript: MensajeInformativo('No se pudo descargar el documento firmado por favor intente firmarlo de nuevo." + pdfPath + "');</script>" ) ; }
}
EjecutarScript ( "inicializaTab('grid','');" ) ;
}
catch ( Exception ex )
{
throw ex ;
}
}
/// <summary>
/// Asigna la actividad 1 Ingreso y asignacion de expedientes al usuario que esta realizando la tarea
/// </summary>
/// <returns></returns>
private int AsignaActividadesUsuarios ( ) //M0
{
ActividadesBL objActividadesBL = new ActividadesBL ( ) ;
ArrayList arlCondicionesFiltroBusqueda = new ArrayList ( ) ;
int nValorRetornado = 0 ;
try
{
string strModo = ViewState [ "MODO" ] . 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 = 6 ; //Confección del Criterio técnico de agua potable -- t_adm_actividad
objresponsableActividadBL . objresponsableActividadEL . FKUSUARIOXDEPENDENCIA = int . Parse ( ddlEncargadoRevision . SelectedValue ) ;
objresponsableActividadBL . objresponsableActividadEL . FKESTADO = 1 ; //asignada
objresponsableActividadBL . objresponsableActividadEL . ASTATE = true ;
{
objresponsableActividadBL . objresponsableActividadEL . FKPROGRAMACIONSOLICITUD = int . Parse ( Session [ "PKPROGRAMACION" ] . ToString ( ) ) ;
}
if ( strModo = = "Nuevo" )
{
solicitudBL objsolicitudBL = new solicitudBL ( ) ;
objsolicitudBL . objSolicitudEL . FKSOLICITUD = int . Parse ( Session [ "PKSOLICITUD" ] . ToString ( ) ) ;
objsolicitudBL . objSolicitudEL . FKUSUARIOXDEPENDENCIA = int . Parse ( ddlEncargadoRevision . SelectedValue ) ;
objsolicitudBL . objSolicitudEL . FKACTIVIDAD = 6 ; //Confección del Criterio técnico de agua potable -- t_adm_actividad
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
// }
//}
//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 - SIGPC";
//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> SIGPC</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",
//"frwNuevaSolicitud.aspx",
//Convert.ToInt32(ConfigurationManager.AppSettings["pkApp"])
//);
}
else
{
MensajeAlerta ( "El usuario ya tiene asignada la actividad." ) ;
}
}
}
catch ( Exception ex )
{
throw ex ;
}
return nValorRetornado ;
}
private void BloquearIntros ( )
{
foreach ( Control c in divDatosInferiores . Controls )
{
if ( c is TextBox )
{
( ( TextBox ) c ) . Attributes . Add ( "onkeypress" , "javascript:if(event.keyCode==13){return false;}" ) ;
}
if ( c is RadioButtonList )
{
( ( RadioButtonList ) c ) . Attributes . Add ( "onkeypress" , "javascript:if(event.keyCode==13){return false;}" ) ;
}
foreach ( Control childc in c . Controls )
{
if ( childc is TextBox | | c is RadioButtonList )
{
( ( TextBox ) childc ) . Attributes . Add ( "onkeypress" , "javascript:if(event.keyCode==13){return false;}" ) ;
}
if ( childc is RadioButtonList )
{
( ( RadioButtonList ) childc ) . Attributes . Add ( "onkeypress" , "javascript:if(event.keyCode==13){return false;}" ) ;
}
}
}
}
#endregion
protected void grvListaVisitaSolicitud_RowDataBound ( object sender , GridViewRowEventArgs e )
{
try
{
GridViewRow selectedRow = e . Row ;
if ( e . Row . RowType = = DataControlRowType . DataRow )
{
e . Row . Cells [ 6 ] . ToolTip = "Ver formulario" ;
e . Row . Cells [ 7 ] . ToolTip = "Enviar a revisión" ;
e . Row . Cells [ 8 ] . ToolTip = "Firmar formulario" ;
e . Row . Cells [ 9 ] . ToolTip = "Ver documento" ;
//e.Row.Cells[7].Enabled = false;
//e.Row.Cells[7].Style.Add("opacity", "0.5");
//if (e.Row.Cells[5].Text == "Asignada" && Session["ACTIVIDADFINALIZADA"] == null)
//{
// e.Row.Cells[7].Enabled = true;
// e.Row.Cells[7].Style.Add("opacity", "1");
//}
//if (e.Row.Cells[10].Text != " ")//reutiliza
e . Row . Cells [ 9 ] . Enabled = true ;
e . Row . Cells [ 9 ] . Style . Add ( "opacity" , "1" ) ;
if ( e . Row . Cells [ 1 ] . Text . Trim ( ) = = strNumSolicitudTMP . Trim ( ) & & e . Row . Cells [ 5 ] . Text = = "Asignada" & & Session [ "ACTIVIDADFINALIZADA" ] = = null )
{
e . Row . Cells [ 7 ] . Enabled = true ;
e . Row . Cells [ 7 ] . Style . Add ( "opacity" , "1" ) ;
e . Row . Cells [ 8 ] . Enabled = true ;
e . Row . Cells [ 8 ] . Style . Add ( "opacity" , "1" ) ;
}
else
{
e . Row . Cells [ 7 ] . Enabled = false ;
e . Row . Cells [ 7 ] . Style . Add ( "opacity" , "0.5" ) ;
e . Row . Cells [ 8 ] . Enabled = false ;
e . Row . Cells [ 8 ] . Style . Add ( "opacity" , "0.5" ) ;
e . Row . Cells [ 9 ] . Enabled = false ;
e . Row . Cells [ 9 ] . Style . Add ( "opacity" , "0.5" ) ;
}
if ( Session [ "ACTIVIDADFINALIZADA" ] ! = null )
{
if ( e . Row . Cells [ 1 ] . Text . Trim ( ) = = strNumSolicitudTMP . Trim ( ) & & e . Row . Cells [ 5 ] . Text = = "Asignada" & & Session [ "ACTIVIDADFINALIZADA" ] . ToString ( ) = = "True" )
{
e . Row . Cells [ 9 ] . Enabled = true ;
e . Row . Cells [ 9 ] . Style . Add ( "opacity" , "1" ) ;
e . Row . Cells [ 7 ] . Enabled = false ;
e . Row . Cells [ 7 ] . Style . Add ( "opacity" , "0.5" ) ;
}
}
}
}
catch ( Exception ex )
{
throw ex ;
}
}
protected void btnActualizar_Click ( object sender , EventArgs e )
{
}
}