Exemplo n.º 1
0
        // Funciones el programador
        void InsertExpedienteResolucion()
        {
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();
            ENTSession SessionEntity = new ENTSession();

            BPVisitaduria oBPVisitaduria = new BPVisitaduria();

            try
            {

                // Validaciones
                if (this.ddlTipoResolucion.SelectedIndex == 0) { throw new Exception("El campo [Tipo de Resolución] es requerido"); }
                if (this.ddlTipoResolucion.SelectedItem.Value == "1") { throw new Exception("Es necesario determinar el Tipo de Resolución"); }
                if (this.ckeDetalle.Text.Trim() == "") { throw (new Exception("Es necesario ingresar un detalle de la resolución")); }

                // Obtener sesión
                SessionEntity = (ENTSession)Session["oENTSession"];

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.FuncionarioId = SessionEntity.FuncionarioId;
                oENTVisitaduria.TipoResolucionId = Int32.Parse(this.ddlTipoResolucion.SelectedItem.Value);
                oENTVisitaduria.Detalle = this.ckeDetalle.Text.Trim();

                // Transacción
                oENTResponse = oBPVisitaduria.InsertExpedienteResolucion(oENTVisitaduria);

                // Errores y Warnings
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 2
0
        void SelectAutoridad_ForEdit()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.AutoridadId = Int32.Parse(this.hddAutoridadId.Value);

                // Transacción
                oENTResponse = oBPVisitaduria.SelectExpedienteAutoridad_Detalle(oENTVisitaduria);

                // Errores
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }

                // Llenado de control
                this.ddlAutoridadNivel1.SelectedValue = oENTResponse.dsResponse.Tables[0].Rows[0]["NivelId1"].ToString();
                SelectAutoridadNivel2();

                this.ddlAutoridadNivel2.SelectedValue = oENTResponse.dsResponse.Tables[0].Rows[0]["NivelId2"].ToString();
                SelectAutoridadNivel3();

                this.ddlAutoridadNivel3.SelectedValue = oENTResponse.dsResponse.Tables[0].Rows[0]["NivelId3"].ToString();
                this.ddlCalificacionAutoridad.SelectedValue = oENTResponse.dsResponse.Tables[0].Rows[0]["CalificacionAutoridadId"].ToString();

                tbActionNombreFuncionario.Text = oENTResponse.dsResponse.Tables[0].Rows[0]["Nombre"].ToString();
                tbActionPuestoActual.Text = oENTResponse.dsResponse.Tables[0].Rows[0]["Puesto"].ToString();
                tbActionComentarios.Text = oENTResponse.dsResponse.Tables[0].Rows[0]["Comentarios"].ToString();

                this.btnActionAutoridad.Text = "Confirmar autoridad";
                this.lblActionTitle.Text = "Confirmar autoridad";
                this.pnlAction.Visible = true;

                // Foco
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "focusControl('" + this.ddlCalificacionAutoridad.ClientID + "');", true);

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 3
0
        public void PresentaReporte(string TipoReporte, DateTime FechaInicial, DateTime FechaFinal, int AreaId)
        {
            ENTResponse oResponse = new ENTResponse();
            System.Data.DataSet ds = new System.Data.DataSet();

            try
            {
                switch (TipoReporte)
                {
                    case "rptVisitaduriaGeneralpage":

                        // Declara Entidad y Buiseness
                        ENTVisitaduria entGVis = new ENTVisitaduria();
                        BPVisitaduria bssGVis = new BPVisitaduria();

                        // Asigna valores
                        entGVis.FechaDesde = FechaInicial.ToString("yyyy-MM-dd");
                        entGVis.FechaHasta = FechaFinal.ToString("yyyy-MM-dd");
                        entGVis.AreaId = AreaId;

                        //// Consulta reporte
                        oResponse = bssGVis.RptGeneralVisitaduria(entGVis);

                        oResponse.dsResponse.Tables[0].TableName = "tblExpPeriodo_I";
                        oResponse.dsResponse.Tables[1].TableName = "tblExpMedidaCautelar_II";
                        oResponse.dsResponse.Tables[2].TableName = "tblExpSolicitudGestion_III";
                        oResponse.dsResponse.Tables[3].TableName = "tblExpVisitaduriaGeneral_IV";
                        oResponse.dsResponse.Tables[4].TableName = "tblExpConcluidos_V";
                        oResponse.dsResponse.Tables[5].TableName = "tblExpNivelAutoridadVI";
                        oResponse.dsResponse.Tables[6].TableName = "tblPersonasAtendidasVII";
                        oResponse.dsResponse.Tables[7].TableName = "tblEntrevistas_VIII";
                        oResponse.dsResponse.Tables[8].TableName = "tblSupervisores_IX";
                        oResponse.dsResponse.Tables[9].TableName = "tblResultados_X";
                        oResponse.dsResponse.Tables[10].TableName = "tblDatosGenerales";

                        rptVisGeneral rptVisitaduriaGeneral = new rptVisGeneral();
                        rptVisitaduriaGeneral.SetDataSource(oResponse.dsResponse);
                        //// Presenta reporte
                        crViewer.ReportSource = rptVisitaduriaGeneral;
                        break;

                    case "rptEstadisticaPresidencia":
                        // Declara Entidad y Buiseness
                        ENTQueja entEstadisticaPresindecia = new ENTQueja();
                        BPQueja bssEstadisticaPresindecia = new BPQueja();

                        // Asigna valores
                        entEstadisticaPresindecia.FechaDesde = FechaInicial.ToString("yyyy-MM-dd");
                        entEstadisticaPresindecia.FechaHasta = FechaFinal.ToString("yyyy-MM-dd");

                        // Consulta reporte
                        oResponse = bssEstadisticaPresindecia.RptEstadisticaPresidencia(entEstadisticaPresindecia);

                        oResponse.dsResponse.Tables[0].TableName = "tblEncabezado_0";
                        oResponse.dsResponse.Tables[1].TableName = "tblEncabezado_I";
                        oResponse.dsResponse.Tables[2].TableName = "tblIntervenciones_II";
                        oResponse.dsResponse.Tables[3].TableName = "tblAsignacionExpediente_III";
                        oResponse.dsResponse.Tables[4].TableName = "tblMecanismoApertura_IV";
                        oResponse.dsResponse.Tables[5].TableName = "tblAsignaionExpQuejas_V";
                        oResponse.dsResponse.Tables[6].TableName = "tblAsignacionExpCautelares_VI";
                        oResponse.dsResponse.Tables[7].TableName = "tblAsignacionExpGestion_VII";
                        oResponse.dsResponse.Tables[8].TableName = "tblQuejasVulnerabilidad_VIII";
                        oResponse.dsResponse.Tables[9].TableName = "tblListadoExpGeneral_IX";
                        oResponse.dsResponse.Tables[10].TableName = "tblListadoCautelares_X";
                        oResponse.dsResponse.Tables[11].TableName = "tblSolicitudesGestion_XI";
                        oResponse.dsResponse.Tables[12].TableName = "tblExpQuejaAutoridad_XII";
                        oResponse.dsResponse.Tables[13].TableName = "tblDiligenciasYEntrevistas_XIII";
                        oResponse.dsResponse.Tables[14].TableName = "tblGrupoPersonasRelacionadas_XIV";
                        oResponse.dsResponse.Tables[15].TableName = "tblOrigenPersonasRelacionadas_XV";
                        oResponse.dsResponse.Tables[16].TableName = "tblDatosGenerales";

                        rptEstadisticaPresidencia rptCREstadisticaPresidencia = new rptEstadisticaPresidencia();
                        rptCREstadisticaPresidencia.SetDataSource(oResponse.dsResponse);
                        crViewer.ReportSource = rptCREstadisticaPresidencia;
                        break;

                    case "rptIntegralVictimas":
                        // Declara Entidad y Buiseness
                        ENTAtencion entIntegralVictimas = new ENTAtencion();
                        BPAtencion bssIntegralVictimas = new BPAtencion();

                        // Asigna valores
                        entIntegralVictimas.FechaDesde = FechaInicial.ToString("yyyy-MM-dd");
                        entIntegralVictimas.FechaHasta = FechaFinal.ToString("yyyy-MM-dd");

                        // Consulta reporte
                        oResponse = bssIntegralVictimas.RptIntegralVictimas(entIntegralVictimas);

                        oResponse.dsResponse.Tables[0].TableName = "tblDMFPrevioLesiones_I";
                        oResponse.dsResponse.Tables[1].TableName = "tblDMFPrevioLesionesPorGenero_II";
                        oResponse.dsResponse.Tables[2].TableName = "tblDMFPrevioLesionesEstatus_III";
                        oResponse.dsResponse.Tables[3].TableName = "tblDictamenPsicologico_163_IV";
                        oResponse.dsResponse.Tables[4].TableName = "tblDictamenPsicologico_163_PorGenero_V";
                        oResponse.dsResponse.Tables[5].TableName = "tblOpinionMedica_VI";
                        oResponse.dsResponse.Tables[6].TableName = "tblDesgloseDictamen_VII";
                        oResponse.dsResponse.Tables[7].TableName = "tblAcompanamientoEmocional_VIII";
                        oResponse.dsResponse.Tables[7].TableName = "tblClimaLaboral_IX";
                        oResponse.dsResponse.Tables[9].TableName = "tblDatosGenerales";

                        //rptEstadisticaPresidencia rptCR = new rptEstadisticaPresidencia();
                        rptIntegralVictimas rptCRIntegralVictimas = new rptIntegralVictimas();
                        rptCRIntegralVictimas.SetDataSource(oResponse.dsResponse);
                        crViewer.ReportSource = rptCRIntegralVictimas;
                        break;
                }
            }
            catch
            { }
            finally
            { }
        }
Exemplo n.º 4
0
        void UpdateExpedienteAutoridadVoces()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            DropDownList ddlCalificacionVoz = null;
            TextBox txtComentario = null;

            DataRow rowVoz;

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.AutoridadId = Int32.Parse(this.hddAutoridadId.Value);
                oENTVisitaduria.ModuloId = 3; // Visitadurías

                oENTVisitaduria.tblVoz = new DataTable("tblVoz");
                oENTVisitaduria.tblVoz.Columns.Add("VozId", typeof(Int32));
                oENTVisitaduria.tblVoz.Columns.Add("CalificacionAutoridadId", typeof(Int32));
                oENTVisitaduria.tblVoz.Columns.Add("Comentario", typeof(String));

                foreach(GridViewRow gvRow in this.gvAutoridadVoces.Rows){

                    // Obtener controles
                    txtComentario = (TextBox)this.gvAutoridadVoces.Rows[gvRow.RowIndex].FindControl("txtComentarioVoz");
                    ddlCalificacionVoz = (DropDownList)this.gvAutoridadVoces.Rows[gvRow.RowIndex].FindControl("ddlCalificacionVoz");

                    rowVoz = oENTVisitaduria.tblVoz.NewRow();
                    rowVoz["VozId"] = this.gvAutoridadVoces.DataKeys[gvRow.RowIndex]["VozId"].ToString();
                    rowVoz["CalificacionAutoridadId"] = ddlCalificacionVoz.SelectedItem.Value;
                    rowVoz["Comentario"] = txtComentario.Text;
                    oENTVisitaduria.tblVoz.Rows.Add(rowVoz);

                }

                // Transacción
                oENTResponse = oBPVisitaduria.UpdateExpedienteAutoridadVoces(oENTVisitaduria);

                //Validaciones
                if (oENTResponse.GeneratesException) { throw new Exception(oENTResponse.sErrorMessage); }
                if (oENTResponse.sMessage != "") { throw new Exception(oENTResponse.sMessage); }

                // Refrescar pantalla principal
                SelectExpediente();

                // Transacción exitosa
                this.pnlVoces.Visible = false;
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('Hechos Violatorios actualizados con éxito');", true);

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 5
0
        void InsertExpedienteAutoridad()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            Int32 AutoridadId = 0;

            try
            {

                // Validaciones
                if (this.ddlAutoridadNivel1.SelectedValue == "0") { throw new Exception("Debe elegir una autoridad de primer nivel"); }
                if (this.ddlAutoridadNivel2.SelectedValue == "0") { throw new Exception("Debe elegir una autoridad de segundo nivel"); }
                if (this.ddlAutoridadNivel3.SelectedValue == "0") { throw new Exception("Debe elegir una autoridad de tercer nivel"); }
                if (this.ddlCalificacionAutoridad.SelectedValue == "0") { throw new Exception("Debe seleccionar una calificación para la autoridad"); }
                if (this.ddlCalificacionAutoridad.SelectedValue == "1") { throw new Exception("Debe seleccionar una calificación para la autoridad"); }
                if (String.IsNullOrEmpty(this.tbActionNombreFuncionario.Text)) { throw new Exception("El campo [Nombre] es requerido"); }
                if (String.IsNullOrEmpty(this.tbActionPuestoActual.Text)) { throw new Exception("El campo [Puesto Actual] es requerido"); }
                if (String.IsNullOrEmpty(this.tbActionComentarios.Text)) { throw new Exception("El campo [Comentarios] es requerido"); }

                // Determinar la última autoridad seleccionada
                AutoridadId = Convert.ToInt32(this.ddlAutoridadNivel1.SelectedValue);
                if (this.ddlAutoridadNivel2.SelectedIndex > 0) { AutoridadId = Convert.ToInt32(this.ddlAutoridadNivel2.SelectedValue); }
                if (this.ddlAutoridadNivel3.SelectedIndex > 0) { AutoridadId = Convert.ToInt32(this.ddlAutoridadNivel3.SelectedValue); }

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.AutoridadId = AutoridadId;
                oENTVisitaduria.CalificacionAutoridadId = Int32.Parse(this.ddlCalificacionAutoridad.SelectedItem.Value);
                oENTVisitaduria.ModuloId = 3; // Visitadurías
                oENTVisitaduria.Nombre = tbActionNombreFuncionario.Text;
                oENTVisitaduria.Puesto = tbActionPuestoActual.Text;
                oENTVisitaduria.Comentario = tbActionComentarios.Text;

                // Transacción
                oENTResponse = oBPVisitaduria.InsertExpedienteAutoridad(oENTVisitaduria);

                //Validaciones
                if (oENTResponse.GeneratesException) { throw new Exception(oENTResponse.sErrorMessage); }
                if (oENTResponse.sMessage != "") { throw new Exception(oENTResponse.sMessage); }

                // Refrescar pantalla principal
                SelectExpediente();

                // Transacción exitosa
                this.pnlAction.Visible = false;
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('Autoridad creada con éxito');", true);

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 6
0
        void SelectExpediente()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);

                // Transacción
                oENTResponse = oBPVisitaduria.SelectExpediente_Detalle(oENTVisitaduria);

                // Errores y Warnings
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

                // Campos ocultos
                this.hddExpedienteId.Value = oENTResponse.dsResponse.Tables[1].Rows[0]["ExpedienteId"].ToString();

                // Formulario
                this.ExpedienteNumero.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["ExpedienteNumero"].ToString();
                this.SolicitudNumero.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["SolicitudNumero"].ToString();
                this.CalificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionNombre"].ToString();
                this.EstatusaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["EstatusNombre"].ToString();
                this.AfectadoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Afectado"].ToString();
                this.AreaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["AreaNombre"].ToString();
                this.ResolucionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoResolucionNombre"].ToString();

                this.FuncionarioLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FuncionarioNombre"].ToString();
                this.ContactoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FormaContactoNombre"].ToString();
                this.TipoSolicitudLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoSolicitudNombre"].ToString();
                this.ProblematicaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["ProblematicaNombre"].ToString();
                this.ProblematicaDetalleLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["ProblematicaDetalleNombre"].ToString();

                this.FechaRecepcionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaRecepcion"].ToString();
                this.FechaAsignacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaAsignacion"].ToString();
                this.FechaQuejasLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaQuejas"].ToString();
                this.FechaVisitaduriasLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaVisitadurias"].ToString();
                this.FechaModificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaUltimaModificacion"].ToString();
                this.NivelAutoridadLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["NivelAutoridadNombre"].ToString();
                this.MecanismoAperturaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["MecanismoAperturaNombre"].ToString();

                this.TipoOrientacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoOrientacionNombre"].ToString();
                this.LugarHechosLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["LugarHechosNombre"].ToString();
                this.DireccionHechosLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["DireccionHechos"].ToString();
                this.ObservacionesLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Observaciones"].ToString();
                this.FundamentoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Fundamento"].ToString();

                // Cierre de Orientación
                if ( oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionId"].ToString() != "3" ){
                    this.CierreOrientacionLabel.Visible = false;
                    this.TipoOrientacionLabel.Visible = false;
                }

                // Canalizaciones
                if (oENTResponse.dsResponse.Tables[2].Rows.Count > 0){

                    this.CanalizacionesLabel.Visible = true;

                    this.grdCanalizacion.DataSource = oENTResponse.dsResponse.Tables[2];
                    this.grdCanalizacion.DataBind();
                }

                // Autoridades
                this.gvAutoridades.DataSource = oENTResponse.dsResponse.Tables[10];
                this.gvAutoridades.DataBind();

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 7
0
        void SelectVoz_ForEdit()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.AutoridadId = Int32.Parse(this.hddAutoridadId.Value);

                // Consulta de autoridades
                oENTResponse = oBPVisitaduria.SelectExpedienteAutoridad_Detalle(oENTVisitaduria);

                // Errores
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }

                // Llenado de formulario
                this.lblVocesNivel1.Text = oENTResponse.dsResponse.Tables[0].Rows[0]["Nivel1"].ToString();
                this.lblVocesNivel2.Text = oENTResponse.dsResponse.Tables[0].Rows[0]["Nivel2"].ToString();
                this.lblVocesNivel3.Text = oENTResponse.dsResponse.Tables[0].Rows[0]["Nivel3"].ToString();
                this.lblVocesNombre.Text = oENTResponse.dsResponse.Tables[0].Rows[0]["Nombre"].ToString();
                this.lblVocesPuesto.Text = oENTResponse.dsResponse.Tables[0].Rows[0]["Puesto"].ToString();
                this.lblVocesObservaciones.Text = oENTResponse.dsResponse.Tables[0].Rows[0]["Comentarios"].ToString();

                // Consulta de voces
                oENTResponse = new ENTResponse();
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.AutoridadId = Int32.Parse(this.hddAutoridadId.Value);
                oENTResponse = oBPVisitaduria.SelectExpedienteAutoridadVoces(oENTVisitaduria);

                // Errores
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }

                // Llenado de voces
                this.gvAutoridadVoces.DataSource = oENTResponse.dsResponse.Tables[0];
                this.gvAutoridadVoces.DataBind();

                // LLenado del primer combo
                SelectVozNivel1();

                // Foco
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "focusControl('" + this.ddlVocesTemporal_Nivel1.ClientID + "');", true);

                // Mostrar el panel
                this.btnActionAutoridad.Text = "Confirmar voces";
                this.lblActionTitle.Text = "Confirmar voces";
                this.pnlVoces.Visible = true;

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 8
0
        void InsertExpedienteCiudadano()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();

            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();
            ENTSession SessionEntity = new ENTSession();

            String CiudadanoId;
            String CiudadanoNombre;

            try
            {

                // Obtener información del ciudadano del Autosuggest
                CiudadanoId = this.Request.Form[this.hddCiudadanoId.UniqueID];
                CiudadanoNombre = this.Request.Form[this.txtCiudadano.UniqueID];

                // Normalización
                if (CiudadanoId == "") { CiudadanoId = "0"; }
                CiudadanoNombre = CiudadanoNombre.Trim();

                // Validaciones
                if (CiudadanoNombre == "" ) { throw new Exception("El campo [Nombre del ciudadano] es requerido"); }
                if (this.ddlTipoParticipacion.SelectedItem.Value == "0") { throw new Exception("El campo [Tipo de Participación] es requerido"); }

                // Obtener la sesión
                SessionEntity = (ENTSession)Session["oENTSession"];

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.UsuarioId = SessionEntity.idUsuario;
                oENTVisitaduria.CiudadanoId = Int32.Parse(CiudadanoId);
                oENTVisitaduria.ModuloId = 3; // Visitadurías
                oENTVisitaduria.TipoParticipacionId = Int32.Parse(this.ddlTipoParticipacion.SelectedItem.Value);
                oENTVisitaduria.Check = 1; // Validar el Nombre del control con el Id debido al Bug del Autosuggest
                oENTVisitaduria.CheckNombre = CiudadanoNombre;
                oENTVisitaduria.Presente = Int16.Parse((this.rblPresente.Items[0].Selected ? 1 : 0).ToString());

                // Transacción
                oENTResponse = oBPVisitaduria.InsertExpedienteCiudadano(oENTVisitaduria);

                // Errores y Warnings
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage));  }

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 9
0
        void UpdateExpediente_CambioArea()
        {
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();
            ENTSession oENTSession;

            BPVisitaduria oBPVisitaduria = new BPVisitaduria();

            try
            {

                // Validaciones
                if (this.ddlArea.SelectedItem.Value == "0") { throw (new Exception("Es necesario seleccionar una Área")); }
                if (this.ckeComentario.Text.Trim() == "") { throw (new Exception("Es necesario ingresar un comentario")); }

                // Obtener Sesion
                oENTSession = (ENTSession)this.Session["oENTSession"];

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.AreaId = Int32.Parse(this.ddlArea.SelectedItem.Value);
                oENTVisitaduria.UsuarioId = oENTSession.idUsuario;
                oENTVisitaduria.Comentario = this.ckeComentario.Text.Trim();

                // Transacción
                oENTResponse = oBPVisitaduria.UpdateExpediente_CambioArea(oENTVisitaduria);

                // Errores y Warnings
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

            }catch (Exception ex){
                throw (ex);
            }
        }
        void RechazarProyecto()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.EstatusId = 6; // Por atender expediente en Visitadurías
                oENTVisitaduria.ModuloId = 3; // Visitadurías

                //Transacción
                oENTResponse = oBPVisitaduria.UpdateExpedienteEstatus(oENTVisitaduria);

                //Validación
                if (oENTResponse.GeneratesException) { throw new Exception(oENTResponse.sErrorMessage); }
                if (oENTResponse.sMessage != "") { throw new Exception(oENTResponse.sMessage); }

            }catch (Exception ex){
                throw (ex);
            }
        }
        void SelectExpediente()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            ENTSession oSession = (ENTSession)Session["oENTSession"];

            try
            {

                // Formulario
                oENTVisitaduria.AreaId = Int32.Parse(this.ddlArea.SelectedItem.Value);
                oENTVisitaduria.UsuarioId = oSession.idUsuario;
                oENTVisitaduria.Nivel = 1;

                // Transacción
                oENTResponse = oBPVisitaduria.SelectExpediente(oENTVisitaduria);

                // Errores
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }

                // Warnings
                if (oENTResponse.sMessage != "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('" + oENTResponse.sMessage + "');", true); }

                // Llenado de control
                this.gvExpediente.DataSource = oENTResponse.dsResponse.Tables[1];
                this.gvExpediente.DataBind();

                // Si es Director Inhabilitar panel de consulta de Área
                if ( oSession.idRol == 9) {
                    this.pnlFormulario.Visible = false;
                    this.hddAreaVisible.Value = "0";
                }

            }catch (Exception ex){
                throw (ex);
            }
        }
        // Rutinas del programador
        void AprobarProyecto()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();

            ENTSession SessionEntity = new ENTSession();

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.EstatusId = 23; // Proyecto Aprobado
                oENTVisitaduria.ModuloId = 3; // Visitadurías
                oENTVisitaduria.UsuarioId = SessionEntity.idUsuario;

                //Transacción
                oENTResponse = oBPVisitaduria.UpdateExpedienteEstatus(oENTVisitaduria);

                //Validación
                if (oENTResponse.GeneratesException) { throw new Exception(oENTResponse.sErrorMessage); }
                if (oENTResponse.sMessage != "") { throw new Exception(oENTResponse.sMessage); }

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 13
0
        // Funciones del programador
        Boolean ValidaVoz(Int32 AutoridadId)
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            Boolean Response = true;

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.AutoridadId = AutoridadId;

                // Transacción
                oENTResponse = oBPVisitaduria.SelectExpedienteAutoridadVoces(oENTVisitaduria);

                // Errores
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }

                // Validación
                if (oENTResponse.dsResponse.Tables[0].Select("CalificacionVozId=1").Length > 0) { Response = false; }

            }catch (Exception ex){
                throw (ex);
            }

            return Response;
        }
Exemplo n.º 14
0
        void SetCheckList()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            String AtencionVictimas = "0";

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);

                // Transacción
                oENTResponse = oBPVisitaduria.SelectExpediente_Detalle(oENTVisitaduria);

                // Errores y Warnings
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

                // Atención a victimas (No impide el envío)
                if ( oENTResponse.dsResponse.Tables[14].Rows.Count > 0 ){

                    if ( oENTResponse.dsResponse.Tables[14].Select("EstatusId <> 21").Length == 0 ){

                        AtencionVictimas = "2";
                    }else{

                        AtencionVictimas = "1";
                    }
                }

                switch( AtencionVictimas ){
                    case"0":

                        this.AtencionPanel.Visible = false;
                        break;

                    case "1":

                        this.imgAtencion.ImageUrl = "~/Include/Image/Icon/AtencionVictimasIcon_Warning.png";
                        this.imgAtencion.ToolTip = "Existen atenciones a víctimas asociadas a la solicitud sin cerrar";
                        break;

                    default:
                        // Do Nothing
                        break;
                }

                // Gestiones
                if (oENTResponse.dsResponse.Tables[12].Rows.Count == 0){
                    this.imgGestion.ImageUrl = "~/Include/Image/Icon/SeguimientoIcon_Pending.png";
                    this.imgGestion.ToolTip = "No se han capturado gestiones en el Expediente";
                    this.btnEnviar.Enabled = false;
                    this.btnEnviar.CssClass = "Button_General_Disabled";
                }

                // Autoridades y Voces
                if (oENTResponse.dsResponse.Tables[10].Select("CalificacionAutoridadId=1").Length > 0 ){
                    this.imgAutoridad.ImageUrl = "~/Include/Image/Icon/AutoridadIcon_Pending.png";
                    this.imgAutoridad.ToolTip = "No se han calificado algunas autoridades en el Expediente";
                    this.btnEnviar.Enabled = false;
                    this.btnEnviar.CssClass = "Button_General_Disabled";
                }

                foreach(DataRow rowAutoridad in oENTResponse.dsResponse.Tables[10].Rows){

                    if (ValidaVoz( Int32.Parse( rowAutoridad["AutoridadId"].ToString()) ) == false){

                        this.imgAutoridad.ImageUrl = "~/Include/Image/Icon/AutoridadIcon_Pending.png";
                        this.imgAutoridad.ToolTip = "No se han calificado algunos hechos violatorios en el Expediente";
                        this.btnEnviar.Enabled = false;
                        this.btnEnviar.CssClass = "Button_General_Disabled";
                    }
                }

                // Resolución
                if (oENTResponse.dsResponse.Tables[1].Rows[0]["TipoResolucionId"].ToString() == "1"){
                    this.imgResolucion.ImageUrl = "~/Include/Image/Icon/ResolucionIcon_Pending.png";
                    this.imgResolucion.ToolTip = "No se ha resuelto el Expediente";
                    this.btnEnviar.Enabled = false;
                    this.btnEnviar.CssClass = "Button_General_Disabled";
                }

                // Recomendación
                if (oENTResponse.dsResponse.Tables[1].Rows[0]["TipoResolucionId"].ToString() == "2"){

                    if (oENTResponse.dsResponse.Tables[11].Rows.Count == 0){
                        this.imgRecomendacion.ImageUrl = "~/Include/Image/Icon/RecomendacionIcon_Pending.png";
                        this.imgRecomendacion.ToolTip = "No se han asociado recomendaciones en el Expediente";
                        this.btnEnviar.Enabled = false;
                        this.btnEnviar.CssClass = "Button_General_Disabled";
                    }

                }else{

                    this.pnlRecomendacion.Visible = false;

                }

                // Acuerdo de No Responsabilidad
                if (oENTResponse.dsResponse.Tables[1].Rows[0]["TipoResolucionId"].ToString() == "3"){

                    if (oENTResponse.dsResponse.Tables[13].Rows.Count == 0){
                        this.imgAcuerdoNoResponsabilidad.ImageUrl = "~/Include/Image/Icon/RecomendacionIcon_Pending.png";
                        this.imgAcuerdoNoResponsabilidad.ToolTip = "No se han asociado Acuerdo de No Responsabilidad en el Expediente";
                        this.btnEnviar.Enabled = false;
                        this.btnEnviar.CssClass = "Button_General_Disabled";
                    }

                }else{

                    this.pnlAcuerdoNoResponsabilidad.Visible = false;

                }

            }catch (Exception ex){
                this.btnEnviar.Enabled = false;
                this.btnEnviar.CssClass = "Button_General_Disabled";
                throw (ex);
            }
        }
Exemplo n.º 15
0
        void SelectExpediente()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);

                // Transacción
                oENTResponse = oBPVisitaduria.SelectExpediente_Detalle(oENTVisitaduria);

                // Errores y Warnings
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

                // Formulario
                this.ExpedienteNumero.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["ExpedienteNumero"].ToString();
                this.SolicitudNumero.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["SolicitudNumero"].ToString();
                this.CalificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionNombre"].ToString();
                this.EstatusaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["EstatusNombre"].ToString();
                this.AfectadoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Afectado"].ToString();
                this.AreaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["AreaNombre"].ToString();
                this.ResolucionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoResolucionNombre"].ToString();

                this.FuncionarioLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FuncionarioNombre"].ToString();
                this.ContactoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FormaContactoNombre"].ToString();
                this.TipoSolicitudLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoSolicitudNombre"].ToString();
                this.ProblematicaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["ProblematicaNombre"].ToString();
                this.ProblematicaDetalleLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["ProblematicaDetalleNombre"].ToString();

                this.FechaRecepcionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaRecepcion"].ToString();
                this.FechaAsignacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaAsignacion"].ToString();
                this.FechaQuejasLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaQuejas"].ToString();
                this.FechaVisitaduriasLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaVisitadurias"].ToString();
                this.FechaModificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaUltimaModificacion"].ToString();
                this.NivelAutoridadLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["NivelAutoridadNombre"].ToString();
                this.MecanismoAperturaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["MecanismoAperturaNombre"].ToString();

                this.TipoOrientacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoOrientacionNombre"].ToString();
                this.LugarHechosLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["LugarHechosNombre"].ToString();
                this.DireccionHechosLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["DireccionHechos"].ToString();
                this.ObservacionesLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Observaciones"].ToString();

                // Cierre de Orientación
                if ( oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionId"].ToString() != "3" ){
                    this.CierreOrientacionLabel.Visible = false;
                    this.TipoOrientacionLabel.Visible = false;
                }

                // Canalizaciones
                if (oENTResponse.dsResponse.Tables[2].Rows.Count > 0){

                    this.CanalizacionesLabel.Visible = true;

                    this.grdCanalizacion.DataSource = oENTResponse.dsResponse.Tables[2];
                    this.grdCanalizacion.DataBind();
                }

                // Resolución
                this.ddlTipoResolucion.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoResolucionId"].ToString();
                this.ckeDetalle.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["DetalleResolucion"].ToString();

                // Script de Validación de cambio de estatus (Antes Recomendacion)
                if (oENTResponse.dsResponse.Tables[1].Rows[0]["TipoResolucionId"].ToString() == "2"){
                    this.btnGuardar.Attributes.Add("onclick", " if ( document.getElementById('" + this.ddlTipoResolucion.ClientID + "').options[document.getElementById('" + this.ddlTipoResolucion.ClientID + "').selectedIndex].value != 2 ) { return confirm('Al cambiar la resolución se eliminarán todas las capturas de Recomendaciones realizadas en el Expediente, ¿Seguro que desea continuar?'); }");
                }

                // Script de Validación de cambio de estatus (Antes Acuerdo de No Responsabilidad)
                if (oENTResponse.dsResponse.Tables[1].Rows[0]["TipoResolucionId"].ToString() == "3"){
                    this.btnGuardar.Attributes.Add("onclick", " if ( document.getElementById('" + this.ddlTipoResolucion.ClientID + "').options[document.getElementById('" + this.ddlTipoResolucion.ClientID + "').selectedIndex].value != 3 ) { return confirm('Al cambiar la resolución se eliminarán todas las capturas de Acuerdos de No Responsabilidad realizadas en el Expediente, ¿Seguro que desea continuar?'); }");
                }

            }catch (Exception ex){
                throw (ex);
            }
        }
        void SelectExpedienteAutoridad()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.AutoridadId = 0;
                oENTVisitaduria.CalificacionAutoridadId = 2; // No Responsable

                // Consulta de autoridades
                oENTResponse = oBPVisitaduria.SelectExpedienteAutoridad(oENTVisitaduria);

                // Errores
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('" + oENTResponse.sMessage + "'); ", true); }

                // Vaciado de datos
                this.gvAutoridad.DataSource = oENTResponse.dsResponse.Tables[1];
                this.gvAutoridad.DataBind();

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 17
0
        void SelectCalificacionVoz_Variable()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTVisitaduria.CalificacionVozId = 0;
                oENTVisitaduria.Nombre = "";

                // Transacción
                oENTResponse = oBPVisitaduria.SelectCalificacionVoz(oENTVisitaduria);

                // Errores
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }

                // Warnings
                if (oENTResponse.sMessage != "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('" + oENTResponse.sMessage + "');", true); }

                // Llenado de variable
                tblCalificacionVoz = oENTResponse.dsResponse.Tables[1];

            }catch (Exception ex){
                throw (ex);
            }
        }
        // Funciones el programador
        void InsertExpedienteCalificacionDefinitiva()
        {
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();
            ENTSession SessionEntity = new ENTSession();

            BPVisitaduria oBPVisitaduria = new BPVisitaduria();

            try
            {

                // Validaciones
                if (this.ckeAcuerdo.Text.Trim() == "") { throw (new Exception("Es necesario ingresar un acuerdo de calificación definitiva")); }

                // Obtener sesión
                SessionEntity = (ENTSession)Session["oENTSession"];

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.FuncionarioId = SessionEntity.FuncionarioId;
                oENTVisitaduria.Acuerdo = this.ckeAcuerdo.Text.Trim();

                // Transacción
                oENTResponse = oBPVisitaduria.InsertExpedienteCalificacionDefinitiva(oENTVisitaduria);

                // Errores y Warnings
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 19
0
        void SelectVoz_Detalle(ref GridView grdDetalle, Int32 AutoridadId)
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.AutoridadId = AutoridadId;

                // Transacción
                oENTResponse = oBPVisitaduria.SelectExpedienteAutoridadVoces(oENTVisitaduria);

                // Errores
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }

                // Llenado de control
                grdDetalle.DataSource = oENTResponse.dsResponse.Tables[0];
                grdDetalle.DataBind();

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 20
0
        void SelectExpediente( Boolean Recovery)
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTVisitaduria.Numero = this.txtNumeroExpediente.Text.Trim();
                oENTVisitaduria.Nombre = this.txtCiudadano.Text.Trim();
                oENTVisitaduria.AreaId = Int32.Parse(this.ddlArea.SelectedValue);
                oENTVisitaduria.EstatusId = Int32.Parse(this.ddlEstatus.SelectedValue);
                oENTVisitaduria.FuncionarioId = Int32.Parse(this.ddlFuncionario.SelectedValue);
                oENTVisitaduria.TipoResolucionId = Int32.Parse(this.ddlTipoResolucion.SelectedValue);
                oENTVisitaduria.FechaDesde = (Recovery ? dtBeginDate : this.wucBeginDate.BeginDate);
                oENTVisitaduria.FechaHasta = (Recovery ? dtEndDate : this.wucEndDate.EndDate);

                // Transacción
                oENTResponse = oBPVisitaduria.SelectExpediente_Filtro(oENTVisitaduria);

                // Errores
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }

                // Warnings
                if (oENTResponse.sMessage != "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('" + oENTResponse.sMessage + "');", true); }

                // Llenado de control
                this.gvExpediente.DataSource = oENTResponse.dsResponse.Tables[1];
                this.gvExpediente.DataBind();

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 21
0
        void SelectVoz_RefreshGrid()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTResponse = new ENTResponse();
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.AutoridadId = Int32.Parse(this.hddAutoridadId.Value);
                oENTResponse = oBPVisitaduria.SelectExpedienteAutoridadVoces(oENTVisitaduria);

                // Errores
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }

                // Llenado de voces
                this.gvAutoridadVoces.DataSource = oENTResponse.dsResponse.Tables[0];
                this.gvAutoridadVoces.DataBind();

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 22
0
        void DeleteExpedienteComentario(Int32 ComentarioId)
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();

            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.ModuloId = 3; // Visitadurías
                oENTVisitaduria.ComentarioId = ComentarioId;

                // Transacción
                oENTResponse = oBPVisitaduria.DeleteExpedienteComentario(oENTVisitaduria);

                // Errores y Warnings
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 23
0
        void DeleteExpedienteAutoridadVoces(Int32 AutoridadId, Int32 VozId)
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.AutoridadId = AutoridadId;
                oENTVisitaduria.VozId = VozId;
                oENTVisitaduria.ModuloId = 3; // Visitadurías

                // Transacción
                oENTResponse = oBPVisitaduria.DeleteExpedienteAutoridadVoces(oENTVisitaduria);

                //Validaciones
                if (oENTResponse.GeneratesException) { throw new Exception(oENTResponse.sErrorMessage); }
                if (oENTResponse.sMessage != "") { throw new Exception(oENTResponse.sMessage); }

                // Refrescar Grid
                SelectVoz_RefreshGrid();

                // Refrescar pantalla principal
                SelectExpediente();

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 24
0
        void InsertExpedienteComentario()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();

            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();
            ENTSession SessionEntity = new ENTSession();

            try
            {

                // Validaciones
                if (this.ckeComentario.Text.Trim() == "") { throw (new Exception("Es necesario ingresar un comentario")); }

                // Obtener sesión
                SessionEntity = (ENTSession)Session["oENTSession"];

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.ModuloId = 3; // Visitadurías
                oENTVisitaduria.UsuarioId = SessionEntity.idUsuario;
                oENTVisitaduria.Comentario = this.ckeComentario.Text.Trim();
                oENTVisitaduria.MedidaPreventiva = Int16.Parse((this.chkMedidaPreventiva.Checked ? 1 : 0).ToString());

                // Transacción
                oENTResponse = oBPVisitaduria.InsertExpedienteComentario(oENTVisitaduria);

                // Errores y Warnings
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 25
0
        void InsertExpedienteAutoridadVoces()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            Int32 VozId = 0;

            try
            {

                // Validaciones
                if (this.ddlVocesTemporal_Nivel1.SelectedValue == "0") { throw new Exception("Debe elegir un Hecho Violatorio de primer nivel"); }
                if (this.ddlVocesTemporal_Nivel2.SelectedValue == "0") { throw new Exception("Debe elegir un Hecho Violatorio de segundo nivel"); }
                if (this.ddlVocesTemporal_Nivel3.SelectedValue == "0") { throw new Exception("Debe elegir un Hecho Violatorio de tercer nivel"); }
                if (this.ddlCalificacionVoces.SelectedValue == "0") { throw new Exception("Debe seleccionar una calificación para el Hecho Violatorio"); }
                if (this.ddlCalificacionVoces.SelectedValue == "1") { throw new Exception("Debe seleccionar una calificación para el Hecho Violatorio"); }

                // Determinar la última voz seleccionada
                VozId = Convert.ToInt32(this.ddlVocesTemporal_Nivel1.SelectedValue);
                if (this.ddlVocesTemporal_Nivel2.SelectedIndex > 0) { VozId = Convert.ToInt32(this.ddlVocesTemporal_Nivel2.SelectedValue); }
                if (this.ddlVocesTemporal_Nivel3.SelectedIndex > 0) { VozId = Convert.ToInt32(this.ddlVocesTemporal_Nivel3.SelectedValue); }

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.AutoridadId = Int32.Parse(this.hddAutoridadId.Value);
                oENTVisitaduria.VozId = VozId;
                oENTVisitaduria.CalificacionVozId = Int32.Parse(this.ddlCalificacionVoces.SelectedItem.Value);
                oENTVisitaduria.ModuloId = 3; // Visitadurías
                oENTVisitaduria.Comentario = this.txtVocesTemporal_Comentarios.Text.Trim();

                // Transacción
                oENTResponse = oBPVisitaduria.InsertExpedienteAutoridadVoces(oENTVisitaduria);

                //Validaciones
                if (oENTResponse.GeneratesException) { throw new Exception(oENTResponse.sErrorMessage); }
                if (oENTResponse.sMessage != "") { throw new Exception(oENTResponse.sMessage); }

                // Refrescar Grid
                SelectVoz_RefreshGrid();

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 26
0
        void SelectExpediente()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);

                // Transacción
                oENTResponse = oBPVisitaduria.SelectExpediente_Detalle(oENTVisitaduria);

                // Errores y Warnings
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

                // Campos ocultos
                this.hddEstatusId.Value = oENTResponse.dsResponse.Tables[1].Rows[0]["EstatusId"].ToString();
                this.hddFuncionarioId.Value = oENTResponse.dsResponse.Tables[1].Rows[0]["FuncionarioId"].ToString();
                this.hddTipoResolucionId.Value = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoResolucionId"].ToString();

                // Formulario
                this.ExpedienteNumero.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["ExpedienteNumero"].ToString();
                this.SolicitudNumero.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["SolicitudNumero"].ToString();
                this.CalificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionNombre"].ToString();
                this.EstatusaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["EstatusNombre"].ToString();
                this.AfectadoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Afectado"].ToString();
                this.AreaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["AreaNombre"].ToString();
                this.ResolucionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoResolucionNombre"].ToString();

                this.FuncionarioLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FuncionarioNombre"].ToString();
                this.ContactoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FormaContactoNombre"].ToString();
                this.TipoSolicitudLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoSolicitudNombre"].ToString();
                this.ProblematicaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["ProblematicaNombre"].ToString();
                this.ProblematicaDetalleLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["ProblematicaDetalleNombre"].ToString();

                this.FechaRecepcionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaRecepcion"].ToString();
                this.FechaAsignacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaAsignacion"].ToString();
                this.FechaQuejasLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaQuejas"].ToString();
                this.FechaVisitaduriasLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaVisitadurias"].ToString();
                this.FechaModificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaUltimaModificacion"].ToString();
                this.NivelAutoridadLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["NivelAutoridadNombre"].ToString();
                this.MecanismoAperturaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["MecanismoAperturaNombre"].ToString();

                this.TipoOrientacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoOrientacionNombre"].ToString();
                this.LugarHechosLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["LugarHechosNombre"].ToString();
                this.DireccionHechosLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["DireccionHechos"].ToString();
                this.ObservacionesLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Observaciones"].ToString();
                this.FundamentoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Fundamento"].ToString();

                // Cierre de Orientación
                if ( oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionId"].ToString() != "3" ){
                    this.CierreOrientacionLabel.Visible = false;
                    this.TipoOrientacionLabel.Visible = false;
                }

                // Canalizaciones
                if (oENTResponse.dsResponse.Tables[2].Rows.Count > 0){

                    this.CanalizacionesLabel.Visible = true;

                    this.grdCanalizacion.DataSource = oENTResponse.dsResponse.Tables[2];
                    this.grdCanalizacion.DataBind();
                }

                // Ciudadanos
                this.gvCiudadano.DataSource = oENTResponse.dsResponse.Tables[3];
                this.gvCiudadano.DataBind();

                // Documentos
                if (oENTResponse.dsResponse.Tables[4].Rows.Count == 0){

                    this.SinDocumentoLabel.Text = "<br /><br />No hay documentos anexados al Expediente";
                }else{

                    this.SinDocumentoLabel.Text = "";
                    this.dlstDocumentoList.DataSource = oENTResponse.dsResponse.Tables[4];
                    this.dlstDocumentoList.DataBind();
                }

                // Asuntos
                if (oENTResponse.dsResponse.Tables[5].Rows.Count == 0){

                    this.SinComentariosLabel.Text = "<br /><br />No hay asuntos para este Expediente";
                    this.repComentarios.DataSource = null;
                    this.repComentarios.DataBind();
                    this.ComentarioTituloLabel.Text = "";
                }else{

                    this.SinComentariosLabel.Text = "";
                    this.repComentarios.DataSource = oENTResponse.dsResponse.Tables[5];
                    this.repComentarios.DataBind();
                    this.ComentarioTituloLabel.Text = oENTResponse.dsResponse.Tables[5].Rows.Count.ToString() + " asuntos";

                    CheckDeleteLinkComentario();

                }

                // Grupos Minoritarios
                this.chkIndicadores.DataTextField = "Nombre";
                this.chkIndicadores.DataValueField = "IndicadorId";
                this.chkIndicadores.DataSource = oENTResponse.dsResponse.Tables[7];
                this.chkIndicadores.DataBind();

                for (int k = 0; k < this.chkIndicadores.Items.Count; k++) {

                    this.chkIndicadores.Items[k].Selected = true;
                    this.chkIndicadores.Items[k].Enabled = false;
                }

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 27
0
        void SelectCalificacionVoz()
        {
            BPVisitaduria oBPVisitaduria = new BPVisitaduria();
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTVisitaduria.CalificacionAutoridadId = 0;
                oENTVisitaduria.Nombre = "";

                // Transacción
                oENTResponse = oBPVisitaduria.SelectCalificacionVoz(oENTVisitaduria);

                // Errores
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }

                // Warnings
                if (oENTResponse.sMessage != "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('" + oENTResponse.sMessage + "');", true); }

                // Llenado de control (Panel Voces)
                this.ddlCalificacionVoces.DataTextField = "Nombre";
                this.ddlCalificacionVoces.DataValueField = "CalificacionVozId";
                this.ddlCalificacionVoces.DataSource = oENTResponse.dsResponse.Tables[1];
                this.ddlCalificacionVoces.DataBind();
                this.ddlCalificacionVoces.Items.Insert(0, new ListItem("[Seleccione]", "0"));

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemplo n.º 28
0
        // Funciones el programador
        void InsertExpedienteFuncionario()
        {
            ENTVisitaduria oENTVisitaduria = new ENTVisitaduria();
            ENTResponse oENTResponse = new ENTResponse();

            BPVisitaduria oBPVisitaduria = new BPVisitaduria();

            try
            {

                // Validaciones
                if (this.ddlFuncionario.SelectedItem.Value == "0") { throw (new Exception("Es necesario seleccionar un Funcionario")); }

                // Formulario
                oENTVisitaduria.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTVisitaduria.FuncionarioId = Int32.Parse(this.ddlFuncionario.SelectedItem.Value);

                // Transacción
                oENTResponse = oBPVisitaduria.InsertExpedienteFuncionario(oENTVisitaduria);

                // Errores y Warnings
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

            }catch (Exception ex){
                throw (ex);
            }
        }