Exemple #1
0
        protected mAprobados totalAcciones()
        {
            mAprobados aprobados = new mAprobados();

            aprobados.aprob = 0;
            aprobados.rech  = 0;
            aprobados.pend  = 0;
            mInformeEI      = cInformeEI.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "1");
            DataTable todos = cInformeEI.ListadoAcciones(mInformeEI.id_fuente, 0, "todos", 1);

            foreach (DataRow row in todos.Rows)
            {
                switch (row["aprobado"].ToString())
                {
                case "2":
                    aprobados.aprob++;
                    break;

                case "-2":
                    aprobados.rech++;
                    break;

                default:
                    aprobados.pend++;
                    break;
                }
            }
            return(aprobados);
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lblFuente.InnerText          = cFuente.nombreFuenteA(Session["noAccion"].ToString());
                this.Session["noPlanAccion"] = 0;

                mAccionG = cAcciones.Obtner_AccionGenerada(int.Parse(Session["noAccion"].ToString()));
                mFuente  = cFuente.ObtenerFuente(mAccionG.id_fuente);

                id_enlace = mAccionG.id_enlace;
                visibleAdjuntar(false);
                visibleActividad(false);
                cAcciones.dropUnidad(ddlunidad);
                ddlunidad.SelectedValue = mAccionG.id_unidad.ToString();
                cAcciones.dllDependencia(ddldependencia, mAccionG.id_unidad);
                ddldependencia.SelectedValue = mAccionG.id_dependencia.ToString();
                txtDescripcion.Text          = mAccionG.descripcion.ToString();

                txtanio.Text       = mFuente.anio.ToString();
                txtHallazgo.Text   = mAccionG.correlativo_hallazgo.ToString();
                txtEvaluacion.Text = Session["noAccion"].ToString();

                cInfoCorrec.ddlTecnicaAnalisis(ddlTecnicaAnalisis);

                cAcciones.dropTipoAccion(ddlTipoAccionInforme);
                ddlTipoAccionInforme.SelectedValue = mAccionG.id_tipo_accion.ToString();

                enabledPlan(false);
                //if (mAccionG.id_status == 1)
                switch (mAccionG.id_status)
                {
                case 1:     //pendiente de finalizar
                case -1:    //rechazado
                    mPlanAccion = cPlanAccion.Obtner_PlanAccion(mAccionG.id_accion_generada);
                    ddlTecnicaAnalisis.SelectedValue = mPlanAccion.tecnica_analisis;
                    txtCausa.Text = mPlanAccion.causa_raiz;

                    enabledCausaRaiz(false);
                    enabledPlan(true);
                    visibleAdjuntar(false);

                    this.Session["noPlanAccion"] = mPlanAccion.id_plan;
                    break;
                }
                gvListado.DataSource = cPlanAccion.ListadoAccionesRealizar(int.Parse(Session["noPlanAccion"].ToString()));
                gvListado.DataBind();

                ddlResponsable.ClearSelection();
                ddlResponsable.Items.Clear();
                ddlResponsable.AppendDataBoundItems = true;
                ddlResponsable.Items.Add("<< Elija Empleado >>");
                ddlResponsable.Items[0].Value = "0";
                ddlResponsable.DataSource     = cGen.dropEmpleados();
                ddlResponsable.DataTextField  = "texto";
                ddlResponsable.DataValueField = "id";
                ddlResponsable.DataBind();
            }
        }
Exemple #3
0
 protected void gvListadoAcciones_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     this.Session["pagina"]       = e.NewPageIndex;
     mMinutaRevisionAD            = cMinutaRevisionAD.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "7");
     gvListadoAcciones.PageIndex  = e.NewPageIndex;
     gvListadoAcciones.DataSource = cMinutaRevisionAD.ListadoAcciones(mMinutaRevisionAD.id_fuente, 0, "todos", 7);
     gvListadoAcciones.DataBind();
 }
Exemple #4
0
 protected void gvListadoAcciones_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     this.Session["pagina"]       = e.NewPageIndex;
     mQuejaReclamo                = cQuejaReclamo.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "3");
     gvListadoAcciones.PageIndex  = e.NewPageIndex;
     gvListadoAcciones.DataSource = cQuejaReclamo.ListadoAcciones(mQuejaReclamo.id_fuente, 0, "todos", 3);
     gvListadoAcciones.DataBind();
 }
Exemple #5
0
 protected void gvListadoAcciones_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     this.Session["pagina"]       = e.NewPageIndex;
     mSatisfaccionCliente         = cSatisfaccionCliente.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "6");
     gvListadoAcciones.PageIndex  = e.NewPageIndex;
     gvListadoAcciones.DataSource = cSatisfaccionCliente.ListadoAcciones(mSatisfaccionCliente.id_fuente, 0, "todos", 6);
     gvListadoAcciones.DataBind();
 }
Exemple #6
0
 protected void gvListadoAcciones_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     this.Session["pagina"]       = e.NewPageIndex;
     mIniciativaPropia            = cIniciativaPropia.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "4");
     gvListadoAcciones.PageIndex  = e.NewPageIndex;
     gvListadoAcciones.DataSource = cIniciativaPropia.ListadoAcciones(mIniciativaPropia.id_fuente, 0, "todos", 4);
     gvListadoAcciones.DataBind();
 }
        protected void btnGuardar_Click(object sender, EventArgs e) //ok
        {
            bool existeHallazgo = false;

            verColumnas(true);

            foreach (GridViewRow Row in gvListadoAcciones.Rows)
            {
                if (Row.Cells[3].Text == txtHallazgo.Text)
                {
                    existeHallazgo = true;
                }
            }

            if (!existeHallazgo)
            {
                mInformeEI = cInformeEI.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "1");

                mAccionG.id_fuente            = mInformeEI.id_fuente;
                mAccionG.correlativo_hallazgo = int.Parse(txtHallazgo.Text);
                mAccionG.norma                  = txtPuntoNorma.Text;
                mAccionG.descripcion            = txtDescripcion.Text;
                mAccionG.id_unidad              = int.Parse(ddlUnidad.SelectedValue);
                mAccionG.id_dependencia         = int.Parse(ddlDependencia.SelectedValue);
                mAccionG.id_ccl_accion_generada = int.Parse(ddlAccionGenerada.SelectedValue);
                mAccionG.id_proceso             = int.Parse(ddlProceso.SelectedValue);
                mAccionG.id_tipo_accion         = int.Parse(dllTipoAccion.SelectedValue);
                mAccionG.id_lider               = int.Parse(ddlLider.SelectedValue);
                mAccionG.id_enlace              = int.Parse(ddlEnlace.SelectedValue);

                if (mInformeEI.id_status == 0)
                {
                    if (cAcciones.ingresarAccion(mAccionG))
                    {
                        gvListadoAcciones.DataSource = cInformeEI.ListadoAcciones(mInformeEI.id_fuente, 0, "todos", 1);
                        gvListadoAcciones.DataBind();
                        ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('Acción generada exitosamente!', '', 'success');", true);
                        btnFinalizar.Visible = true;
                        limpiarAccion();
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('Error al ingresar!', 'Intente de nuevo', 'error');", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('No es posible agregar más Acciones!', 'El Informe ya ha sido finalizado', 'warning');", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('Ya existe Número de Hallazgo!', 'Intente con otro número', 'warning');", true);
            }

            verColumnas(false);
        }
 protected void gvListadoAcciones_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     verColumnas(true); /////////////////
     this.Session["pagina"]       = e.NewPageIndex;
     mInformeEE                   = cInformeEE.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "2");
     gvListadoAcciones.PageIndex  = e.NewPageIndex;
     gvListadoAcciones.DataSource = cInformeEE.ListadoAcciones(mInformeEE.id_fuente, 0, "todos", 2);
     gvListadoAcciones.DataBind();
     verColumnas(true); /////////////////
 }
 protected void btnEliminar_Click(object sender, EventArgs e)
 {
     verColumnas(true);
     cAcciones.EliminarAccion(int.Parse(Session["noAccion"].ToString()));
     mInformeEE = cInformeEE.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "2");
     gvListadoAcciones.DataSource = cInformeEE.ListadoAcciones(mInformeEE.id_fuente, 0, "todos", 2);
     gvListadoAcciones.DataBind();
     limpiarAccion();
     btnEliminar.Visible = false;
     verColumnas(false);
     ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('Registro eliminado correctamente', '', 'error');", true);
 }
Exemple #10
0
        void limpiarAccion()
        {
            mMinutaRevisionAD = cMinutaRevisionAD.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "7");

            mostrarCampos(true);
            btnGuardar.Visible  = false;
            btNuevo.Visible     = false;
            btnEditar.Visible   = false;
            btnEliminar.Visible = false;

            if (mMinutaRevisionAD.id_status == 0)
            {
                btnGuardar.Visible = true;
                btNuevo.Visible    = true;
            }

            int compromiso = 1;

            verColumnas(true);
            foreach (GridViewRow Row in gvListadoAcciones.Rows)
            {
                if (int.Parse(Row.Cells[2].Text) >= compromiso)
                {
                    compromiso = int.Parse(Row.Cells[2].Text) + 1;
                }
            }
            verColumnas(false);

            cargarDropLists();

            try
            {
                txtCompromiso.Text           = compromiso.ToString();
                ddlProceso.SelectedIndex     = 0;
                ddlUnidad.SelectedIndex      = 0;
                ddlDependencia.SelectedIndex = 0;
                txtDescripcion.Text          = "";
                ddlEnlace.SelectedIndex      = 0;
                ddlLider.SelectedIndex       = 0;
                txtAnalista.Text             = "";
                dllTipoAccion.SelectedIndex  = 0;
                //txtFechaRecepcion.Text = "";
                txtNoPlanAccion.Text = "";
            }

            catch
            {
            }


            btnEliminar.Visible = false;
        }
        protected void btnEditar_Click(object sender, EventArgs e)
        {
            try
            {
                mAccionG = cAcciones.Obtner_AccionGenerada(int.Parse(Session["noAccion"].ToString()));

                bool editada = false;

                mAccionesGeneradas ag = new mAccionesGeneradas();

                mAccionG.id_fuente      = mSalidaNoConforme.id_fuente;
                mAccionG.descripcion    = txtDescripcion.Text;
                mAccionG.id_unidad      = int.Parse(ddlUnidad.SelectedValue);
                mAccionG.id_dependencia = int.Parse(ddlDependencia.SelectedValue);
                mAccionG.id_proceso     = int.Parse(ddlProceso.SelectedValue);
                mAccionG.id_tipo_accion = int.Parse(dllTipoAccion.SelectedValue);
                mAccionG.id_lider       = int.Parse(ddlLider.SelectedValue);
                mAccionG.id_enlace      = int.Parse(ddlEnlace.SelectedValue);

                ag.id_accion_generada = int.Parse(Session["noAccion"].ToString());
                ag.descripcion        = txtDescripcion.Text;
                ag.id_lider           = int.Parse(ddlLider.SelectedValue);
                ag.id_enlace          = int.Parse(ddlEnlace.SelectedValue);
                ag.id_unidad          = int.Parse(ddlUnidad.SelectedValue);
                ag.id_dependencia     = int.Parse(ddlDependencia.SelectedValue);
                ag.id_proceso         = int.Parse(ddlProceso.SelectedValue);
                ag.id_tipo_accion     = int.Parse(dllTipoAccion.SelectedValue);

                editada = cAcciones.actualizar_Accion(ag);
                cAcciones.aprobar_Accion(ag.id_accion_generada, 0);
                verColumnas(true);
                mSalidaNoConforme            = cSalidaNoConforme.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "8");
                gvListadoAcciones.DataSource = cSalidaNoConforme.ListadoAcciones(mSalidaNoConforme.id_fuente, 0, "todos", 8);
                gvListadoAcciones.DataBind();
                verColumnas(false);

                if (editada)
                {
                    ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('La Acción ha sido actualizada correctamente', '', 'success');", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('No fue posible actualizar Acción', 'Intente de nuevo', 'error');", true);
                }
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('No fue posible actualizar Acción', 'Intente de nuevo', 'error');", true);
            }
        }
Exemple #12
0
        public int AlmacenarEncabezado(mFuente mInforme) //OK -- agregar switch por tipo de fuente ok
        {
            string tipoFuente = "";

            switch (mInforme.id_tipo_fuente)
            {
            case 1: tipoFuente = "no_informe_ei"; break;

            case 2: tipoFuente = "no_informe_ee"; break;

            case 3: tipoFuente = "no_queja"; break;

            case 4: tipoFuente = "no_iniciativa_pro"; break;

            case 5: tipoFuente = "no_medicion_ind"; break;

            case 6: tipoFuente = "no_medicion_satisfaccion"; break;

            case 7: tipoFuente = "no_minuta_rev_ad"; break;

            case 8: tipoFuente = "no_salida_no_conforme"; break;

            case 9: tipoFuente = "no_ineficacia"; break;
            }

            int result = 0;

            try
            {
                conectar.AbrirConexion();
                string query = string.Format("INSERT INTO sgc_fuente(anio, {4}, fecha, id_status, id_tipo_fuente, id_tipo_mejora, id_indicador) " +
                                             "VALUES('{0}', '{1}', '{2}', 0, '{3}', '{5}', '{6}'); ",
                                             mInforme.anio, mInforme.no_fuente, mInforme.fecha, mInforme.id_tipo_fuente, tipoFuente, mInforme.id_tipo_mejora, mInforme.id_indicador);
                MySqlCommand cmd = new MySqlCommand(query, conectar.conectar);
                cmd.ExecuteNonQuery();
                query = string.Format("SELECT * from sgc_fuente WHERE anio = '{0}' ORDER BY {1} DESC LIMIT 1; ", mInforme.anio, tipoFuente);
                cmd   = new MySqlCommand(query, conectar.conectar);
                MySqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    result = int.Parse(reader[0].ToString());
                }
                conectar.CerrarConexion();
            }
            catch (Exception ex)
            {
                return(-10);
            }
            return(result);
        }
        void limpiarAccion()
        {
            mInformeEE = cInformeEE.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "2");

            mostrarCampos(true);
            btnGuardar.Visible  = false;
            btNuevo.Visible     = false;
            btnEditar.Visible   = false;
            btnEliminar.Visible = false;

            if (mInformeEE.id_status == 0)
            {
                btnGuardar.Visible = true;
                btNuevo.Visible    = true;
            }

            int hallazgo = 1;

            verColumnas(true);
            foreach (GridViewRow Row in gvListadoAcciones.Rows)
            {
                if (int.Parse(Row.Cells[3].Text) >= hallazgo)
                {
                    hallazgo = int.Parse(Row.Cells[3].Text) + 1;
                }
            }
            verColumnas(false);

            cargarDropLists();


            ddlAccionGenerada.SelectedIndex = 0;
            txtHallazgo.Text             = hallazgo.ToString();
            txtPuntoNorma.Text           = "";
            ddlProceso.SelectedIndex     = 0;
            ddlUnidad.SelectedIndex      = 0;
            ddlDependencia.SelectedIndex = 0;
            txtDescripcion.Text          = "";
            ddlEnlace.SelectedIndex      = 0;
            ddlLider.SelectedIndex       = 0;
            txtAnalista.Text             = "";
            dllTipoAccion.SelectedIndex  = 0;
            txtNoAccion.Text             = "";

            btnEliminar.Visible = false;
        }
        protected void btnRechazarTodo_Click(object sender, EventArgs e)
        {
            if (int.Parse(Session["id_tipo_usuario"].ToString()) == 1)
            {
                mostrarBotones(false);
                mQuejaReclamo = cQuejaReclamo.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "3");
                cAcciones.aprobarTodo_Accion(mQuejaReclamo.id_fuente, "rechazado");
                ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('Acciones rechazadas correctamente', '', 'error');", true);

                botonesTodos();

                actualizarListadoAcciones();
            }

            else
            {
                ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('No tiene permisos para rechazar Acciones', '', 'warning');", true);
            }
        }
Exemple #15
0
        void limpiarAccion()
        {
            mQuejaReclamo = cQuejaReclamo.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "3");

            mostrarCampos(true);
            btnGuardar.Visible  = false;
            btNuevo.Visible     = false;
            btnEditar.Visible   = false;
            btnEliminar.Visible = false;

            if (mQuejaReclamo.id_status == 0)
            {
                btnGuardar.Visible = true;
                btNuevo.Visible    = true;
            }

            cargarDropLists();

            try
            {
                ddlFadn.SelectedIndex        = 0;
                txtInstalacion.Text          = "";
                ddlProceso.SelectedIndex     = 0;
                ddlUnidad.SelectedIndex      = 0;
                ddlDependencia.SelectedIndex = 0;
                txtDescripcion.Text          = "";
                ddlEnlace.SelectedIndex      = 0;
                ddlLider.SelectedIndex       = 0;
                txtAnalista.Text             = "";
                dllTipoAccion.SelectedIndex  = 0;
                txtNoPlanAccion.Text         = "";
            }

            catch
            {
            }


            btnEliminar.Visible = false;
        }
Exemple #16
0
        protected void btnGuardar_Click(object sender, EventArgs e) //ok
        {
            verColumnas(true);

            mQuejaReclamo = cQuejaReclamo.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "3");

            mAccionG.id_fuente      = mQuejaReclamo.id_fuente;
            mAccionG.instalacion    = txtInstalacion.Text;
            mAccionG.id_fadn        = int.Parse(ddlFadn.SelectedValue);
            mAccionG.descripcion    = txtDescripcion.Text;
            mAccionG.id_unidad      = int.Parse(ddlUnidad.SelectedValue);
            mAccionG.id_dependencia = int.Parse(ddlDependencia.SelectedValue);
            mAccionG.id_proceso     = int.Parse(ddlProceso.SelectedValue);
            mAccionG.id_tipo_accion = int.Parse(dllTipoAccion.SelectedValue);
            mAccionG.id_lider       = int.Parse(ddlLider.SelectedValue);
            mAccionG.id_enlace      = int.Parse(ddlEnlace.SelectedValue);

            if (mQuejaReclamo.id_status == 0)
            {
                if (cAcciones.ingresarAccion(mAccionG))
                {
                    gvListadoAcciones.DataSource = cQuejaReclamo.ListadoAcciones(mQuejaReclamo.id_fuente, 0, "todos", 3);
                    gvListadoAcciones.DataBind();
                    ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('Acción generada exitosamente!', '', 'success');", true);
                    btnFinalizar.Visible = true;
                    limpiarAccion();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('Error al ingresar!', 'Intente de nuevo', 'error');", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('No es posible agregar más Acciones!', 'El Informe ya ha sido finalizado', 'warning');", true);
            }

            verColumnas(false);
        }
Exemple #17
0
        protected void btnRechazarEficacia_Click(object sender, EventArgs e)
        {
            //mEmpleado mAnalista = new mEmpleado();
            mEmpleado mEnlace = new mEmpleado();

            mPlanAccion = cPlanAccion.Obtner_PlanAccion(int.Parse(Session["noAccion"].ToString()));
            mAccionG    = cAcciones.Obtner_AccionGenerada(mPlanAccion.id_accion_generada);
            //mAnalista = cEmpleado.Obtner_Empleado(mAccionG.id_analista, "analista");
            mEnlace = cEmpleado.Obtner_Empleado(mAccionG.id_enlace, "enlace");

            string fuente = cFuente.nombreFuenteA(Session["noAccion"].ToString());
            string asunto = "Plan de Acción RECHAZADO (" + Session["noAccion"].ToString() + "), " + fuente;

            switch (int.Parse(Session["id_tipo_usuario"].ToString()))
            {
            case 1:     //Director
                mIneficacia                = cFuente.ObtenerFuente(mAccionG.id_fuente);
                mIneficacia.no_fuente      = int.Parse(Session["noAccion"].ToString());
                mIneficacia.fecha          = DateTime.Today.ToString("yyyy-MM-dd");
                mIneficacia.id_tipo_fuente = 9;
                int idIneficacia = cFuente.AlmacenarEncabezado(mIneficacia);
                mAccionG.id_fuente = idIneficacia;
                mAccionG.aprobado  = 2;
                cAcciones.ingresarAccion(mAccionG);

                cPlanAccion.actualizar_statusPlan(int.Parse(Session["noPlanAccion"].ToString()), -4);
                if (mEnlace.email != null)
                {
                    cCorreo.enviarCorreo(mEnlace.email, asunto, txtRechazOEficacia.Text);
                }
                Response.Redirect("~/Seguimientos/SeguimientoPlanAccion.aspx");
                break;

            default:
                ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('No tiene permisos para validar Actividad', '', 'warning');", true);
                break;
            }
        }
Exemple #18
0
        protected void btnEditar_Click(object sender, EventArgs e)
        {
            try
            {
                mAccionG = cAcciones.Obtner_AccionGenerada(int.Parse(Session["noAccion"].ToString()));

                bool existeCompromiso = false;
                bool editada          = false;

                verColumnas(true);
                foreach (GridViewRow Row in gvListadoAcciones.Rows)
                {
                    if (Row.Cells[2].Text == txtCompromiso.Text)
                    {
                        existeCompromiso = true;
                    }
                }
                verColumnas(false);

                if (!existeCompromiso ||
                    mAccionG.correlativo_compromiso == int.Parse(txtCompromiso.Text))
                {
                    mAccionesGeneradas ag = new mAccionesGeneradas();

                    mAccionG.id_fuente = mMinutaRevisionAD.id_fuente;
                    mAccionG.correlativo_compromiso = int.Parse(txtCompromiso.Text);
                    mAccionG.descripcion            = txtDescripcion.Text;
                    mAccionG.id_unidad      = int.Parse(ddlUnidad.SelectedValue);
                    mAccionG.id_dependencia = int.Parse(ddlDependencia.SelectedValue);
                    mAccionG.id_proceso     = int.Parse(ddlProceso.SelectedValue);
                    mAccionG.id_tipo_accion = int.Parse(dllTipoAccion.SelectedValue);
                    mAccionG.id_lider       = int.Parse(ddlLider.SelectedValue);
                    mAccionG.id_enlace      = int.Parse(ddlEnlace.SelectedValue);

                    ag.id_accion_generada     = int.Parse(Session["noAccion"].ToString());
                    ag.descripcion            = txtDescripcion.Text;
                    ag.id_lider               = int.Parse(ddlLider.SelectedValue);
                    ag.id_enlace              = int.Parse(ddlEnlace.SelectedValue);
                    ag.id_unidad              = int.Parse(ddlUnidad.SelectedValue);
                    ag.id_dependencia         = int.Parse(ddlDependencia.SelectedValue);
                    ag.id_proceso             = int.Parse(ddlProceso.SelectedValue);
                    ag.id_tipo_accion         = int.Parse(dllTipoAccion.SelectedValue);
                    ag.correlativo_compromiso = int.Parse(txtCompromiso.Text);

                    editada = cAcciones.actualizar_Accion(ag);
                    cAcciones.aprobar_Accion(ag.id_accion_generada, 0);
                    //verColumnas(true);
                    mMinutaRevisionAD            = cMinutaRevisionAD.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "7");
                    gvListadoAcciones.DataSource = cMinutaRevisionAD.ListadoAcciones(mMinutaRevisionAD.id_fuente, 0, "todos", 7);
                    gvListadoAcciones.DataBind();
                    //verColumnas(false);

                    if (editada)
                    {
                        if (mAccionG.aprobado == -2)
                        {
                            mEmpleado = cEmpleado.Obtner_Empleado(1, "director");
                            string fuente      = cMinutaRevisionAD.nombreFuenteF(Session["idFuente"].ToString());
                            string asunto      = "ACCIÓN CORREGIDA: " + mAccionG.id_accion_generada + " " + fuente;
                            string descripcion = "Se corrigió la acción para nueva revisión. Por favor revisar.";
                            if (mEmpleado.email != null)
                            {
                                cCorreo.enviarCorreo(mEmpleado.email, asunto, descripcion);
                            }
                        }
                        ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('La Acción ha sido actualizada correctamente', '', 'success');", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('No fue posible actualizar Acción', 'Intente de nuevo', 'error');", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('Ya existe Número de Hallazgo!', 'Intente con otro número', 'warning');", true);
                }
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('No fue posible actualizar Acción', 'Intente de nuevo', 'error');", true);
            }
        }
Exemple #19
0
        public mFuente ObtenerFuente(int idFuente) //OK -- agregar switch por tipo de fuente
        {
            mFuente informe = new mFuente();

            try
            {
                string query = string.Format("SELECT * FROM sgc_fuente WHERE id_fuente = '{0}';", idFuente);
                conectar.AbrirConexion();
                MySqlCommand    cmd = new MySqlCommand(query, conectar.conectar);
                MySqlDataReader dr  = cmd.ExecuteReader();
                //
                while (dr.Read())
                {
                    informe.id_fuente = int.Parse(dr.GetString("id_fuente"));
                    informe.anio      = int.Parse(dr.GetString("anio"));
                    DateTime fecha = DateTime.Parse(dr.GetString("fecha"));
                    informe.fecha          = fecha.ToString("yyyy-MM-dd");
                    informe.id_status      = int.Parse(dr.GetString("id_status"));
                    informe.id_tipo_fuente = int.Parse(dr.GetString("id_tipo_fuente"));

                    if (!dr.IsDBNull(dr.GetOrdinal("id_tipo_mejora")))
                    {
                        informe.id_tipo_mejora = int.Parse(dr.GetString("id_tipo_mejora"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("id_indicador")))
                    {
                        informe.id_indicador = int.Parse(dr.GetString("id_indicador"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("id_ind_satisfaccion")))
                    {
                        informe.id_ind_satisfaccion = int.Parse(dr.GetString("id_ind_satisfaccion"));
                    }

                    if (!dr.IsDBNull(dr.GetOrdinal("no_informe_ei")))
                    {
                        informe.no_fuente = int.Parse(dr.GetString("no_informe_ei"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("no_informe_ee")))
                    {
                        informe.no_fuente = int.Parse(dr.GetString("no_informe_ee"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("no_queja")))
                    {
                        informe.no_fuente = int.Parse(dr.GetString("no_queja"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("no_medicion_ind")))
                    {
                        informe.no_fuente = int.Parse(dr.GetString("no_medicion_ind"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("no_iniciativa_pro")))
                    {
                        informe.no_fuente = int.Parse(dr.GetString("no_iniciativa_pro"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("no_medicion_satisfaccion")))
                    {
                        informe.no_fuente = int.Parse(dr.GetString("no_medicion_satisfaccion"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("no_minuta_rev_ad")))
                    {
                        informe.no_fuente = int.Parse(dr.GetString("no_minuta_rev_ad"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("no_salida_no_conforme")))
                    {
                        informe.no_fuente = int.Parse(dr.GetString("no_salida_no_conforme"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("no_ineficacia")))
                    {
                        informe.no_fuente = int.Parse(dr.GetString("no_ineficacia"));
                    }
                }
                conectar.CerrarConexion();
            }
            catch (Exception ex)
            {
                throw;
            }
            return(informe);
        }
Exemple #20
0
        public mFuente BuscarEncabezado(string noInforme, int anio, string idTipoFuente) //OK -- agregar switch por tipo de fuente
        {
            string tipoFuente = "";

            switch (idTipoFuente)
            {
            case "1": tipoFuente = "no_informe_ei"; break;

            case "2": tipoFuente = "no_informe_ee"; break;

            case "3": tipoFuente = "no_queja"; break;

            case "4": tipoFuente = "no_iniciativa_pro"; break;

            case "5": tipoFuente = "no_medicion_ind"; break;

            case "6": tipoFuente = "no_medicion_satisfaccion"; break;

            case "7": tipoFuente = "no_minuta_rev_ad"; break;

            case "8": tipoFuente = "no_salida_no_conforme"; break;

            case "9": tipoFuente = "no_ineficacia"; break;
            }

            mFuente informe = new mFuente();

            try
            {
                string query = string.Format("Select id_fuente,Date_format(fecha,'%Y-%m-%d') fecha, id_status, id_tipo_mejora, id_indicador, id_ind_satisfaccion from sgc_fuente where {2} = '{0}' AND anio = {1};", noInforme, anio, tipoFuente);
                conectar.AbrirConexion();
                MySqlCommand    cmd = new MySqlCommand(query, conectar.conectar);
                MySqlDataReader dr  = cmd.ExecuteReader();
                //
                while (dr.Read())
                {
                    informe.id_fuente = int.Parse(dr.GetString("id_fuente"));
                    informe.anio      = anio;
                    informe.no_fuente = int.Parse(noInforme);
                    DateTime fecha = DateTime.Parse(dr.GetString("fecha"));
                    informe.fecha     = fecha.ToString("yyyy-MM-dd");
                    informe.id_status = int.Parse(dr.GetString("id_status"));
                    if (!dr.IsDBNull(dr.GetOrdinal("id_tipo_mejora")))
                    {
                        informe.id_tipo_mejora = int.Parse(dr.GetString("id_tipo_mejora"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("id_indicador")))
                    {
                        informe.id_indicador = int.Parse(dr.GetString("id_indicador"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("id_ind_satisfaccion")))
                    {
                        informe.id_ind_satisfaccion = int.Parse(dr.GetString("id_ind_satisfaccion"));
                    }
                }
                conectar.CerrarConexion();
            }
            catch (Exception ex)
            {
                throw;
            }
            return(informe);
        }
Exemple #21
0
        protected void btnEditar_Click(object sender, EventArgs e)
        {
            try
            {
                mAccionG = cAcciones.Obtner_AccionGenerada(int.Parse(Session["noAccion"].ToString()));

                bool editada = false;

                mAccionesGeneradas ag = new mAccionesGeneradas();

                mAccionG.id_fuente      = mQuejaReclamo.id_fuente;
                mAccionG.instalacion    = txtInstalacion.Text;
                mAccionG.id_fadn        = int.Parse(ddlFadn.SelectedValue);
                mAccionG.descripcion    = txtDescripcion.Text;
                mAccionG.id_unidad      = int.Parse(ddlUnidad.SelectedValue);
                mAccionG.id_dependencia = int.Parse(ddlDependencia.SelectedValue);
                mAccionG.id_proceso     = int.Parse(ddlProceso.SelectedValue);
                mAccionG.id_tipo_accion = int.Parse(dllTipoAccion.SelectedValue);
                mAccionG.id_lider       = int.Parse(ddlLider.SelectedValue);
                mAccionG.id_enlace      = int.Parse(ddlEnlace.SelectedValue);

                ag.id_accion_generada = int.Parse(Session["noAccion"].ToString());
                ag.instalacion        = txtInstalacion.Text;
                ag.id_fadn            = int.Parse(ddlFadn.SelectedValue);
                ag.descripcion        = txtDescripcion.Text;
                ag.id_lider           = int.Parse(ddlLider.SelectedValue);
                ag.id_enlace          = int.Parse(ddlEnlace.SelectedValue);
                ag.id_unidad          = int.Parse(ddlUnidad.SelectedValue);
                ag.id_dependencia     = int.Parse(ddlDependencia.SelectedValue);
                ag.id_proceso         = int.Parse(ddlProceso.SelectedValue);
                ag.id_tipo_accion     = int.Parse(dllTipoAccion.SelectedValue);

                editada = cAcciones.actualizar_Accion(ag);
                cAcciones.aprobar_Accion(ag.id_accion_generada, 0);
                verColumnas(true);
                mQuejaReclamo = cQuejaReclamo.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "3");
                gvListadoAcciones.DataSource = cQuejaReclamo.ListadoAcciones(mQuejaReclamo.id_fuente, 0, "todos", 3);
                gvListadoAcciones.DataBind();
                verColumnas(false);

                if (editada)
                {
                    if (mAccionG.aprobado == -2)
                    {
                        mEmpleado = cEmpleado.Obtner_Empleado(1, "director");
                        string fuente      = cQuejaReclamo.nombreFuenteF(Session["idFuente"].ToString());
                        string asunto      = "ACCIÓN CORREGIDA: " + mAccionG.id_accion_generada + " " + fuente;
                        string descripcion = "Se corrigió la acción para nueva revisión. Por favor revisar.";
                        if (mEmpleado.email != null)
                        {
                            cCorreo.enviarCorreo(mEmpleado.email, asunto, descripcion);
                        }
                    }

                    ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('La Acción ha sido actualizada correctamente', '', 'success');", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('No fue posible actualizar Acción', 'Intente de nuevo', 'error');", true);
                }
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('No fue posible actualizar Acción', 'Intente de nuevo', 'error');", true);
            }
        }
Exemple #22
0
        protected void btnBuscarEncabezado_Click(object sender, EventArgs e) //OK
        {
            mQuejaReclamo = cQuejaReclamo.BuscarEncabezado(txtInforme.Text, int.Parse(txtanio.Text), "3");
            if (mQuejaReclamo.no_fuente != 0)
            {
                this.Session["idFuente"] = mQuejaReclamo.id_fuente.ToString();
                lblCorrelativo.Text      = mQuejaReclamo.id_fuente.ToString();
                txtFechaInforme.Text     = mQuejaReclamo.fecha;

                switch (mQuejaReclamo.id_status)
                {
                case 0:
                case -2:
                case 1:
                    pn1.Visible          = true;
                    btnFinalizar.Visible = false;
                    btnEliminar.Visible  = false;
                    btnGuardar.Visible   = false;
                    btNuevo.Visible      = false;

                    if (mQuejaReclamo.id_status == 0)
                    {
                        btnGuardar.Visible = true;
                        btNuevo.Visible    = true;
                    }

                    gvListadoAcciones.DataSource = cQuejaReclamo.ListadoAcciones(mQuejaReclamo.id_fuente, 0, "todos", 3);
                    gvListadoAcciones.DataBind();
                    if (gvListadoAcciones.Rows.Count > 0)
                    {
                        pn1.Visible          = true;
                        btnFinalizar.Visible = false;
                        if (mQuejaReclamo.id_status == 0)
                        {
                            btnFinalizar.Visible = true;
                        }
                        limpiarAccion();
                    }
                    //else txtHallazgo.Text = "1";

                    verColumnas(false);

                    break;

                case 2:
                    pn1.Visible          = false;
                    btnFinalizar.Visible = false;
                    ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('El informe está en ejecución', '', 'info');", true);
                    break;

                default:
                    break;
                }
            }
            else
            {
                pn1.Visible          = false;
                btnFinalizar.Visible = false;
                ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('No existe Informe', '', 'warning');", true);
            }
        }