Ejemplo n.º 1
0
        ///<remarks>
        ///   <name>BPAtencion.InsertAtencion</name>
        ///   <create>29-Septiembre-2014</create>
        ///   <author>Ruben.Cobos</author>
        ///</remarks>
        ///<summary>Inserta una nueva solicitud de Atención a Víctimas</summary>
        ///<param name="entAtencion">Entidad de Atención a Víctimas con los parámetros necesarios para realizar la transacción</param>
        ///<returns>Una entidad de respuesta</returns>
        public ENTResponse InsertAtencion(ENTAtencion oENTAtencion)
        {
            DAAtencion oDAAtencion = new DAAtencion();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Transacción en base de datos
                oENTResponse = oDAAtencion.InsertAtencion(oENTAtencion, 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;
        }
Ejemplo n.º 2
0
        ///<remarks>
        ///   <name>DAAtencion.DeleteAtencion</name>
        ///   <create>29-Septiembre-2014</create>
        ///   <author>Ruben.Cobos</author>
        ///</remarks>
        ///<summary>Elimina una solicitud de Atención a Víctimas existente</summary>
        ///<param name="oENTAtencion">Entidad de Atención a Víctimas con los parámetros necesarios para crear el comentario</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 DeleteAtencion(ENTAtencion oENTAtencion, 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("uspAtencion_Del", sqlCnn);
            sqlCom.CommandType = CommandType.StoredProcedure;

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

            // Parametros
            sqlPar = new SqlParameter("AtencionId", SqlDbType.Int);
            sqlPar.Value = oENTAtencion.AtencionId;
            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;
        }
Ejemplo n.º 3
0
        ///<remarks>
        ///   <name>BPAtencion.RptIntegralVictimas</name>
        ///   <create>14-Nviembre-2014</create>
        ///   <author>JJGonzalez</author>
        ///</remarks>
        ///<summary>Reporte de Atn Víctimas</summary>
        ///<param name="oENTQuejas">Entidad de Atenion con los parámetros necesarios para realizar la transacción</param>
        ///<returns>Una entidad de respuesta</returns>
        public ENTResponse RptIntegralVictimas(ENTAtencion oENTAtencion)
        {
            DAAtencion oDAAtencion = new DAAtencion();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Transacción en base de datos
                oENTResponse = oDAAtencion.RptIntegralVictimas(oENTAtencion, this.sConnectionApplication, 0);

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

                // Validación de mensajes de la BD
                if (oENTResponse.sMessage != "") { return oENTResponse; }

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

            // Resultado
            return oENTResponse;
        }
Ejemplo n.º 4
0
        ///<remarks>
        ///   <name>DAAtencion.InsertAtencion</name>
        ///   <create>29-Septiembre-2014</create>
        ///   <author>Ruben.Cobos</author>
        ///</remarks>
        ///<summary>Inserta una nueva solicitud de Atención a Víctimas</summary>
        ///<param name="oENTAtencion">Entidad de Atención a Víctimas con los parámetros necesarios para crear el comentario</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 InsertAtencion(ENTAtencion oENTAtencion, 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("uspAtencion_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 = oENTAtencion.SolicitudId;
            sqlCom.Parameters.Add(sqlPar);

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

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

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

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

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

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

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

            sqlPar = new SqlParameter("Detalle", SqlDbType.VarChar);
            sqlPar.Value = oENTAtencion.Detalle;
            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;
        }
Ejemplo n.º 5
0
        ///<remarks>
        ///   <name>DAAtencion.InsertClimaLaboral</name>
        ///   <create>19-Junio-2014</create>
        ///   <author>Ruben.Cobos</author>
        ///</remarks>
        ///<summary>Crea una nueva sesión de Clima Laboral en el módulo de Atención a Víctimas</summary>
        ///<param name="oENTAtencion">Entidad de Atención a Víctimas 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 InsertClimaLaboral(ENTAtencion oENTAtencion, 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("uspClimaLaboral_Ins", sqlCnn);
            sqlCom.CommandType = CommandType.StoredProcedure;

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

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

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

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

            sqlPar = new SqlParameter("tblUsuario", SqlDbType.Structured);
            sqlPar.Value = oENTAtencion.tblUsuario;
            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;
        }
Ejemplo n.º 6
0
        void UpdateAtencion()
        {
            BPAtencion oBPAtencion = new BPAtencion();

            ENTResponse oENTResponse = new ENTResponse();
            ENTAtencion oENTAtencion = new ENTAtencion();
            ENTSession oENTSession;

            String CiudadanoId = "";
            RadioButton oRadioButton;

            try
            {

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

                // Obtener la autoridad seleccionada
                foreach (GridViewRow gvRow in this.gvCiudadano.Rows) {

                    oRadioButton = (RadioButton)this.gvCiudadano.Rows[gvRow.RowIndex].FindControl("RowSelector");
                    if (oRadioButton.Checked) {
                        CiudadanoId = this.gvCiudadano.DataKeys[gvRow.RowIndex]["CiudadanoId"].ToString();
                    }
                }

                //Formulario
                oENTAtencion.AtencionId = Int32.Parse(this.hddAtencionId.Value);
                oENTAtencion.SolicitudId = Int32.Parse(this.hddSolicitudId.Value);
                oENTAtencion.ExpedienteId = Int32.Parse(this.hddExpedienteId.Value);
                oENTAtencion.LugarAtencionId = Int32.Parse(this.ddlLugarAtencion.SelectedItem.Value);
                oENTAtencion.ModuloId = 3; // Visitadurías
                oENTAtencion.TipoDictamenId = Int32.Parse(this.ddlTipoDictamen.SelectedItem.Value);
                oENTAtencion.CiudadanoId = Int32.Parse(CiudadanoId);
                oENTAtencion.IdUsuario = oENTSession.idUsuario;
                oENTAtencion.NumeroOficio = this.txtNumeroOficio.Text.Trim();
                oENTAtencion.Detalle = this.ckeDetalle.Text.Trim();

                //Transacción
                oENTResponse = oBPAtencion.UpdateAtencion(oENTAtencion);

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

                // Actualizar grid
                SelectExpediente();

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 7
0
        void SetCheckList()
        {
            BPAtencion oBPAtencion = new BPAtencion();
            ENTAtencion oENTAtencion = new ENTAtencion();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTAtencion.AtencionId = Int32.Parse(this.hddAtencionId.Value);

                // Transacción
                oENTResponse = oBPAtencion.SelectAtencion_Detalle(oENTAtencion);

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

                // Gestiones
                if (oENTResponse.dsResponse.Tables[4].Rows.Count == 0){
                    this.imgDictamen.ImageUrl = "~/Include/Image/Icon/AsignarIcon_Pending.png";
                    this.imgDictamen.ToolTip = "No se ha emitido el dictamen del expediente de atención a víctimas";
                    this.btnEnviar.Enabled = false;
                    this.btnEnviar.CssClass = "Button_General_Disabled";
                }

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 8
0
        void SelectAtencion()
        {
            BPAtencion oBPAtencion = new BPAtencion();
            ENTAtencion oENTAtencion = new ENTAtencion();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTAtencion.AtencionId = Int32.Parse(this.hddAtencionId.Value);

                // Transacción
                oENTResponse = oBPAtencion.SelectAtencion_Detalle(oENTAtencion);

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

                // Formulario
                this.AtencionNumeroFolio.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["AtencionNumeroFolio"].ToString();
                this.AfectadoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Ciudadanos"].ToString();
                this.AtencionNumeroOficio.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["AtencionNumeroOficio"].ToString();
                this.AreaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Area"].ToString();
                this.ExpedienteNumeroLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["ExpedienteNumero"].ToString();
                this.SolicitudNumeroLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["SolicitudNumero"].ToString();
                this.EstatusLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["EstatusNombre"].ToString();
                this.DoctorLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FuncionarioNombre"].ToString();

                this.FechaAtencionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaAtencion"].ToString();
                this.FechaAsignacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaAsignacion"].ToString();
                this.UltimaModificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaUltimaModificacion"].ToString();

                this.DictamenMedicoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoDictamenNombre"].ToString();
                this.LugarRevisionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["LugarAtencionNombre"].ToString();

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 9
0
        // Rutinas el programador
        void DeleteAtencion( Int32 AtencionId)
        {
            BPAtencion oBPAtencion = new BPAtencion();

            ENTResponse oENTResponse = new ENTResponse();
            ENTAtencion oENTAtencion = new ENTAtencion();

            try
            {

                // Formulario
                oENTAtencion.AtencionId = AtencionId;

                // Transacción
                oENTResponse = oBPAtencion.DeleteAtencion(oENTAtencion);

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

                // Actualizar grid
                SelectExpediente();

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 10
0
        void SelectAtencion()
        {
            BPAtencion oBPAtencion = new BPAtencion();
            ENTAtencion oENTAtencion = new ENTAtencion();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTAtencion.AtencionId = Int32.Parse(this.hddAtencionId.Value);

                // Transacción
                oENTResponse = oBPAtencion.SelectAtencion_Detalle(oENTAtencion);

                // 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();

                // Formulario
                this.AtencionNumeroFolio.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["AtencionNumeroFolio"].ToString();
                this.AfectadoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Ciudadanos"].ToString();
                this.AtencionNumeroOficio.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["AtencionNumeroOficio"].ToString();
                this.AreaLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Area"].ToString();
                this.ExpedienteNumeroLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["ExpedienteNumero"].ToString();
                this.SolicitudNumeroLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["SolicitudNumero"].ToString();
                this.EstatusLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["EstatusNombre"].ToString();
                this.DoctorLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FuncionarioNombre"].ToString();

                this.FechaAtencionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaAtencion"].ToString();
                this.FechaAsignacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaAsignacion"].ToString();
                this.UltimaModificacionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["FechaUltimaModificacion"].ToString();

                this.DictamenMedicoLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoDictamenNombre"].ToString();
                this.LugarRevisionLabel.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["LugarAtencionNombre"].ToString();

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

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

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

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

                // Dictámen
                this.gvDictamen.DataSource = oENTResponse.dsResponse.Tables[4];
                this.gvDictamen.DataBind();

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 11
0
        void RechazarAtencion()
        {
            BPAtencion oBPAtencion = new BPAtencion();
            ENTAtencion oENTAtencion = new ENTAtencion();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // TODO: Checar en el SP la actualización de la fecha/hora
                // Formulario
                oENTAtencion.AtencionId = Int32.Parse(this.hddAtencionId.Value);
                oENTAtencion.EstatusId = 18; // Por atender atención
                oENTAtencion.ModuloId = 5; // Atención a Víctimas

                // Transacción
                oENTResponse = oBPAtencion.UpdateAtencion_Estatus(oENTAtencion);

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

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 12
0
        // Funciones el programador
        void UpdateAtencion_NumeroFolio()
        {
            ENTAtencion oENTAtencion = new ENTAtencion();
            ENTResponse oENTResponse = new ENTResponse();

            BPAtencion oBPAtencion = new BPAtencion();

            try
            {

                // Validaciones
                if (this.txtNumeroFolio.Text.Trim() == "") { throw (new Exception("Es necesario ingresar un número de folio")); }

                // Formulario
                oENTAtencion.AtencionId = Int32.Parse(this.hddAtencionId.Value);
                oENTAtencion.NumeroFolio = this.txtNumeroFolio.Text.Trim();

                // Transacción
                oENTResponse = oBPAtencion.InsertAtencionDoctor(oENTAtencion);

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

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 13
0
        // Rutinas del programador
        private void SelectAtencion(Boolean Recovery)
        {
            BPAtencion oBPAtencion = new BPAtencion();
            ENTAtencion oENTAtencion = new ENTAtencion();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTAtencion.Numero = this.txtAtencionNumero.Text.Trim();
                oENTAtencion.Quejoso = this.txtQuejoso.Text.Trim();
                oENTAtencion.FuncionarioId = Int32.Parse(this.ddlDoctor.SelectedItem.Value);
                oENTAtencion.FechaDesde = (Recovery ? dtBeginDate : this.wucBeginDate.BeginDate);
                oENTAtencion.FechaHasta = (Recovery ? dtEndDate : this.wucEndDate.EndDate);

                // Transacción
                oENTResponse = oBPAtencion.SelectAtencion_Filtro(oENTAtencion);

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

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 14
0
        void SaveForm()
        {
            ENTSession oENTSession = new ENTSession();
            ENTAtencion oENTAtencion = new ENTAtencion();

            try
            {

                // Formulario
                oENTAtencion.Numero = this.txtAtencionNumero.Text.Trim();
                oENTAtencion.Quejoso = this.txtQuejoso.Text.Trim();
                oENTAtencion.FuncionarioId = Int32.Parse(this.ddlDoctor.SelectedItem.Value);
                oENTAtencion.FechaDesde = this.wucBeginDate.BeginDate;
                oENTAtencion.FechaHasta = this.wucEndDate.EndDate;

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

                // Guardar el formulario en la sesión
                oENTSession.Entity = oENTAtencion;
                this.Session["oENTSession"] = oENTSession;

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 15
0
        // Rutinas del programador
        private void SelectAtencion()
        {
            BPAtencion oBPAtencion = new BPAtencion();
            ENTAtencion oENTAtencion = new ENTAtencion();
            ENTResponse oENTResponse = new ENTResponse();

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

            try
            {

                // Formulario
                oENTAtencion.IdUsuario = oSession.idUsuario;
                oENTAtencion.Nivel = 0;

                // Transacción
                oENTResponse = oBPAtencion.SelectAtencion(oENTAtencion);

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

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 16
0
        // Rutinas del grid Anidado
        void SelectAtencion_Detalle(Int32 AtencionId)
        {
            BPAtencion oBPAtencion = new BPAtencion();

            ENTResponse oENTResponse = new ENTResponse();
            ENTAtencion oENTAtencion = new ENTAtencion();

            try
            {

                //Formulario
                oENTAtencion.AtencionId = AtencionId;

                //Transacción
                oENTResponse = oBPAtencion.SelectAtencion_Detalle_ById(oENTAtencion);

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

                // Actualizar grid
                gvAtencionDetalle.DataSource = oENTResponse.dsResponse.Tables[3];
                gvAtencionDetalle.DataBind();

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 17
0
        // Funciones el programador
        void InsertAtencionDoctor()
        {
            ENTAtencion oENTAtencion = new ENTAtencion();
            ENTResponse oENTResponse = new ENTResponse();

            BPAtencion oBPAtencion = new BPAtencion();

            try
            {

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

                // Formulario
                oENTAtencion.AtencionId = Int32.Parse(this.hddAtencionId.Value);
                oENTAtencion.FuncionarioId = Int32.Parse(this.ddlDoctor.SelectedItem.Value);

                // Transacción
                oENTResponse = oBPAtencion.InsertAtencionDoctor(oENTAtencion);

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

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 18
0
        void SelectAtencion_ForEdit(Int32 AtencionId)
        {
            BPAtencion oBPAtencion = new BPAtencion();

            ENTResponse oENTResponse = new ENTResponse();
            ENTAtencion oENTAtencion = new ENTAtencion();

            RadioButton oRadioButton;

            try
            {

                //Formulario
                oENTAtencion.AtencionId = AtencionId;

                //Transacción
                oENTResponse = oBPAtencion.SelectAtencion_Detalle_ById(oENTAtencion);

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

                // Actualizar grid
                this.txtNumeroOficio.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["NumeroOficio"].ToString();
                this.ddlTipoDictamen.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["TipoDictamenId"].ToString();
                this.ddlLugarAtencion.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["LugarAtencionId"].ToString();

                // Ciudadano de la atención
                foreach (GridViewRow gvRow in this.gvCiudadano.Rows) {

                    oRadioButton = (RadioButton)this.gvCiudadano.Rows[gvRow.RowIndex].FindControl("RowSelector");
                    oRadioButton.Checked = ( oENTResponse.dsResponse.Tables[2].Select("CiudadanoId=" + this.gvCiudadano.DataKeys[gvRow.RowIndex]["CiudadanoId"].ToString() ).Length > 0 ? true : false );
                }

                // Detalle de la atención
                this.ckeDetalle.Text = oENTResponse.dsResponse.Tables[3].Select("Dictamen=0")[0]["Detalle"].ToString();

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 19
0
        void InsertClimaLaboral()
        {
            BPAtencion BPAtencion = new BPAtencion();

            ENTResponse oENTResponse = new ENTResponse();
            ENTAtencion oENTAtencion = new ENTAtencion();
            ENTSession oENTSession;

            DataTable tblUsuario = null;
            DataRow rowUsuario;

            try
            {

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

                // Validaciones
                if (tblUsuario.Rows.Count == 0) { throw (new Exception("Es necesario seleccionar por lo menos un Usuario")); }
                if (this.ckeObservaciones.Text.Trim() == "") { throw new Exception("El campo [Observaciones] es requerido"); }

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

                // Formulario
                oENTAtencion.UsuarioIdInsert = oENTSession.idUsuario;
                oENTAtencion.Grupal = Int16.Parse( ( tblUsuario.Rows.Count == 1 ? "0" : "1" ));
                oENTAtencion.Observaciones = this.ckeObservaciones.Text.Trim();

                // Usuarioes seleccionadas
                oENTAtencion.tblUsuario = new DataTable("tblUsuario");
                oENTAtencion.tblUsuario.Columns.Add("idUsuario", typeof(Int32));

                foreach(DataRow oDataRow in tblUsuario.Rows){

                    rowUsuario = oENTAtencion.tblUsuario.NewRow();
                    rowUsuario["idUsuario"] = oDataRow["idUsuario"];
                    oENTAtencion.tblUsuario.Rows.Add(rowUsuario);
                }

                // Transacción
                oENTResponse = BPAtencion.InsertClimaLaboral(oENTAtencion);

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

                // Transacción exitosa
                Clear();

                //Mensaje de usuario
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('Clima laboral registrado con éxito'); focusControl('" + this.ddlUsuario.ClientID + "');", true);

            }catch (Exception ex){
                throw (ex);
            }
        }
Ejemplo n.º 20
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
            { }
        }