Exemple #1
0
        ///<remarks>
        ///   <name>BPQueja.DeleteSolicitudCiudadano</name>
        ///   <create>19-Julio-2014</create>
        ///   <author>Ruben.Cobos</author>
        ///</remarks>
        ///<summary>Elimina la asociación de un ciudadano a la solicitud de una Queja</summary>
        ///<param name="oENTQueja">Entidad de Queja con los parámetros necesarios para realizar la transacción</param>
        ///<returns>Una entidad de respuesta</returns>
        public ENTResponse DeleteSolicitudCiudadano(ENTQueja oENTQueja)
        {
            DAQueja oDASolicitud = new DAQueja();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Transacción en base de datos
                oENTResponse = oDASolicitud.DeleteSolicitudCiudadano(oENTQueja, this.sConnectionApplication, 0);

                // Validación de error en consulta
                if (oENTResponse.GeneratesException) { return oENTResponse; }

                // Validación de mensajes de la BD
                oENTResponse.sMessage = oENTResponse.dsResponse.Tables[0].Rows[0]["sResponse"].ToString();
                if (oENTResponse.sMessage != "") { return oENTResponse; }

            }catch (Exception ex){
                oENTResponse.ExceptionRaised(ex.Message);
            }

            // Resultado
            return oENTResponse;
        }
Exemple #2
0
        ///<remarks>
        ///   <name>DASolicitud.CreateFolio</name>
        ///   <create>19-Junio-2014</create>
        ///   <author>Ruben.Cobos</author>
        ///</remarks>
        ///<summary>Crea un nuevo folio para un expediente</summary>
        ///<param name="oENTQueja">Entidad de Queja con los parámetros necesarios para realizar la transacción</param>
        ///<param name="sConnection">Cadena de conexión a la base de datos</param>
        ///<param name="iAlternateDBTimeout">Valor en milisegundos del Timeout en la consulta a la base de datos. 0 si se desea el Timeout por default</param>
        ///<returns>Una entidad de respuesta</returns>
        public ENTResponse CreateFolio(ENTQueja oENTQueja, String sConnection, Int32 iAlternateDBTimeout)
        {
            SqlConnection sqlCnn = new SqlConnection(sConnection);
            SqlCommand sqlCom;
            SqlParameter sqlPar;
            SqlDataAdapter sqlDA;

            ENTResponse oENTResponse = new ENTResponse();

            // Configuración de objetos
            sqlCom = new SqlCommand("uspFolio_Create", sqlCnn);
            sqlCom.CommandType = CommandType.StoredProcedure;

            // Timeout alternativo en caso de ser solicitado
            if (iAlternateDBTimeout > 0) { sqlCom.CommandTimeout = iAlternateDBTimeout; }

            // Parametros
            sqlPar = new SqlParameter("TipoFolio", SqlDbType.TinyInt);
            sqlPar.Value = oENTQueja.TipoFolio;
            sqlCom.Parameters.Add(sqlPar);

            // Inicializaciones
            oENTResponse.dsResponse = new DataSet();
            sqlDA = new SqlDataAdapter(sqlCom);

            // Transacción
            try{
                sqlCnn.Open();
                sqlDA.Fill(oENTResponse.dsResponse);
                sqlCnn.Close();
            }catch (SqlException sqlEx){
                oENTResponse.ExceptionRaised(sqlEx.Message);
            }catch (Exception ex){
                oENTResponse.ExceptionRaised(ex.Message);
            }finally{
                if (sqlCnn.State == ConnectionState.Open) { sqlCnn.Close(); }
                sqlCnn.Dispose();
            }

            // Resultado
            return oENTResponse;
        }
        void SelectSolicitud()
        {
            BPQueja oBPQueja = new BPQueja();
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);

                // Transacción
                oENTResponse = oBPQueja.SelectSolicitud_Cierre(oENTQueja);

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

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

                // Formulario
                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.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.FechaRecepcionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaRecepcion"].ToString();
                this.FechaAsignacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaAsignacion"].ToString();
                this.FechaGestionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaInicioGestion"].ToString();
                this.FechaModificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaUltimaModificacion"].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();

                // Llenado de Visitadurias en base al catálogo de Áreas y la calificación de la Solicitud
                switch (oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionId"].ToString()){
                    case "2": // Queja
                    case "4": // SI
                    case "8": // Medidas Cautelares

                        this.ddlVisitaduria.Items.Insert(0, new ListItem("Tercera Visitaduría", "6"));
                        this.ddlVisitaduria.Items.Insert(0, new ListItem("Segunda Visitaduría", "5"));
                        this.ddlVisitaduria.Items.Insert(0, new ListItem("Primera Visitaduría", "4"));
                        this.ddlVisitaduria.Items.Insert(0, new ListItem("[Seleccione]", "0"));
                        break;

                    case "7": // Solicitud de gestión

                        this.ddlVisitaduria.Items.Insert(0, new ListItem("Primera Visitaduría", "4"));
                        this.ddlVisitaduria.Items.Insert(0, new ListItem("Dirección de Orientación y Recepción de Quejas", "3"));
                        this.ddlVisitaduria.Items.Insert(0, new ListItem("Coordinación Penitenciaria", "10"));
                        this.ddlVisitaduria.Items.Insert(0, new ListItem("[Seleccione]", "0"));
                        break;

                    case "5": // Otra CEDH
                    case "6": // Comisión Nacional de los Derechos Humanos

                        this.ddlVisitaduria.Items.Insert(0, new ListItem("Primera Visitaduría", "4"));
                        this.ddlVisitaduria.Items.Insert(0, new ListItem("[Seleccione]", "0"));
                        break;

                    case "3": // Orientación
                    case "9": // Apoyo o colaboración

                        this.ddlVisitaduria.Items.Insert(0, new ListItem("", "0"));
                        this.ddlVisitaduria.Enabled = false;
                        break;

                    default: // No configurada

                        this.ddlVisitaduria.Enabled = false;
                        this.btnCrearFolio.Enabled = false;
                        this.btnCrearFolio.CssClass = "Button_General_Disabled";
                        break;
                }

            }catch (Exception ex){
                throw (ex);
            }
        }
        void SelectSolicitud()
        {
            BPQueja oBPQueja = new BPQueja();
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);

                // Transacción
                oENTResponse = oBPQueja.SelectSolicitud_Detalle(oENTQueja);

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

                // Formulario
                this.SolicitudNumero.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["SolicitudNumero"].ToString();
                this.AfectadoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Afectado"].ToString();

                this.CalificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionNombre"].ToString();
                this.EstatusaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["EstatusNombre"].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.FechaRecepcionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaRecepcion"].ToString();
                this.FechaAsignacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaAsignacion"].ToString();
                this.FechaGestionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaInicioGestion"].ToString();
                this.FechaModificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaUltimaModificacion"].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();

                // Datos de calificación
                this.ddlProblematica.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["ProblematicaId"].ToString();
                SelectProblematicaDetalle();

                this.ddlProblematicaDetalle.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["ProblematicaDetalleId"].ToString();
                this.ddlMecanismoApertura.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["MecanismoAperturaId"].ToString();
                this.ddlNivelAutoridad.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["NivelAutoridadId"].ToString();
                this.ddlCalificacion.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionId"].ToString();

                this.chkMedioComunicacion.Checked = ( oENTResponse.dsResponse.Tables[1].Rows[0]["MediosDeComunicacion"].ToString() == "1" ? true : false);
                this.chkMedioComunicacion.Enabled = (oENTResponse.dsResponse.Tables[1].Rows[0]["MecanismoAperturaId"].ToString() == "2" ? true : false);

                if (oENTResponse.dsResponse.Tables[1].Rows[0]["TipoOrientacionId"].ToString() != "0") {

                    this.ddlTipoOrientacion.Enabled = true;
                    this.ddlTipoOrientacion.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoOrientacionId"].ToString();
                }

                if (oENTResponse.dsResponse.Tables[7].Rows.Count  > 0) {

                    this.ddlCanalizacion.Enabled = true;

                    this.btnAgregarCanalizacion.Enabled = true;
                    this.btnAgregarCanalizacion.CssClass = "Button_General";

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

                this.ckeFundamento.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Fundamento"].ToString();

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

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

            }catch (Exception ex){
                throw (ex);
            }
        }
        // Funciones el programador
        void InsertSolicitudFuncionario()
        {
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            BPQueja oBPQueja = new BPQueja();

            try
            {

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

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);
                oENTQueja.FuncionarioId = Int32.Parse(this.ddlFuncionario.SelectedItem.Value);

                // Transacción
                oENTResponse = oBPQueja.InsertSolicitudFuncionario(oENTQueja);

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

            }catch (Exception ex){
                throw (ex);
            }
        }
        // Rutinas el programador
        void RechazarCalificacion()
        {
            BPQueja oBPQueja = new BPQueja();
            ENTResponse oENTResponse = new ENTResponse();
            ENTQueja oENTQueja = new ENTQueja();

            try
            {

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);
                oENTQueja.EstatusId = 3; // En proceso de Queja

                //Transacción
                oENTResponse = oBPQueja.UpdateSolicitudEstatus(oENTQueja);

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

            }catch (Exception ex){
                throw (ex);
            }
        }
        void InsertSolicitudCiudadano()
        {
            BPQueja oBPQueja = new BPQueja();

            ENTQueja oENTQueja = new ENTQueja();
            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
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);
                oENTQueja.UsuarioId = SessionEntity.idUsuario;
                oENTQueja.CiudadanoId = Int32.Parse(CiudadanoId);
                oENTQueja.TipoParticipacionId = Int32.Parse(this.ddlTipoParticipacion.SelectedItem.Value);
                oENTQueja.Check = 1; // Validar el Nombre del control con el Id debido al Bug del Autosuggest
                oENTQueja.CheckNombre = CiudadanoNombre;
                oENTQueja.Presente = Int16.Parse((this.rblPresente.Items[0].Selected ? 1 : 0).ToString());

                // Transacción
                oENTResponse = oBPQueja.InsertSolicitudCiudadano(oENTQueja);

                // Errores y Warnings
                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); }

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemple #8
0
        ///<remarks>
        ///   <name>DAQueja.RptEstadisticaPresidencia</name>
        ///   <create>17-Julio-2014</create>
        ///   <author>JJGonzalez</author>
        ///</remarks>
        ///<summary>Reporte de Estadistica de Presidencia</summary>
        ///<param name="oENTQueja">Entidad del Expediente de Solicitud de Quejas con los filtros necesarios para la consulta</param>
        ///<param name="sConnection">Cadena de conexión a la base de datos</param>
        ///<param name="iAlternateDBTimeout">Valor en milisegundos del Timeout en la consulta a la base de datos. 0 si se desea el Timeout por default</param>
        ///<returns>Una entidad de respuesta</returns>
        public ENTResponse RptEstadisticaPresidencia(ENTQueja oENTQueja, String sConnection, Int32 iAlternateDBTimeout)
        {
            SqlConnection sqlCnn = new SqlConnection(sConnection);
            SqlCommand sqlCom;
            SqlParameter sqlPar;
            SqlDataAdapter sqlDA;

            ENTResponse oENTResponse = new ENTResponse();

            // Configuración de objetos
            sqlCom = new SqlCommand("uspReporte_ActividadesDeQuejas", sqlCnn);
            sqlCom.CommandType = CommandType.StoredProcedure;

            // Timeout alternativo en caso de ser solicitado
            if (iAlternateDBTimeout > 0) { sqlCom.CommandTimeout = iAlternateDBTimeout; }

            // Parametros
            sqlPar = new SqlParameter("BeginDate", SqlDbType.DateTime);
            sqlPar.Value = oENTQueja.FechaDesde;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("EndDate", SqlDbType.DateTime);
            sqlPar.Value = oENTQueja.FechaHasta;
            sqlCom.Parameters.Add(sqlPar);

            // Inicializaciones
            oENTResponse.dsResponse = new DataSet();
            sqlDA = new SqlDataAdapter(sqlCom);

            // Transacción
            try
            {

                sqlCnn.Open();
                sqlDA.Fill(oENTResponse.dsResponse);
                sqlCnn.Close();

            }
            catch (SqlException sqlEx)
            {

                oENTResponse.ExceptionRaised(sqlEx.Message);

            }
            catch (Exception ex)
            {

                oENTResponse.ExceptionRaised(ex.Message);

            }
            finally
            {

                if (sqlCnn.State == ConnectionState.Open) { sqlCnn.Close(); }
                sqlCnn.Dispose();

            }

            // Resultado
            return oENTResponse;
        }
        // Rutinas el programador
        void InsertSolicitudIndicador()
        {
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            BPQueja oBPQueja = new BPQueja();
            DataRow rowIndicador;

            try
            {

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);

                // Indicadores seleccionados
                oENTQueja.tblIndicador = new DataTable("tblIndicador");
                oENTQueja.tblIndicador.Columns.Add("IndicadorId", typeof(Int32));

                // Listado de Indicadores
                for (int k = 0; k < this.chkIndicadorGenero.Items.Count; k++) {

                    if(this.chkIndicadorGenero.Items[k].Selected){

                        rowIndicador = oENTQueja.tblIndicador.NewRow();
                        rowIndicador["IndicadorId"] = this.chkIndicadorGenero.Items[k].Value;
                        oENTQueja.tblIndicador.Rows.Add(rowIndicador);
                    }
                }

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

                    if(this.chkIndicadorEdad.Items[k].Selected){

                        rowIndicador = oENTQueja.tblIndicador.NewRow();
                        rowIndicador["IndicadorId"] = this.chkIndicadorEdad.Items[k].Value;
                        oENTQueja.tblIndicador.Rows.Add(rowIndicador);
                    }
                }

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

                    if(this.chkIndicadorActividad.Items[k].Selected){

                        rowIndicador = oENTQueja.tblIndicador.NewRow();
                        rowIndicador["IndicadorId"] = this.chkIndicadorActividad.Items[k].Value;
                        oENTQueja.tblIndicador.Rows.Add(rowIndicador);
                    }
                }

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

                    if(this.chkIndicadorCondicion.Items[k].Selected){

                        rowIndicador = oENTQueja.tblIndicador.NewRow();
                        rowIndicador["IndicadorId"] = this.chkIndicadorCondicion.Items[k].Value;
                        oENTQueja.tblIndicador.Rows.Add(rowIndicador);
                    }
                }

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

                    if(this.chkIndicadorComunidades.Items[k].Selected){

                        rowIndicador = oENTQueja.tblIndicador.NewRow();
                        rowIndicador["IndicadorId"] = this.chkIndicadorComunidades.Items[k].Value;
                        oENTQueja.tblIndicador.Rows.Add(rowIndicador);
                    }
                }

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

                    if(this.chkIndicadorVictimas.Items[k].Selected){

                        rowIndicador = oENTQueja.tblIndicador.NewRow();
                        rowIndicador["IndicadorId"] = this.chkIndicadorVictimas.Items[k].Value;
                        oENTQueja.tblIndicador.Rows.Add(rowIndicador);
                    }
                }

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

                    if(this.chkIndicadorTemas.Items[k].Selected){

                        rowIndicador = oENTQueja.tblIndicador.NewRow();
                        rowIndicador["IndicadorId"] = this.chkIndicadorTemas.Items[k].Value;
                        oENTQueja.tblIndicador.Rows.Add(rowIndicador);
                    }
                }

                // Transacción
                oENTResponse = oBPQueja.InsertSolicitudIndicador(oENTQueja);

                // 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 SelectSolicitud()
        {
            BPQueja oBPQueja = new BPQueja();
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);

                // Transacción
                oENTResponse = oBPQueja.SelectSolicitud_Detalle(oENTQueja);

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

                // Formulario
                this.SolicitudNumero.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["SolicitudNumero"].ToString();
                this.AfectadoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Afectado"].ToString();

                this.CalificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionNombre"].ToString();
                this.EstatusaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["EstatusNombre"].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.FechaGestionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaInicioGestion"].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.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();

                // Seleccionar indicadores
                for (int k = 0; k < this.chkIndicadorGenero.Items.Count; k++) {
                    this.chkIndicadorGenero.Items[k].Selected = (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorGenero.Items[k].Value).Length == 0 ? false : true);
                }

                for (int k = 0; k < this.chkIndicadorEdad.Items.Count; k++) {
                    this.chkIndicadorEdad.Items[k].Selected = (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorEdad.Items[k].Value).Length == 0 ? false : true);
                }

                for (int k = 0; k < this.chkIndicadorActividad.Items.Count; k++) {
                    this.chkIndicadorActividad.Items[k].Selected = (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorActividad.Items[k].Value).Length == 0 ? false : true);
                }

                for (int k = 0; k < this.chkIndicadorCondicion.Items.Count; k++) {
                    this.chkIndicadorCondicion.Items[k].Selected = (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorCondicion.Items[k].Value).Length == 0 ? false : true);
                }

                for (int k = 0; k < this.chkIndicadorComunidades.Items.Count; k++) {
                    this.chkIndicadorComunidades.Items[k].Selected = (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorComunidades.Items[k].Value).Length == 0 ? false : true);
                }

                for (int k = 0; k < this.chkIndicadorVictimas.Items.Count; k++) {
                    this.chkIndicadorVictimas.Items[k].Selected = (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorVictimas.Items[k].Value).Length == 0 ? false : true);
                }

                for (int k = 0; k < this.chkIndicadorTemas.Items.Count; k++) {
                    this.chkIndicadorTemas.Items[k].Selected = (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorTemas.Items[k].Value).Length == 0 ? false : true);
                }

            }catch (Exception ex){
                throw (ex);
            }
        }
        // Rutinas del programador
        void EnviarSolicitud()
        {
            BPQueja oBPQueja = new BPQueja();
            ENTResponse oENTResponse = new ENTResponse();
            ENTQueja oENTQueja = new ENTQueja();

            try
            {

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);
                oENTQueja.EstatusId = 4; // Pendiente de aprobar Queja

                //Transacción
                oENTResponse = oBPQueja.UpdateSolicitudEstatus(oENTQueja);

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

            }catch (Exception ex){
                throw (ex);
            }
        }
        void UpdateSolicitud()
        {
            BPQueja oBPQueja = new BPQueja();
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Validaciones
                if (this.ddlFormaContacto.SelectedItem.Value == "0") { throw (new Exception("Es necesario seleccionar una forma de contacto")); }
                if (this.ddlLugarHechos.SelectedItem.Value == "0") { throw (new Exception("Es necesario seleccionar un lugar de los hechos")); }
                if (this.ckeDireccionHechos.Text.Trim() == "") { throw (new Exception("Es necesario ingresar una dirección de los hechos")); }
                if (this.ckeObservaciones.Text.Trim() == "") { throw (new Exception("Es necesario ingresar observaciones")); }

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);
                oENTQueja.FormaContactoId = Int32.Parse(this.ddlFormaContacto.SelectedItem.Value);
                oENTQueja.LugarHechosId = Int32.Parse(this.ddlLugarHechos.SelectedItem.Value);
                oENTQueja.DireccionHechos = this.ckeDireccionHechos.Text.Trim();
                oENTQueja.Observaciones = this.ckeObservaciones.Text.Trim();

                // Transacción
                oENTResponse = oBPQueja.UpdateSolicitud(oENTQueja);

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

                // Transacción exitosa
                Response.Redirect("QueDetalleSolicitud.aspx?key=" + this.hddSolicitudId.Value + "|" + this.SenderId.Value, false);

            }catch (Exception ex){
                throw (ex);
            }
        }
        void SelectSolicitud()
        {
            BPQueja oBPQueja = new BPQueja();
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);

                // Transacción
                oENTResponse = oBPQueja.SelectSolicitud_Detalle(oENTQueja);

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

                // Formulario
                this.SolicitudNumero.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["SolicitudNumero"].ToString();
                this.AfectadoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Afectado"].ToString();

                this.CalificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionNombre"].ToString();
                this.EstatusaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["EstatusNombre"].ToString();
                this.FuncionarioLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FuncionarioNombre"].ToString();
                this.TipoSolicitudLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoSolicitudNombre"].ToString();

                this.FechaRecepcionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaRecepcion"].ToString();
                this.FechaAsignacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaAsignacion"].ToString();
                this.FechaGestionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaInicioGestion"].ToString();
                this.FechaModificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaUltimaModificacion"].ToString();

                this.ddlFormaContacto.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["FormaContactoId"].ToString();
                this.ddlLugarHechos.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["LugarHechosId"].ToString();
                this.ckeDireccionHechos.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["DireccionHechos"].ToString();
                this.ckeObservaciones.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Observaciones"].ToString();

            }catch (Exception ex){
                throw (ex);
            }
        }
        void UpdateSolicitudBanderaDiligencia(Int16 Diligencias)
        {
            BPQueja oBPQueja = new BPQueja();
            ENTResponse oENTResponse = new ENTResponse();
            ENTQueja oENTQueja = new ENTQueja();

            try
            {

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);
                oENTQueja.Diligencias = Diligencias;

                //Transacción
                oENTResponse = oBPQueja.UpdateSolicitudCapturaDiligencia(oENTQueja);

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

            }catch (Exception ex){
                throw (ex);
            }
        }
        void SelectSolicitud()
        {
            BPQueja oBPQueja = new BPQueja();
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);

                // Transacción
                oENTResponse = oBPQueja.SelectSolicitud_Detalle(oENTQueja);

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

                // Formulario
                this.SolicitudNumero.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["SolicitudNumero"].ToString();
                this.AfectadoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Afectado"].ToString();

                this.CalificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionNombre"].ToString();
                this.EstatusaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["EstatusNombre"].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.FechaGestionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaInicioGestion"].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.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();

                // Estatus de capturas de diligencias
                if (oENTResponse.dsResponse.Tables[1].Rows[0]["Diligencias"].ToString() == "1"){

                    // Habilitar controles
                    this.chkDiligencias.Checked = true;
                    this.btnNuevo.Enabled = true;
                    this.btnNuevo.CssClass = "Button_General";
                }else{

                    // Inhabilitar controles
                    this.chkDiligencias.Checked = false;
                    this.btnNuevo.Enabled = false;
                    this.btnNuevo.CssClass = "Button_General_Disabled";
                }

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemple #16
0
        ///<remarks>
        ///   <name>DASolicitud.InsertSolicitudCiudadano</name>
        ///   <create>19-Junio-2014</create>
        ///   <author>Ruben.Cobos</author>
        ///</remarks>
        ///<summary>Asocia un nuevo ciudadano a la solicitud de una Queja</summary>
        ///<param name="oENTQueja">Entidad de Queja con los parámetros necesarios para realizar la transacción</param>
        ///<param name="sConnection">Cadena de conexión a la base de datos</param>
        ///<param name="iAlternateDBTimeout">Valor en milisegundos del Timeout en la consulta a la base de datos. 0 si se desea el Timeout por default</param>
        ///<returns>Una entidad de respuesta</returns>
        public ENTResponse InsertSolicitudCiudadano(ENTQueja oENTQueja, String sConnection, Int32 iAlternateDBTimeout)
        {
            SqlConnection sqlCnn = new SqlConnection(sConnection);
            SqlCommand sqlCom;
            SqlParameter sqlPar;
            SqlDataAdapter sqlDA;

            ENTResponse oENTResponse = new ENTResponse();

            // Configuración de objetos
            sqlCom = new SqlCommand("uspSolicitudCiudadano_Ins", sqlCnn);
            sqlCom.CommandType = CommandType.StoredProcedure;

            // Timeout alternativo en caso de ser solicitado
            if (iAlternateDBTimeout > 0) { sqlCom.CommandTimeout = iAlternateDBTimeout; }

            // Parametros
            sqlPar = new SqlParameter("SolicitudId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.SolicitudId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("UsuarioId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.UsuarioId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("CiudadanoId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.CiudadanoId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("TipoParticipacionId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.TipoParticipacionId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("Check", SqlDbType.TinyInt);
            sqlPar.Value = oENTQueja.Check;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("CheckNombre", SqlDbType.VarChar);
            sqlPar.Value = oENTQueja.CheckNombre;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("Presente", SqlDbType.TinyInt);
            sqlPar.Value = oENTQueja.Presente;
            sqlCom.Parameters.Add(sqlPar);

            // Inicializaciones
            oENTResponse.dsResponse = new DataSet();
            sqlDA = new SqlDataAdapter(sqlCom);

            // Transacción
            try{
                sqlCnn.Open();
                sqlDA.Fill(oENTResponse.dsResponse);
                sqlCnn.Close();
            }catch (SqlException sqlEx){
                oENTResponse.ExceptionRaised(sqlEx.Message);
            }catch (Exception ex){
                oENTResponse.ExceptionRaised(ex.Message);
            }finally{
                if (sqlCnn.State == ConnectionState.Open) { sqlCnn.Close(); }
                sqlCnn.Dispose();
            }

            // Resultado
            return oENTResponse;
        }
        void DeleteSolicitudComentario(Int32 ComentarioId)
        {
            BPQueja oBPQueja = new BPQueja();

            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);
                oENTQueja.ComentarioId = ComentarioId;

                // Transacción
                oENTResponse = oBPQueja.DeleteSolicitudComentario(oENTQueja);

                // 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 InsertSolicitudComentario()
        {
            BPQueja oBPQueja = new BPQueja();

            ENTQueja oENTQueja = new ENTQueja();
            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
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);
                oENTQueja.UsuarioId = SessionEntity.idUsuario;
                oENTQueja.Comentario = this.ckeComentario.Text.Trim();
                oENTQueja.MedidaPreventiva = Int16.Parse((this.chkMedidaPreventiva.Checked ? 1 : 0).ToString());

                // Transacción
                oENTResponse = oBPQueja.InsertSolicitudComentario(oENTQueja);

                // 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 DeleteSolicitudCiudadano(Int32 CiudadanoId)
        {
            BPQueja oBPQueja = new BPQueja();

            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();
            ENTSession SessionEntity = new ENTSession();

            try
            {

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

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);
                oENTQueja.FuncionarioId = SessionEntity.FuncionarioId;
                oENTQueja.CiudadanoId = CiudadanoId;

                // Transacción
                oENTResponse = oBPQueja.DeleteSolicitudCiudadano(oENTQueja);

                // Errores y Warnings
                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); }

            }catch (Exception ex){
                throw (ex);
            }
        }
        void SelectSolicitud()
        {
            BPQueja oBPQueja = new BPQueja();
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);

                // Transacción
                oENTResponse = oBPQueja.SelectSolicitud_Detalle(oENTQueja);

                // 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.hddCalificacionId.Value = oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionId"].ToString();

                // Formulario
                this.SolicitudNumero.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["SolicitudNumero"].ToString();
                this.EstatusaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["EstatusNombre"].ToString();
                this.AfectadoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Afectado"].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.FechaGestionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaInicioGestion"].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[7].Rows.Count > 0){

                    this.CanalizacionesLabel.Visible = true;

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

                // Calificacion
                this.CalificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionNombre"].ToString();
                this.FundamentoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Fundamento"].ToString();

                // Grid
                this.gvCiudadano.DataSource = oENTResponse.dsResponse.Tables[2];
                this.gvCiudadano.DataBind();

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

                    this.SinDocumentoLabel.Text = "<br /><br />No hay documentos anexados a la solicitud";
                }else{

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

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

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

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

                    CheckDeleteLinkComentario();

                }

            }catch (Exception ex){
                throw (ex);
            }
        }
        // Rutinas del programador
        void SelectSolicitud()
        {
            BPQueja oBPQueja = new BPQueja();
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

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

            try
            {

                // Formulario
                oENTQueja.UsuarioId = oSession.idUsuario;
                oENTQueja.Nivel = 2;

                // Transacción
                oENTResponse = oBPQueja.SelectSolicitud(oENTQueja);

                // 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.gvSolicitud.DataSource = oENTResponse.dsResponse.Tables[1];
                this.gvSolicitud.DataBind();

            }catch (Exception ex){
                throw (ex);
            }
        }
        void SelectSolicitud( Boolean Recovery)
        {
            BPQueja oBPQueja = new BPQueja();
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

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

            try
            {

                // Formulario
                oENTQueja.Numero = this.txtNumeroSolicitud.Text.Trim();
                oENTQueja.Nombre = this.txtCiudadano.Text.Trim();
                oENTQueja.FormaContactoId = Int32.Parse(this.ddlFormaContacto.SelectedValue);
                oENTQueja.FuncionarioId = Int32.Parse(this.ddlFuncionario.SelectedValue);
                oENTQueja.FechaDesde = (Recovery ? dtBeginDate : this.wucBeginDate.BeginDate);
                oENTQueja.FechaHasta = (Recovery ? dtEndDate : this.wucEndDate.EndDate);

                // Transacción
                oENTResponse = oBPQueja.SelectSolicitud_Filtro(oENTQueja);

                // 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.gvSolicitud.DataSource = oENTResponse.dsResponse.Tables[1];
                this.gvSolicitud.DataBind();

            }catch (Exception ex){
                throw (ex);
            }
        }
        void SelectSolicitud_Cierre()
        {
            BPQueja oBPQueja = new BPQueja();
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);

                // Transacción
                oENTResponse = oBPQueja.SelectSolicitud_Cierre(oENTQueja);

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

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

                // Formulario
                this.SolicitudNumero.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["SolicitudNumero"].ToString();
                this.EstatusaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["EstatusNombre"].ToString();
                this.AfectadoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Afectado"].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.FechaGestionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaInicioGestion"].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[7].Rows.Count > 0){

                    this.CanalizacionesLabel.Visible = true;

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

                // Calificacion
                this.CalificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionNombre"].ToString();
                this.FundamentoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Fundamento"].ToString();

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

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

                    this.SinDocumentoLabel.Text = "<br /><br />No hay documentos anexados a la solicitud";
                }else{

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

                // Comentarios
                if (oENTResponse.dsResponse.Tables[3].Rows.Count == 0){

                    this.SinComentariosLabel.Text = "<br /><br />No hay comentarios para esta solicitud";
                }else{

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

                // Autoridad y voces señaladas
                this.gvAutoridades.DataSource = oENTResponse.dsResponse.Tables[4];
                this.gvAutoridades.DataBind();

                // Diligencias
                this.gvDiligencia.DataSource = oENTResponse.dsResponse.Tables[5];
                this.gvDiligencia.DataBind();

                // Seleccionar indicadores
                for (int k = 0; k < this.chkIndicadorGenero.Items.Count; k++) {

                    if (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorGenero.Items[k].Value).Length == 1) {
                        this.chkIndicadorGenero.Items[k].Selected = true;
                        this.chkIndicadorGenero.Items[k].Attributes.Add("Style", "color:red;");
                    }
                    this.chkIndicadorGenero.Items[k].Enabled = false;
                }

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

                    if (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorEdad.Items[k].Value).Length == 1) {
                        this.chkIndicadorEdad.Items[k].Selected = true;
                        this.chkIndicadorEdad.Items[k].Attributes.Add("Style", "color:red;");
                    }
                    this.chkIndicadorEdad.Items[k].Enabled = false;
                }

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

                    if (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorActividad.Items[k].Value).Length == 1) {
                        this.chkIndicadorActividad.Items[k].Selected = true;
                        this.chkIndicadorActividad.Items[k].Attributes.Add("Style", "color:red;");
                    }
                    this.chkIndicadorActividad.Items[k].Enabled = false;
                }

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

                    if (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorCondicion.Items[k].Value).Length == 1) {
                        this.chkIndicadorCondicion.Items[k].Selected = true;
                        this.chkIndicadorCondicion.Items[k].Attributes.Add("Style", "color:red;");
                    }
                    this.chkIndicadorCondicion.Items[k].Enabled = false;
                }

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

                    if (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorComunidades.Items[k].Value).Length == 1) {
                        this.chkIndicadorComunidades.Items[k].Selected = true;
                        this.chkIndicadorComunidades.Items[k].Attributes.Add("Style", "color:red;");
                    }
                    this.chkIndicadorComunidades.Items[k].Enabled = false;
                }

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

                    if (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorVictimas.Items[k].Value).Length == 1) {
                        this.chkIndicadorVictimas.Items[k].Selected = true;
                        this.chkIndicadorVictimas.Items[k].Attributes.Add("Style", "color:red;");
                    }
                    this.chkIndicadorVictimas.Items[k].Enabled = false;
                }

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

                    if (oENTResponse.dsResponse.Tables[6].Select("IndicadorId=" + this.chkIndicadorTemas.Items[k].Value).Length == 1) {
                        this.chkIndicadorTemas.Items[k].Selected = true;
                        this.chkIndicadorTemas.Items[k].Attributes.Add("Style", "color:red;");
                    }
                    this.chkIndicadorTemas.Items[k].Enabled = false;
                }

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemple #24
0
        ///<remarks>
        ///   <name>DAQueja.SelectSolicitud_Filtro</name>
        ///   <create>17-Julio-2014</create>
        ///   <author>Ruben.Cobos</author>
        ///</remarks>
        ///<summary>Obtiene un listado de Solicitudes de Quejas en base a los parámetros proporcionados</summary>
        ///<param name="oENTQueja">Entidad del Expediente de Solicitud de Quejas con los filtros necesarios para la consulta</param>
        ///<param name="sConnection">Cadena de conexión a la base de datos</param>
        ///<param name="iAlternateDBTimeout">Valor en milisegundos del Timeout en la consulta a la base de datos. 0 si se desea el Timeout por default</param>
        ///<returns>Una entidad de respuesta</returns>
        public ENTResponse SelectSolicitud_Filtro(ENTQueja oENTQueja, String sConnection, Int32 iAlternateDBTimeout)
        {
            SqlConnection sqlCnn = new SqlConnection(sConnection);
            SqlCommand sqlCom;
            SqlParameter sqlPar;
            SqlDataAdapter sqlDA;

            ENTResponse oENTResponse = new ENTResponse();

            // Configuración de objetos
            sqlCom = new SqlCommand("uspSolicitud_Sel_Filtro", sqlCnn);
            sqlCom.CommandType = CommandType.StoredProcedure;

            // Timeout alternativo en caso de ser solicitado
            if (iAlternateDBTimeout > 0) { sqlCom.CommandTimeout = iAlternateDBTimeout; }

            // Parametros
            sqlPar = new SqlParameter("Nombre", SqlDbType.VarChar);
            sqlPar.Value = oENTQueja.Nombre;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("Numero", SqlDbType.VarChar);
            sqlPar.Value = oENTQueja.Numero;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("FormaContactoId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.FormaContactoId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("FuncionarioId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.FuncionarioId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("FechaDesde", SqlDbType.DateTime);
            sqlPar.Value = oENTQueja.FechaDesde;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("FechaHasta", SqlDbType.DateTime);
            sqlPar.Value = oENTQueja.FechaHasta;
            sqlCom.Parameters.Add(sqlPar);

            // Inicializaciones
            oENTResponse.dsResponse = new DataSet();
            sqlDA = new SqlDataAdapter(sqlCom);

            // Transacción
            try
            {

                sqlCnn.Open();
                sqlDA.Fill(oENTResponse.dsResponse);
                sqlCnn.Close();

            }catch (SqlException sqlEx){

                oENTResponse.ExceptionRaised(sqlEx.Message);

            }catch (Exception ex){

                oENTResponse.ExceptionRaised(ex.Message);

            }finally{

                if (sqlCnn.State == ConnectionState.Open) { sqlCnn.Close(); }
                sqlCnn.Dispose();

            }

            // Resultado
            return oENTResponse;
        }
        void SelectProblematicaDetalle()
        {
            BPQueja oBPQueja = new BPQueja();
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTQueja.ProblematicaDetalleId = 0;
                oENTQueja.ProblematicaId = Int32.Parse(this.ddlProblematica.SelectedItem.Value);
                oENTQueja.Nombre = "";

                // Transacción
                oENTResponse = oBPQueja.SelectProblematicaDetalle(oENTQueja);

                // 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.ddlProblematicaDetalle.DataTextField = "Nombre";
                this.ddlProblematicaDetalle.DataValueField = "ProblematicaDetalleId";
                this.ddlProblematicaDetalle.DataSource = oENTResponse.dsResponse.Tables[1];
                this.ddlProblematicaDetalle.DataBind();

                // Opción todos
                this.ddlProblematicaDetalle.Items.Insert(0, new ListItem("[Seleccione]", "0"));

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemple #26
0
        ///<remarks>
        ///   <name>DAQueja.UpdateSolicitud</name>
        ///   <create>17-Julio-2014</create>
        ///   <author>Ruben.Cobos</author>
        ///</remarks>
        ///<summary>Actualiza la información general de una solicitud de Quejas</summary>
        ///<param name="oENTQueja">Entidad del Expediente de Solicitud de Quejas con los filtros necesarios para la actualización</param>
        ///<param name="sConnection">Cadena de conexión a la base de datos</param>
        ///<param name="iAlternateDBTimeout">Valor en milisegundos del Timeout en la consulta a la base de datos. 0 si se desea el Timeout por default</param>
        ///<returns>Una entidad de respuesta</returns>
        public ENTResponse UpdateSolicitud(ENTQueja oENTQueja, String sConnection, Int32 iAlternateDBTimeout)
        {
            SqlConnection sqlCnn = new SqlConnection(sConnection);
            SqlCommand sqlCom;
            SqlParameter sqlPar;
            SqlDataAdapter sqlDA;

            ENTResponse oENTResponse = new ENTResponse();

            // Configuración de objetos
            sqlCom = new SqlCommand("uspSolicitud_Upd_General", sqlCnn);
            sqlCom.CommandType = CommandType.StoredProcedure;

            // Timeout alternativo en caso de ser solicitado
            if (iAlternateDBTimeout > 0) { sqlCom.CommandTimeout = iAlternateDBTimeout; }

            // Parametros
            sqlPar = new SqlParameter("SolicitudId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.SolicitudId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("FormaContactoId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.FormaContactoId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("LugarHechosId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.LugarHechosId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("DireccionHechos", SqlDbType.VarChar);
            sqlPar.Value = oENTQueja.DireccionHechos;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("Observaciones", SqlDbType.VarChar);
            sqlPar.Value = oENTQueja.Observaciones;
            sqlCom.Parameters.Add(sqlPar);

            // Inicializaciones
            oENTResponse.dsResponse = new DataSet();
            sqlDA = new SqlDataAdapter(sqlCom);

            // Transacción
            try
            {

                sqlCnn.Open();
                sqlDA.Fill(oENTResponse.dsResponse);
                sqlCnn.Close();

            }catch (SqlException sqlEx){

                oENTResponse.ExceptionRaised(sqlEx.Message);

            }catch (Exception ex){

                oENTResponse.ExceptionRaised(ex.Message);

            }finally{

                if (sqlCnn.State == ConnectionState.Open) { sqlCnn.Close(); }
                sqlCnn.Dispose();

            }

            // Resultado
            return oENTResponse;
        }
        void UpdateSolicitud_Calificacion()
        {
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            BPQueja oBPQueja = new BPQueja();

            DataTable tblCanalizacion = null;
            DataRow rowCanalizacion;

            try
            {

                // Obtener el DataTable del grid
                tblCanalizacion = gcParse.GridViewToDataTable(this.grdCanalizacion, false);

                // Validaciones
                if (this.ddlProblematica.SelectedIndex == 0) { throw (new Exception("Es necesario seleccionar una Problemática")); }
                if (this.ddlProblematicaDetalle.SelectedIndex == 0) { throw (new Exception("Es necesario seleccionar un Detalle de Problemática")); }
                if (this.ddlMecanismoApertura.SelectedIndex == 0) { throw (new Exception("Es necesario seleccionar un Mecanismo de Apertura")); }
                if (this.ddlNivelAutoridad.SelectedIndex == 0) { throw (new Exception("Es necesario seleccionar un Nivel de Autoridad")); }
                if (this.ddlCalificacion.SelectedIndex == 0) { throw (new Exception("Es necesario seleccionar una Calificación")); }
                if (this.ddlTipoOrientacion.Enabled && this.ddlTipoOrientacion.SelectedItem.Value == "0") { throw (new Exception("Es necesario seleccionar un Cierre de Orientación")); }
                if (this.ddlCanalizacion.Enabled && tblCanalizacion.Rows.Count == 0) { throw (new Exception("Es necesario seleccionar una Canalización")); }
                if (this.ckeFundamento.Text.Trim() == "") { throw (new Exception("Es necesario ingresar un fundamento")); }

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);
                oENTQueja.ProblematicaId = Int32.Parse(this.ddlProblematica.SelectedItem.Value);
                oENTQueja.ProblematicaDetalleId = Int32.Parse(this.ddlProblematicaDetalle.SelectedItem.Value);
                oENTQueja.MecanismoAperturaId = Int32.Parse(this.ddlMecanismoApertura.SelectedItem.Value);
                oENTQueja.NivelAutoridadId = Int32.Parse(this.ddlNivelAutoridad.SelectedItem.Value);
                oENTQueja.CalificacionId = Int32.Parse(this.ddlCalificacion.SelectedItem.Value);
                oENTQueja.TipoOrientacionId = Int32.Parse(this.ddlTipoOrientacion.SelectedItem.Value);
                oENTQueja.Fundamento = this.ckeFundamento.Text.Trim();
                oENTQueja.MediosComunicacion = Int16.Parse( ( this.chkMedioComunicacion.Checked ? 1 : 0 ).ToString() );

                // Canalizaciones seleccionadas
                oENTQueja.tblCanalizacion = new DataTable("tblCanalizacion");
                oENTQueja.tblCanalizacion.Columns.Add("CanalizacionId", typeof(Int32));

                foreach(DataRow oDataRow in tblCanalizacion.Rows){

                    rowCanalizacion = oENTQueja.tblCanalizacion.NewRow();
                    rowCanalizacion["CanalizacionId"] = oDataRow["CanalizacionId"];
                    oENTQueja.tblCanalizacion.Rows.Add(rowCanalizacion);
                }

                // Transacción
                oENTResponse = oBPQueja.UpdateSolicitudCalificacion(oENTQueja);

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

            }catch (Exception ex){
                throw (ex);
            }
        }
Exemple #28
0
        ///<remarks>
        ///   <name>DASolicitud.UpdateSolicitudCalificacion</name>
        ///   <create>19-Junio-2014</create>
        ///   <author>Ruben.Cobos</author>
        ///</remarks>
        ///<summary>Actualiza la calificación de una solicitud de una Queja</summary>
        ///<param name="entSolicitud">Entidad de Queja con los parámetros necesarios para realizar la transacción</param>
        ///<param name="sConnection">Cadena de conexión a la base de datos</param>
        ///<param name="iAlternateDBTimeout">Valor en milisegundos del Timeout en la consulta a la base de datos. 0 si se desea el Timeout por default</param>
        ///<returns>Una entidad de respuesta</returns>
        public ENTResponse UpdateSolicitudCalificacion(ENTQueja oENTQueja, String sConnection, Int32 iAlternateDBTimeout)
        {
            SqlConnection sqlCnn = new SqlConnection(sConnection);
            SqlCommand sqlCom;
            SqlParameter sqlPar;
            SqlDataAdapter sqlDA;

            ENTResponse oENTResponse = new ENTResponse();

            // Configuración de objetos
            sqlCom = new SqlCommand("uspSolicitud_Upd_Calificacion", sqlCnn);
            sqlCom.CommandType = CommandType.StoredProcedure;

            // Timeout alternativo en caso de ser solicitado
            if (iAlternateDBTimeout > 0) { sqlCom.CommandTimeout = iAlternateDBTimeout; }

            // Parametros
            sqlPar = new SqlParameter("SolicitudId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.SolicitudId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("ProblematicaId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.ProblematicaId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("ProblematicaDetalleId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.ProblematicaDetalleId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("MecanismoAperturaId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.MecanismoAperturaId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("NivelAutoridadId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.NivelAutoridadId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("CalificacionId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.CalificacionId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("TipoOrientacionId", SqlDbType.Int);
            sqlPar.Value = oENTQueja.TipoOrientacionId;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("MediosComunicacion", SqlDbType.TinyInt);
            sqlPar.Value = oENTQueja.MediosComunicacion;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("Fundamento", SqlDbType.VarChar);
            sqlPar.Value = oENTQueja.Fundamento;
            sqlCom.Parameters.Add(sqlPar);

            sqlPar = new SqlParameter("tblCanalizacion", SqlDbType.Structured);
            sqlPar.Value = oENTQueja.tblCanalizacion;
            sqlCom.Parameters.Add(sqlPar);

            // Inicializaciones
            oENTResponse.dsResponse = new DataSet();
            sqlDA = new SqlDataAdapter(sqlCom);

            // Transacción
            try{
                sqlCnn.Open();
                sqlDA.Fill(oENTResponse.dsResponse);
                sqlCnn.Close();
            }catch (SqlException sqlEx){
                oENTResponse.ExceptionRaised(sqlEx.Message);
            }catch (Exception ex){
                oENTResponse.ExceptionRaised(ex.Message);
            }finally{
                if (sqlCnn.State == ConnectionState.Open) { sqlCnn.Close(); }
                sqlCnn.Dispose();
            }

            // Resultado
            return oENTResponse;
        }
        void SelectSolicitud()
        {
            BPQueja oBPQueja = new BPQueja();
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);

                // Transacción
                oENTResponse = oBPQueja.SelectSolicitud_Detalle(oENTQueja);

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

                // Formulario
                this.SolicitudNumero.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["SolicitudNumero"].ToString();
                this.AfectadoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Afectado"].ToString();

                this.CalificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["CalificacionNombre"].ToString();
                this.EstatusaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["EstatusNombre"].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.FechaGestionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaInicioGestion"].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.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();

                // Documentos
                this.gvDocumento.DataSource = oENTResponse.dsResponse.Tables[3];
                this.gvDocumento.DataBind();

            }catch (Exception ex){
                throw (ex);
            }
        }
        void InsertExpediente()
        {
            ENTQueja oENTQueja = new ENTQueja();
            ENTResponse oENTResponse = new ENTResponse();
            ENTSession oENTSession;

            BPQueja oBPQueja = new BPQueja();

            try
            {

                // Validaciones
                if (this.lblExpediente.Text.Trim() == "") { throw (new Exception("Es necesario generar el folio del expediente")); }

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

                // Formulario
                oENTQueja.UsuarioId = oENTSession.idUsuario;
                oENTQueja.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);
                oENTQueja.AreaId = Int32.Parse(this.ddlVisitaduria.SelectedItem.Value);
                oENTQueja.CalificacionId = Int32.Parse(this.hddCalificacionId.Value);
                oENTQueja.NumeroFolio = this.lblExpediente.Text.Trim();

                // Transacción
                oENTResponse = oBPQueja.InsertExpediente(oENTQueja);

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

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