Example #1
0
        private void enviarEmail(int _Id, Int16 _Departamento_id, string _Titulo)
        {
            MailBL        _MailBL       = new MailBL();
            TB_AccesosBL  _TB_AccesosBL = new TB_AccesosBL();
            List <string> ListEmail     = _TB_AccesosBL.ListarTB_AccesosEmailByDeparatmento(_Departamento_id, 2);
            string        _BodyHTML     = _MailBL.doBodyAlerta(_Id, _Titulo, ddlDepartamento.SelectedItem.ToString());

            foreach (string ElemtEmail in ListEmail)
            {
                _MailBL.sndMailHeader(ElemtEmail, _BodyHTML, "Incidente N° " + _Id + ": " + _Titulo);
            }
        }
Example #2
0
 protected void rptAprobador_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
     {
         short        IdSes         = ((Fnc_FuncionariosBE)Session["Fnc_Funcionarios"]).Funcionario_Id;
         ImageButton  ib            = (ImageButton)e.Item.FindControl("ibnActualizar");
         TB_AccesosBE _TB_AccesosBE = new TB_AccesosBE();
         TB_AccesosBL _TB_AccesosBL = new TB_AccesosBL();
         _TB_AccesosBE = _TB_AccesosBL.TraerTB_Accesos(IdSes, 8);
         RepeaterItem fila = (RepeaterItem)ib.Parent;
         if (ib != null)
         {
             short _Registro_id = short.Parse(((Label)fila.Controls[1]).Text);
             if (_Registro_id == IdSes)
             {
                 ib.Enabled = true;
             }
             else
             {
                 if (_TB_AccesosBE.Permiso == 1)
                 {
                     ib.Enabled = true;
                 }
                 else
                 {
                     ib.Enabled = false;
                 }
             }
         }
         ImageButton ibe = (ImageButton)e.Item.FindControl("ibnEliminar");
         if (ib != null)
         {
             string exito = "";
             if (Request.QueryString["reggistro"] != null)
             {
                 exito = (Request.QueryString["reggistro"]).ToString();
             }
             if (exito == "exito")
             {
                 string lblAprobador = ((Label)fila.Controls[3]).Text;
                 if (lblResponsable.Text != lblAprobador)
                 {
                     ibe.Visible = true;
                 }
             }
             else
             if (_TB_AccesosBE.Permiso == 1)
             {
                 ibe.Visible = true;
             }
         }
     }
 }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _TB_AccesosBE = new TB_AccesosBE();
            _TB_AccesosBL = new TB_AccesosBL();

            if (Session["Fnc_Funcionarios"] == null)
            {
                Response.Redirect("login_Novedades.aspx");
            }
            else
            {
                _TB_AccesosBE = _TB_AccesosBL.TraerTB_Accesos(_Fnc_FuncionariosBE.Funcionario_Id, 6);
                if (_TB_AccesosBE.Permiso != 1)
                {
                    Response.Redirect("login_Novedades.aspx?men=1");
                }
                else
                {
                    _Novedades_id       = Convert.ToInt32(Request.QueryString["Novedades_id"]);
                    _NOV_NovedadesBE    = new NOV_NovedadesBE();
                    _NOV_NovedadesBE    = _NOV_NovedadesBL.TraerNOV_NovedadesById(_Novedades_id);
                    txtTitulo.Text      = _NOV_NovedadesBE.Titulo;
                    txtDescripcion.Text = _NOV_NovedadesBE.Descripcion;
                    imgFoto.ImageUrl    = _NOV_NovedadesBE.Foto;
                }
            }
            if (!this.IsPostBack)
            {
                if (Session["Fnc_Funcionarios"] == null)
                {
                    Response.Redirect("login_Novedades.aspx");
                }
                _Fnc_FuncionariosBE = new Fnc_FuncionariosBE();
                _Fnc_FuncionariosBE = ((Fnc_FuncionariosBE)Session["Fnc_Funcionarios"]);
            }
        }
        private void GenerarTabla(string _Departamento_id, string _tipoPlan, string _Responsable
                                  , string _Estado, DateTime _Fecha_incidente, DateTime _Fecha_incidente1)
        {
            DataTable     Resultados = _TB_PlanAccionBL.ListarTB_PlanAccionFind_ALR(_Departamento_id, _tipoPlan, _Responsable, _Estado, _Fecha_incidente, _Fecha_incidente1);
            StringBuilder Tabla = new StringBuilder();
            TB_AccesosBL  _TB_AccesosBL = new TB_AccesosBL();
            int           _cumplido = 0, _progreso = 0, _pendiente = 0, _total = 0;

            string _idEtiqueta;

            int TotalRegistros = Resultados.Rows.Count;

            Tabla.AppendLine("<table id=\"myTable\" class=\"tablesorter\">");
            Tabla.AppendLine("<thead>");
            string cabecera = "";

            cabecera = "<th>COD.</th><th width=\"210\"> DESCRIPCIÓN DEL PLAN </th><th width=\"150\">DESCRIPCIÓN DE LA ALERTA</th><th>FECHA</th><th> RESPONSABLE </th><th> DEPARTAMENTO. </th><th>TIP. PLAN.</th><th>ESTADO</th>";
            Tabla.AppendLine(cabecera);
            Tabla.AppendLine("</thead>");
            Tabla.AppendLine("<tbody>");

            TB_AccesosBE _TB_AccesosBE = _TB_AccesosBL.TraerTB_Accesos(((Fnc_FuncionariosBE)Session["Fnc_Funcionarios"]).Funcionario_Id, 2);

            for (int i = 0; i < TotalRegistros; i++)
            {
                _total++;
                _idEtiqueta = Resultados.Rows[i]["PlanAccion_id"].ToString();
                Tabla.AppendLine("<tr>");

                Tabla.Append("<td>" + _idEtiqueta + " </a></td>");

                //if (int.Parse(Resultados.Rows[i]["Departamento_id"].ToString()) == _TB_AccesosBE.Departamento_id)
                //    Tabla.Append("<td>" + "<a href=\"#\" onClick=\"PopUp('ActualizarPlanAccion.aspx?PlanAccion_id=" + _idEtiqueta + "',20,20,950,700); return false;\"> " + _idEtiqueta + " </a></td>");
                //else
                //    Tabla.Append("<td>" + _idEtiqueta + " </td>");

                Tabla.Append("<td><a href=\"#\" onClick=\"PopUp('../admin/ActualizarPlanAccion.aspx?PlanAccion_id=" + _idEtiqueta + " ',20,20,950,700); return false;\"> " + Resultados.Rows[i]["PlanAccion_desc"] + " </a></td>");
                //Tabla.Append("<td>" + Resultados.Rows[i]["Descripcion"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Alerta_Desc"] + "</td>");
                Tabla.Append("<td>" + (Resultados.Rows[i]["Fecha"]) + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Responsable"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Departamento_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["tipoPlan"] + "</td>");
                string color = "";
                if (Resultados.Rows[i]["Estado"].ToString() == "No Cumplido")
                {
                    color = "style=\"background-color: #F82727;\"";
                    if (DateTime.ParseExact((Resultados.Rows[i]["Fecha"]).ToString(), "dd/MM/yyyy", null) <= DateTime.Today)
                    {
                        color = "style=\"background-color: #F82727;\"";
                        Tabla.Append("<td " + color + ">No Cumplido</td>");
                        _progreso++;
                    }
                    else
                    {
                        color = "style=\"background-color: #F1BF20;\"";
                        Tabla.Append("<td " + color + ">En Proceso</td>");
                        _pendiente++;
                    }
                }
                if (Resultados.Rows[i]["Estado"].ToString() == "Cumplido")
                {
                    color = "style=\"background-color: #52C226;\"";
                    Tabla.Append("<td " + color + ">Cumplido</td>");
                    _cumplido++;
                }

                Tabla.Append(Environment.NewLine);
                Tabla.AppendLine("</tr>");
            }
            Tabla.AppendLine("</tbody>");
            Tabla.AppendLine("</table>");
            ltlResults.Text   = Tabla.ToString();
            lblTotal.Text     = _total.ToString();
            lblCumplido.Text  = _cumplido.ToString();
            lblEnProceso.Text = _progreso.ToString();
            lblPendiente.Text = _pendiente.ToString();
        }
        private void GenerarTabla(string _Departamento_id, string _Guardia_id
                                  , string _Area_id, string _Clasificacion_id, string _Tipo_emp, string _Rol_id
                                  , string _Rol_tiempo, string _Compania_tiempo, string _Turno, string _Estatus_ope
                                  , string _Comportamiento_inv_id, string _Condicion_inv_id, string _CausaInmediata_id, string _Tecnologia_id
                                  , string _ElementoClave_id, string _Estado, DateTime _Fecha_incidente, DateTime _Fecha_incidente1, int _Usuario_id)
        {
            DataTable Resultados = _TB_IncidentesBL.ListarTB_IncidentesFind(_Departamento_id, _Guardia_id,
                                                                            _Area_id, _Clasificacion_id, _Tipo_emp, _Rol_id, _Rol_tiempo, _Compania_tiempo, _Turno,
                                                                            _Estatus_ope, _Comportamiento_inv_id, _Condicion_inv_id, _CausaInmediata_id, _Tecnologia_id, _ElementoClave_id,
                                                                            _Estado, _Fecha_incidente, _Fecha_incidente1, _Usuario_id);

            DataTable Estadisticas = _TB_IncidentesBL.ListarTB_Incidentes_Estadistica(_Departamento_id, _Guardia_id,
                                                                                      _Area_id, _Clasificacion_id, _Tipo_emp, _Rol_id, _Rol_tiempo, _Compania_tiempo, _Turno,
                                                                                      _Estatus_ope, _Comportamiento_inv_id, _Condicion_inv_id, _CausaInmediata_id, _Tecnologia_id, _ElementoClave_id,
                                                                                      _Estado, _Fecha_incidente, _Fecha_incidente1);
            StringBuilder Tabla         = new StringBuilder();
            StringBuilder TablaE        = new StringBuilder();
            TB_AccesosBL  _TB_AccesosBL = new TB_AccesosBL();

            string _idEtiqueta;

            int TotalRegistros = Resultados.Rows.Count;

            Tabla.AppendLine("<table id=\"myTable\" class=\"tablesorter\">");
            Tabla.AppendLine("<thead>");
            string cabecera = "";

            cabecera = "<th>COD.</th><th width=\"210\"> TITULO </th><th> DEPARTAMENTO. </th><th>FECHA</th><th> LOCALIZACIÓN </th><th> CLASIFI. </th><th>TIP. EMP.</th><th>ORIGINADOR</th><th> ESTADO </th>";
            Tabla.AppendLine(cabecera);
            Tabla.AppendLine("</thead>");
            Tabla.AppendLine("<tbody>");
            int          Nro           = 0;
            string       _estilo       = "";
            TB_AccesosBE _TB_AccesosBE = _TB_AccesosBL.TraerTB_Accesos(((Fnc_FuncionariosBE)Session["Fnc_Funcionarios"]).Funcionario_Id, 1);

            for (int i = 0; i < TotalRegistros; i++)
            {
                Nro = i + 1;

                //fecha = DateTime.ParseExact(Resultados.Rows[i]["Fecha_incidente"].ToString(), "dd/MM/yyyy", null);
                _idEtiqueta = Resultados.Rows[i]["Incidente_id"].ToString();
                //if ((i % 2) == 0)
                //    Tabla.AppendLine("<tr bgcolor='#ECECEC'>");
                //else
                Tabla.AppendLine("<tr>");

                if (_TB_AccesosBE.Permiso > 0)
                {
                    if (_TB_AccesosBE.Permiso == 1)
                    {
                        Tabla.Append("<td" + _estilo + ">" + "<a href=\"#\" onClick=\"PopUp('EvaluacionIncidentePop.aspx?Incidente_id=" + _idEtiqueta + "',20,20,950,678); return false;\"> " + _idEtiqueta + " </a></td>");
                    }
                    else
                    {
                        if (Resultados.Rows[i]["Acceso"].ToString() == "1")
                        {
                            Tabla.Append("<td" + _estilo + ">" + "<a href=\"#\" onClick=\"PopUp('EvaluacionIncidentePop.aspx?Incidente_id=" + _idEtiqueta + "',20,20,950,678); return false;\"> " + _idEtiqueta + " </a></td>");
                        }
                        else
                        {
                            Tabla.Append("<td" + _estilo + ">" + _idEtiqueta + " </td>");
                        }
                    }
                }
                else
                {
                    Tabla.Append("<td" + _estilo + ">" + _idEtiqueta + " </td>");
                }

                Tabla.Append("<td" + _estilo + ">" + "<a href=\"ActualizarIncidente.aspx?reg=ver&Incidente_id=" + _idEtiqueta + "\" > " + Resultados.Rows[i]["Titulo"] + " </a></td>");
                //Tabla.Append("<td>" + Resultados.Rows[i]["Descripcion"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Departamento"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Fecha_incidente"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Area_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Clasificacion_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Tipo_emp"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Originador"] + "</td>");
                string color = "";
                if (Resultados.Rows[i]["Estado"].ToString() == "Reportado")
                {
                    color = "style=\"background-color: #F82727;\"";
                }
                if (Resultados.Rows[i]["Estado"].ToString() == "Investigado")
                {
                    color = "style=\"background-color: #F1BF20;\"";
                }
                if (Resultados.Rows[i]["Estado"].ToString() == "Solucionado")
                {
                    color = "style=\"background-color: #52C226;\"";
                }
                Tabla.Append("<td " + color + ">" + Resultados.Rows[i]["Estado"] + "</td>");
                Tabla.Append(Environment.NewLine);
                Tabla.AppendLine("</tr>");
            }
            Tabla.AppendLine("</tbody>");
            Tabla.AppendLine("</table>");
            ltlResults.Text = Tabla.ToString();

            //Generar Tabla Estadistica
            TotalRegistros = Estadisticas.Rows.Count;
            TablaE.AppendLine("<table border='1'>");
            for (int i = 0; i < TotalRegistros; i++)
            {
                TablaE.AppendLine("<tr>");
                TablaE.Append("<td>" + Estadisticas.Rows[i]["clasificacion_desc"] + "</td>");
                TablaE.Append("<td>" + Estadisticas.Rows[i]["numero"] + "</td>");
                TablaE.Append(Environment.NewLine);
                TablaE.AppendLine("</tr>");
            }
            TablaE.AppendLine("</table>");
            ltrEstadistica.Text = TablaE.ToString();
        }
Example #6
0
        private void GenerarSemaforo(short _Departamento_id)
        {
            DataTable Resultados = _TRG_TriggerBL.TraerTRG_TriggerSemaforo(_Departamento_id);

            //DataTable Estadisticas = _TB_IncidentesBL.ListarTB_Incidentes_Estadistica(_Departamento_id, _Guardia_id,
            //    _Area_id, _Clasificacion_id, _Tipo_emp, _Rol_id,  _Fecha_incidente, _Fecha_incidente1);
            StringBuilder Tabla         = new StringBuilder();
            StringBuilder TablaE        = new StringBuilder();
            TB_AccesosBL  _TB_AccesosBL = new TB_AccesosBL();

            string _idEtiqueta;

            int TotalRegistros = Resultados.Rows.Count;

            if (TotalRegistros > 0)
            {
                Tabla.AppendLine("<table id=\"myTable\" class=\"tablesorter\">");
                Tabla.AppendLine("<thead>");
                string cabecera = "";
                cabecera = "<th>COD.</th><th> TIME STAMP </th><th> DEPARTAMENTO </th><th width=\"110\"> GUARDIA </th><th>QUIEN</th><th> RIESGO INI. </th><th>RIESGO FIN.</th>";
                Tabla.AppendLine(cabecera);
                Tabla.AppendLine("</thead>");
                Tabla.AppendLine("<tbody>");
                int    Valor, Valor_ini;
                string _estilo = "";

                //TB_AccesosBE _TB_AccesosBE = _TB_AccesosBL.TraerTB_Accesos(((Fnc_FuncionariosBE)Session["Fnc_Funcionarios"]).Funcionario_Id);
                //for (int i = 0; i < TotalRegistros; i++)
                //{
                _idEtiqueta = Resultados.Rows[0]["Trigger_id"].ToString();
                Tabla.AppendLine("<tr>");
                Valor     = Convert.ToInt32(Resultados.Rows[0]["Valor"]);
                Valor_ini = Convert.ToInt32(Resultados.Rows[0]["Valor_Ini"]);
                Tabla.Append("<td><a href=\"#\" onClick=\"PopUp('ActualizarTriggerPopUp.aspx?Trigger_id=" + _idEtiqueta + "',20,20,950,700); return false;\"> " + _idEtiqueta + " </a></td>");
                Tabla.Append("<td>" + Resultados.Rows[0]["trigger_fecha"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[0]["Departamento_desc"] + " </td>");
                Tabla.Append("<td>" + Resultados.Rows[0]["Guardia_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[0]["Ultimo"] + "</td>");
                if (Valor_ini <= 5)
                {
                    _estilo = "<h1><span class='verde'>" + Valor_ini + "</span></h1> ";
                }
                else
                {
                    if (Valor_ini >= 6)
                    {
                        _estilo = "<h1><span class='amarillo'>" + Valor_ini + "</span></h1> ";
                    }
                    if (Valor_ini > 8)
                    {
                        _estilo = "<h1><span class='rojo'>" + Valor_ini + "</span></h1> ";
                    }
                }
                Tabla.Append("<td>" + _estilo + "</td>");
                if (Valor <= 5)
                {
                    _estilo = "<h1><span class='verde'>" + Valor + "</span></h1> ";
                }
                else
                {
                    if (Valor >= 6)
                    {
                        _estilo = "<h1><span class='amarillo'>" + Valor + "</span></h1> ";
                    }
                    if (Valor > 8)
                    {
                        _estilo = "<h1><span class='rojo'>" + Valor + "</span></h1> ";
                    }
                }
                Tabla.Append("<td>" + _estilo + "</td>");
                Tabla.Append(Environment.NewLine);
                Tabla.AppendLine("</tr>");
                //}
                Tabla.AppendLine("</tbody>");
                Tabla.AppendLine("</table>");
                Literal1.Text = Tabla.ToString();
            }
        }
        private void GenerarTabla(string _Departamento_id, string _Guardia_id, string _Area_id, string _Auditoria_id, string _Operador, string _Originador, DateTime _Fecha_incidente, DateTime _Fecha_incidente1)
        {
            DataTable Resultados = _AUD_AuditoriaBL.ListarAUD_AuditoriaFind(_Departamento_id, _Guardia_id, _Area_id, _Auditoria_id, _Operador, _Originador, _Fecha_incidente, _Fecha_incidente1);

            //DataTable Estadisticas = _TB_IncidentesBL.ListarTB_Incidentes_Estadistica(_Departamento_id, _Guardia_id,
            //    _Area_id, _Clasificacion_id, _Tipo_emp, _Rol_id,  _Fecha_incidente, _Fecha_incidente1);
            StringBuilder Tabla         = new StringBuilder();
            StringBuilder TablaE        = new StringBuilder();
            TB_AccesosBL  _TB_AccesosBL = new TB_AccesosBL();

            string _idEtiqueta;
            string _Fecha_Auditoria;
            int    TotalRegistros = Resultados.Rows.Count;

            Tabla.AppendLine("<table id=\"myTable\" class=\"tablesorter\">");
            Tabla.AppendLine("<thead>");
            string cabecera = "";

            cabecera = "<th>COD.</th><th>AUDITORIA</th><th> DEPARTAMENTO </th><th width=\"110\"> GUARDIA </th><th width=\"110\"> ÁREA </th><th>OPERADOR</th><th>ORIGINADOR</th><th>FECHA REG.</th><th>FIRMA OPE.</th><th>Nota</th>";
            Tabla.AppendLine(cabecera);
            Tabla.AppendLine("</thñead>");
            Tabla.AppendLine("<tbody>");

            TB_AccesosBE _TB_AccesosBE = _TB_AccesosBL.TraerTB_Accesos(((Fnc_FuncionariosBE)Session["Fnc_Funcionarios"]).Funcionario_Id, 5);

            for (int i = 0; i < TotalRegistros; i++)
            {
                _idEtiqueta = Resultados.Rows[i]["Auditoria_id"].ToString();
                Tabla.AppendLine("<tr>");
                _Fecha_Auditoria = Resultados.Rows[i]["Fecha_firmaOpe"].ToString();

                if (_TB_AccesosBE.Permiso > 0)
                {
                    if (_TB_AccesosBE.Permiso == 1)
                    {
                        Tabla.Append("<td>" + "<a href=\"#\" onClick=\"PopUp('ActualizarAuditoriaPop.aspx?Auditoria_id=" + _idEtiqueta + "',20,20,950,678); return false;\"> " + _idEtiqueta + " </a></td>");
                    }
                    else
                    {
                        if (Resultados.Rows[i]["Acceso"].ToString() == "1")
                        {
                            Tabla.Append("<td>" + "<a href=\"#\" onClick=\"PopUp('ActualizarAuditoriaPop.aspx?Auditoria_id=" + _idEtiqueta + "',20,20,950,678); return false;\"> " + _idEtiqueta + " </a></td>");
                        }
                        else
                        {
                            Tabla.Append("<td>" + _idEtiqueta + " </td>");
                        }
                    }
                }
                else
                {
                    Tabla.Append("<td>" + _idEtiqueta + " </a></td>");
                }
                Tabla.Append("<td><a href=\"ActualizarAuditoria.aspx?Auditoria_id=" + _idEtiqueta + "\"> " + Resultados.Rows[i]["Auditoria_Desc"] + " </a></td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Departamento_desc"] + " </td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Guardia_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Area_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Operador"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Originador"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Fecha_Auditoria"] + "</td>");
                if (_Fecha_Auditoria == "Sin Firmar")
                {
                    Tabla.Append("<td style='background-color: red;color:black;border: 1px solid #ECECEC;'>" + _Fecha_Auditoria + "</td>");
                }
                else
                {
                    Tabla.Append("<td style='background-color: green;color:black;border: 1px solid #ECECEC;'>" + _Fecha_Auditoria + "</td>");
                }
                Tabla.Append("<td>" + Resultados.Rows[i]["Nota"] + "</td>");
                Tabla.Append(Environment.NewLine);
                Tabla.AppendLine("</tr>");
            }
            Tabla.AppendLine("</tbody>");
            Tabla.AppendLine("</table>");
            ltlResults.Text = Tabla.ToString();

            //Generar Tabla Estadistica
            //TotalRegistros = Estadisticas.Rows.Count;
            //TablaE.AppendLine("<table border='1'>");
            //for (int i = 0; i < TotalRegistros; i++)
            //{
            //    TablaE.AppendLine("<tr>");
            //    TablaE.Append("<td>" + Estadisticas.Rows[i]["clasificacion_desc"] + "</td>");
            //    TablaE.Append("<td>" + Estadisticas.Rows[i]["numero"] + "</td>");
            //    TablaE.Append(Environment.NewLine);
            //    TablaE.AppendLine("</tr>");
            //}
            //TablaE.AppendLine("</table>");
            //ltrEstadistica.Text = TablaE.ToString();
        }
Example #8
0
        private void GenerarTabla(string _Departamento_id, string _Area_id, string _Guardia_id, string _Funcionario_id
                                  , string _Sector_id, string _SubCategoria_id, string _Tipo_emp, string _Valor
                                  , DateTime _Fecha_Comportamiento, DateTime _Fecha_Comportamiento1)
        {
            TEM_ComportamientoEstadistica _ComEstad = new TEM_ComportamientoEstadistica();
            DataTable Resultados = _COM_ComportamientoBL.ListarCOM_ComportamientoFind(_Departamento_id, _Area_id, _Guardia_id, _Funcionario_id,
                                                                                      _Sector_id, _SubCategoria_id, _Tipo_emp, _Valor
                                                                                      , _Fecha_Comportamiento, _Fecha_Comportamiento1);

            _ComEstad = _COM_ComportamientoBL.TraerCOM_ComportamientoEstadistica(_Departamento_id, _Area_id, _Guardia_id, _Funcionario_id,
                                                                                 _Sector_id, _SubCategoria_id, _Tipo_emp, _Valor
                                                                                 , _Fecha_Comportamiento, _Fecha_Comportamiento1);
            //DataTable Estadisticas = _TB_IncidentesBL.ListarTB_Incidentes_Estadistica(_Departamento_id, _Guardia_id,
            //    _Area_id, _Clasificacion_id, _Tipo_emp, _Rol_id,  _Fecha_incidente, _Fecha_incidente1);
            StringBuilder Tabla         = new StringBuilder();
            StringBuilder TablaE        = new StringBuilder();
            TB_AccesosBL  _TB_AccesosBL = new TB_AccesosBL();

            string _idEtiqueta;

            int TotalRegistros = Resultados.Rows.Count;

            Tabla.AppendLine("<table id=\"myTable\" class=\"tablesorter\">");
            Tabla.AppendLine("<thead>");
            string cabecera = "";

            cabecera = "<th>COD.</th><th> SECTOR </th><th> DPTO. </th><th>ÁREA</th><th width=\"110\"> AUDITOR </th><th>FECHA</th><th> TURNO </th><th>TIP. EMP.</th><th width=\"210\"> CATEGORIA. </th><th>VALOR</th><th width=\"210\"> DESCRIPCIÓN </th>";
            Tabla.AppendLine(cabecera);
            Tabla.AppendLine("</thead>");
            Tabla.AppendLine("<tbody>");
            int    Nro     = 0;
            string _estilo = "";

            //TB_AccesosBE _TB_AccesosBE = _TB_AccesosBL.TraerTB_Accesos(((Fnc_FuncionariosBE)Session["Fnc_Funcionarios"]).Funcionario_Id);
            for (int i = 0; i < TotalRegistros; i++)
            {
                Nro         = i + 1;
                _idEtiqueta = Resultados.Rows[i]["Comportamiento_id"].ToString();
                Tabla.AppendLine("<tr>");

                //if (_TB_AccesosBE.Permiso > 0)
                //{
                //    if (_TB_AccesosBE.Permiso == 1)
                //        Tabla.Append("<td" + _estilo + ">" + "<a href=\"#\" onClick=\"PopUp('EvaluacionIncidentePop.aspx?Comportamiento_id=" + _idEtiqueta + "',20,20,950,678); return false;\"> " + _idEtiqueta + " </a></td>");
                //    else
                //    {
                //if (Resultados.Rows[i]["Acceso"].ToString() == "1")
                //    Tabla.Append("<td" + _estilo + ">" + "<a href=\"#\" onClick=\"PopUp('EvaluacionIncidentePop.aspx?Comportamiento_id=" + _idEtiqueta + "',20,20,950,678); return false;\"> " + _idEtiqueta + " </a></td>");
                //else
                //    Tabla.Append("<td" + _estilo + ">" + _idEtiqueta + " </td>");
                //    }
                //}
                //else
                Tabla.Append("<td" + _estilo + ">" + _idEtiqueta + " </td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Sector_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Departamento_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Area_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["AUDITOR"] + " </td>");
                //Tabla.Append("<td>" + Resultados.Rows[i]["Descripcion"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Fecha"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Turno"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Tipo_emp"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["SubCategoria_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Valor"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Descripcion"] + "</td>");
                Tabla.Append(Environment.NewLine);
                Tabla.AppendLine("</tr>");
            }
            Tabla.AppendLine("</tbody>");
            Tabla.AppendLine("</table>");
            ltlResults.Text = Tabla.ToString();
            lblValor1.Text  = _ComEstad.Valor1.ToString();
            lblValor2.Text  = _ComEstad.Valor2.ToString();
            lblValor3.Text  = _ComEstad.Valor3.ToString();
            //Generar Tabla Estadistica
            //TotalRegistros = Estadisticas.Rows.Count;
            //TablaE.AppendLine("<table border='1'>");
            //for (int i = 0; i < TotalRegistros; i++)
            //{
            //    TablaE.AppendLine("<tr>");
            //    TablaE.Append("<td>" + Estadisticas.Rows[i]["clasificacion_desc"] + "</td>");
            //    TablaE.Append("<td>" + Estadisticas.Rows[i]["numero"] + "</td>");
            //    TablaE.Append(Environment.NewLine);
            //    TablaE.AppendLine("</tr>");
            //}
            //TablaE.AppendLine("</table>");
            //ltrEstadistica.Text = TablaE.ToString();
        }
Example #9
0
        private void GenerarTabla(string _Funcionario_nome, string _Categoria_id, string _SubCategoria_id, string _Departamento_id, string _Rol_id, string _AreaLabor_id
                                  , string _Estado, string _Lider)
        {
            TEM_ComportamientoEstadistica _ComEstad = new TEM_ComportamientoEstadistica();
            DataTable     Resultados    = _Fnc_FuncionariosBL.ListarFnc_FuncionariosFill(_Funcionario_nome, _Categoria_id, _SubCategoria_id, _Departamento_id, _Rol_id, _AreaLabor_id, _Estado, _Lider);
            StringBuilder Tabla         = new StringBuilder();
            TB_AccesosBL  _TB_AccesosBL = new TB_AccesosBL();

            string _idEtiqueta;

            int TotalRegistros = Resultados.Rows.Count;

            Tabla.AppendLine("<table id=\"myTable\" class=\"tablesorter\">");
            Tabla.AppendLine("<thead>");
            string cabecera = "";

            cabecera = "<th>SHARP</th><th width=\"110\"> NOMBRES </th><th> DPTO. </th><th>ÁREA LABOR</th><th> Ce.coste</th><th> POSICIÓN </th><th> CATEGORIA </th><th>SUBCATEGORIA</th><th>LIDER</th><th>ESTADO</th>";
            Tabla.AppendLine(cabecera);
            Tabla.AppendLine("</thead>");
            Tabla.AppendLine("<tbody>");
            int    Nro     = 0;
            string _estilo = "";

            //TB_AccesosBE _TB_AccesosBE = _TB_AccesosBL.TraerTB_Accesos(((Fnc_FuncionariosBE)Session["Fnc_Funcionarios"]).Funcionario_Id);
            for (int i = 0; i < TotalRegistros; i++)
            {
                Nro         = i + 1;
                _idEtiqueta = Resultados.Rows[i]["Funcionario_id"].ToString();
                Tabla.AppendLine("<tr>");

                //if (_TB_AccesosBE.Permiso > 0)
                //{
                //    if (_TB_AccesosBE.Permiso == 1)
                Tabla.Append("<td" + _estilo + ">" + "<a href=\"#\" onClick=\"PopUp('ActualizarFuncionarioPop.aspx?Funcionario_id=" + _idEtiqueta + "',20,20,850,500); return false;\"> " + Resultados.Rows[i]["FUNCIONARIO_TNUMBER"] + " </a></td>");
                //    else
                //    {
                //if (Resultados.Rows[i]["Acceso"].ToString() == "1")
                //    Tabla.Append("<td" + _estilo + ">" + "<a href=\"#\" onClick=\"PopUp('EvaluacionIncidentePop.aspx?Comportamiento_id=" + _idEtiqueta + "',20,20,950,700); return false;\"> " + _idEtiqueta + " </a></td>");
                //else
                //    Tabla.Append("<td" + _estilo + ">" + _idEtiqueta + " </td>");
                //    }
                //}
                //else
                //Tabla.Append("<td" + _estilo + ">" + _idEtiqueta + " </td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["FUNCIONARIO_NOME"] + " </td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Departamento_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["AreaLabor_desc"] + "</td>");

                //Tabla.Append("<td>" + Resultados.Rows[i]["Descripcion"] + "</td>");

                Tabla.Append("<td>" + Resultados.Rows[i]["CE_COSTE"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Rol_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Categoria_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["SubCategoria_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Lider"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["FUNCIONARIO_STATUS"] + "</td>");
                Tabla.Append(Environment.NewLine);
                Tabla.AppendLine("</tr>");
            }
            Tabla.AppendLine("</tbody>");
            Tabla.AppendLine("</table>");
            ltlResults.Text = Tabla.ToString();
        }
Example #10
0
        private void GenerarTabla(string _Departamento_id, string _Guardia_id
                                  , string _Area_id, string _Clasificacion_id, string _SistemaQA_id, string _ElementoClave_id
                                  , string _Originador, string _Estado, DateTime _Fecha_alerta, DateTime _Fecha_alerta1, int _Usuario_id)
        {
            DataTable Resultados = _ALR_AlertasBL.ListarALR_AlertasFind(_Departamento_id, _Guardia_id,
                                                                        _Area_id, _Clasificacion_id, _SistemaQA_id, _ElementoClave_id, _Originador, _Estado, _Fecha_alerta, _Fecha_alerta1, _Usuario_id);

            //DataTable Estadisticas = _ALR_AlertasBL.ListarALR_Alertas_Estadistica(_Departamento_id, _Guardia_id,
            //    _Area_id, _Clasificacion_id, _SistemaQA_id, _ElementoClave_id, _Originador, _Estado, _Fecha_alerta, _Fecha_alerta1);
            StringBuilder Tabla = new StringBuilder();
            StringBuilder TablaE = new StringBuilder();
            TB_AccesosBL  _TB_AccesosBL = new TB_AccesosBL();
            int           _reportado = 0, _investigados = 0, _solucionados = 0;
            string        _idEtiqueta;

            int TotalRegistros = Resultados.Rows.Count;

            Tabla.AppendLine("<table id=\"myTable\" class=\"tablesorter\">");
            Tabla.AppendLine("<thead>");
            string cabecera = "";

            cabecera = "<th>COD.</th><th width=\"250\"> DESCRIPCIÓN </th><th> CLASIF. </th><th>FECHA</th><th> DEPTO </th><th> ÁREA </th><th> GUARDIA AUD. </th><th>TIP. FALLA</th><th>SIST. QA.</th><th>ORIGINADOR</th><th>DEPTO. ORI.</th><th>GUARD. ORI.</th>";
            Tabla.AppendLine(cabecera);
            Tabla.AppendLine("</thead>");
            Tabla.AppendLine("<tbody>");
            int          Nro           = 0;
            string       _estilo       = "";
            TB_AccesosBE _TB_AccesosBE = _TB_AccesosBL.TraerTB_Accesos(((Fnc_FuncionariosBE)Session["Fnc_Funcionarios"]).Funcionario_Id, 2);

            for (int i = 0; i < TotalRegistros; i++)
            {
                Nro = i + 1;

                //fecha = DateTime.ParseExact(Resultados.Rows[i]["Fecha_Alerta"].ToString(), "dd/MM/yyyy", null);
                _idEtiqueta = Resultados.Rows[i]["Alerta_id"].ToString();
                //if ((i % 2) == 0)
                //    Tabla.AppendLine("<tr bgcolor='#ECECEC'>");
                //else
                Tabla.AppendLine("<tr>");
                string color = "";
                if (Resultados.Rows[i]["Estado"].ToString() == "Reportado")
                {
                    _reportado++;
                    color = "style=\"background-color: #F82727;\"";
                }
                if (Resultados.Rows[i]["Estado"].ToString() == "Investigado")
                {
                    _investigados++;
                    color = "style=\"background-color: yellow;\"";
                }
                if (Resultados.Rows[i]["Estado"].ToString() == "Solucionado")
                {
                    _solucionados++;
                    color = "style=\"background-color: #52C226;\"";
                }
                //Tabla.Append("<td " + color + ">" + Resultados.Rows[i]["Estado"] + "</td>");
                if (_TB_AccesosBE.Permiso > 0)
                {
                    if (_TB_AccesosBE.Permiso == 1)
                    {
                        Tabla.Append("<td " + color + ">" + "<a href=\"#\" onClick=\"PopUp('EvaluacionAlertaPop.aspx?Alerta_id=" + _idEtiqueta + "',20,20,950,700); return false;\"> " + _idEtiqueta + " </a></td>");
                    }
                    else
                    {
                        if (Resultados.Rows[i]["Acceso"].ToString() == "1")
                        {
                            Tabla.Append("<td " + color + ">" + "<a href=\"#\" onClick=\"PopUp('EvaluacionAlertaPop.aspx?Alerta_id=" + _idEtiqueta + "',20,20,950,700); return false;\"> " + _idEtiqueta + " </a></td>");
                        }
                        else
                        {
                            Tabla.Append("<td " + color + ">" + _idEtiqueta + " </td>");
                        }
                    }
                }
                else
                {
                    Tabla.Append("<td " + color + ">" + _idEtiqueta + " </td>");
                }

                Tabla.Append("<td" + _estilo + ">" + "<a href=\"ActualizarAlerta.aspx?reg=ver&Alerta_id=" + _idEtiqueta + "\" > " + Resultados.Rows[i]["Alerta_desc"] + " </a></td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Clasificacion"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Fecha_Alerta"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Departamento_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Area_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Guardia_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["SistemaQA_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["SistemaQA_nom"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Funcionario_nome"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Departamento_ori"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Guardia_Ori"] + "</td>");

                Tabla.Append(Environment.NewLine);
                Tabla.AppendLine("</tr>");
            }
            Tabla.AppendLine("</tbody>");
            Tabla.AppendLine("</table>");
            ltlResults.Text = Tabla.ToString();

            //Generar Tabla Estadistica
            TablaE.AppendLine("<table border='1'>");
            TablaE.AppendLine("<tr>");
            TablaE.Append("<td> Reportados:</td>");
            TablaE.Append("<td style=\"background-color: #F82727;\">" + _reportado + "</td>");
            TablaE.Append(Environment.NewLine);
            TablaE.AppendLine("</tr>");
            TablaE.AppendLine("<tr>");
            TablaE.Append("<td> Investigado:</td>");
            TablaE.Append("<td style=\"background-color: yellow;\">" + _investigados + "</td>");
            TablaE.Append(Environment.NewLine);
            TablaE.AppendLine("</tr>");
            TablaE.AppendLine("<tr>");
            TablaE.Append("<td> Solucionado:</td>");
            TablaE.Append("<td style=\"background-color: #52C226;\">" + _solucionados + "</td>");
            TablaE.Append(Environment.NewLine);
            TablaE.AppendLine("</tr>");
            TablaE.AppendLine("<tr>");
            TablaE.Append("<td> Total:</td>");
            TablaE.Append("<td>" + (_solucionados + _investigados + _reportado) + "</td>");
            TablaE.Append(Environment.NewLine);
            TablaE.AppendLine("</tr>");
            TablaE.AppendLine("</table>");
            ltrEstadistica.Text = TablaE.ToString();
        }
Example #11
0
        private void generarTabla(string dep, string pil, string gua, string cat, string due, string estado, DateTime fecha, DateTime fecha1, string palabra)
        {
            DataTable     Resultados = _LUP_LupBL.ListarLUP_LupFind(dep, pil, gua, cat, due, estado, fecha, fecha1, palabra);
            StringBuilder Tabla      = new StringBuilder();

            TB_AccesosBL _TB_AccesosBL = new TB_AccesosBL();

            string _idEtiqueta;

            int TotalRegistros = Resultados.Rows.Count;

            Tabla.AppendLine("<table id=\"myTable\" class=\"tablesorter\">");
            Tabla.AppendLine("<thead>");
            string cabecera = "";

            cabecera = "<th>COD.</th><th width=\"150\"> TITULO </th><th> PILAR </th><th> ÁREA </th><th>GUARDIA</th><th>CATEGORIA</th><th> DUEÑO </th>><th>LUP</th><th>FECH. VENC.</th><th>FECH. REG.</th><th>ESTADO</th>";
            Tabla.AppendLine(cabecera);
            Tabla.AppendLine("</thead>");
            Tabla.AppendLine("<tbody>");
            int          Nro = 0;
            string       _estilo = "", archivo = "";
            int          _registrados = 0, _aprobados = 0;
            string       ext;
            string       img           = "";
            TB_AccesosBE _TB_AccesosBE = _TB_AccesosBL.TraerTB_Accesos(((Fnc_FuncionariosBE)Session["Fnc_Funcionarios"]).Funcionario_Id, 8);

            for (int i = 0; i < TotalRegistros; i++)
            {
                Nro         = i + 1;
                _idEtiqueta = Resultados.Rows[i]["Lup_id"].ToString();
                Tabla.AppendLine("<tr>");
                string color = "";
                if (Resultados.Rows[i]["Estado"].ToString() == "Por aprobar")
                {
                    _registrados++;
                    color = "style=\"background-color: #F82727;\"";
                }
                if (Resultados.Rows[i]["Estado"].ToString() == "Aprobado")
                {
                    _aprobados++;
                    color = "style=\"background-color: #52C226;\"";
                }

                if (_TB_AccesosBE.Permiso > 0)
                {
                    //if (_TB_AccesosBE.Permiso == 1)
                    Tabla.Append("<td>" + "<a href=\"#\" onClick=\"PopUp('ActualizarLupPop.aspx?Lup_id=" + _idEtiqueta + "',20,20,950,700); return false;\"> " + _idEtiqueta + " </a></td>");
                    //else
                    //{
                    //    if (Resultados.Rows[i]["Acceso"].ToString() == "1")
                    //        Tabla.Append("<td>" + "<a href=\"#\" onClick=\"PopUp('ActualizarLupPop.aspx?Lup_id=" + _idEtiqueta + "',20,20,950,700); return false;\"> " + _idEtiqueta + " </a></td>");
                    //    else
                    //        Tabla.Append("<td>" + _idEtiqueta + " </td>");
                    //}
                }
                else
                {
                    Tabla.Append("<td>" + _idEtiqueta + " </td>");
                }

                Tabla.Append("<td " + _estilo + ">" + "<a href=\"ActualizarLup.aspx?reg=ver&Lup_id=" + _idEtiqueta + "\" > " + Resultados.Rows[i]["Lup_Titulo"] + " </a></td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Pilar_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Departamento_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Guardia_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Categoria_desc"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["Funcionario_nome"] + "</td>");
                archivo = Resultados.Rows[i]["adjunto_lup"].ToString();
                if (archivo != "")
                {
                    ext = Path.GetExtension(archivo);
                    if (ext != "")
                    {
                        switch (ext)
                        {
                        case ".pdf": img = "pdf.jpg"; break;

                        case ".doc": img = "word.jpg"; break;

                        case ".docx": img = "word.jpg"; break;

                        case ".docm": img = "word.jpg"; break;

                        case ".xls": img = "excel.jpg"; break;

                        case ".xlsx": img = "excel.jpg"; break;

                        case ".ppt": img = "power.jpg"; break;

                        case ".pptx": img = "power.jpg"; break;

                        case ".jpg": img = "imagen.jpg"; break;

                        case ".png": img = "imagen.jpg"; break;

                        case ".bmp": img = "imagen.jpg"; break;

                        default: img = "archivo.jpg"; break;
                        }
                    }
                    Tabla.Append("<td>" + "<a title=\"" + archivo + "\" href=\"Archivos/" + archivo + "\"  target=\"_blank\"><img src=\"images/" + img + "\" alt=\"" + archivo + "\" width=\"20\" height=\"20\"/></a></td>");
                }
                else
                {
                    Tabla.Append("<td>Ninguno</td>");
                }

                Tabla.Append("<td>" + Resultados.Rows[i]["fecha_ven"] + "</td>");
                Tabla.Append("<td>" + Resultados.Rows[i]["fecha_reg"] + "</td>");
                Tabla.Append("<td " + color + ">" + Resultados.Rows[i]["Estado"] + "</td>");

                Tabla.Append(Environment.NewLine);
                Tabla.AppendLine("</tr>");
            }
            Tabla.AppendLine("</tbody>");
            Tabla.AppendLine("</table>");
            ltlResults.Text = Tabla.ToString();
        }