Exemplo n.º 1
0
 public void setDataGridView(Models.Incidentes incidente)
 {
     if (DataGrid_Incidentes.InvokeRequired)
     {
         setDataList d = new setDataList(setDataGridView);
         this.Invoke(d, new object[] { incidente });
     }
     else
     {
         Models.Clientes        cliente = db.Clientes.Where(x => x.IdCliente == incidente.IdCliente).FirstOrDefault();
         CultureInfo            CI      = new CultureInfo("es-MX");
         Models.LogMonitoreo360 Log     = db.LogMonitoreo360.Where(x => x.Id == incidente.IdLog).FirstOrDefault();
         string report  = Log.Log.Substring(66, Log.Log.Length - 66);
         string eventos = "";
         foreach (var evento in report.Split('-')[1].Split('/'))
         {
             if (!evento.Contains("ri"))
             {
                 eventos = eventos + " " + evento.Substring(0, 2);
             }
         }
         var n = this.DataGrid_Incidentes.Rows.Add();
         this.ProgressBar.Value += 1;
         DataGrid_Incidentes.Rows[n].Cells[0].Value = incidente.Id;
         DataGrid_Incidentes.Rows[n].Cells[1].Value = cliente.Nombres + " " + cliente.ApellidoPaterno + " " + cliente.ApellidoMaterno;
         DataGrid_Incidentes.Rows[n].Cells[2].Value = eventos;
         DataGrid_Incidentes.Rows[n].Cells[3].Value = incidente.FechaHoraInicio.ToString("dddd dd MMMM yyyy hh:mm:ss tt", CI);
         if (incidente.FechaHoraFin != null)
         {
             DataGrid_Incidentes.Rows[n].Cells[4].Value = ((DateTime)incidente.FechaHoraFin).ToString("dddd dd MMMM yyyy hh:mm:ss tt", CI);
         }
         DataGrid_Incidentes.Rows[n].Cells[5].Value = string.IsNullOrEmpty(incidente.Estatus) ? "Sin Seguimiento" : incidente.Estatus;
     }
 }
Exemplo n.º 2
0
        public void setInfo(Guid IdUsuario)
        {
            this.IdUsuario = IdUsuario;
            List <Models.Incidentes> Incidentes = db.Incidentes.Where(x => x.Activo == true).ToList();

            foreach (var Incidente in Incidentes)
            {
                Models.Clientes        cliente = db.Clientes.Where(x => x.IdCliente == Incidente.IdCliente).FirstOrDefault();
                CultureInfo            CI      = new CultureInfo("es-MX");
                Models.LogMonitoreo360 Log     = db.LogMonitoreo360.Where(x => x.Id == Incidente.IdLog).FirstOrDefault();
                var    n       = Grid.Rows.Add();
                string report  = Log.Log.Substring(66, Log.Log.Length - 66);
                string eventos = "";
                foreach (var evento in report.Split('-')[1].Split('/'))
                {
                    if (!evento.Contains("ri"))
                    {
                        eventos = eventos + " " + evento.Substring(0, 2);
                    }
                }

                Grid.Rows[n].Cells[0].Value = Incidente.Id;
                Grid.Rows[n].Cells[1].Value = cliente.Nombres + " " + cliente.ApellidoPaterno + " " + cliente.ApellidoMaterno;
                Grid.Rows[n].Cells[2].Value = eventos;
                Grid.Rows[n].Cells[3].Value = Incidente.FechaHoraInicio.ToString("dddd dd MMMM yyyy hh:mm:ss tt", CI);
                if (Incidente.FechaHoraFin != null)
                {
                    Grid.Rows[n].Cells[4].Value = ((DateTime)Incidente.FechaHoraFin).ToString("dddd dd MMMM yyyy hh:mm:ss tt", CI);
                }
                Grid.Rows[n].Cells[5].Value = Incidente.Estatus == null?"Sin Seguimiento":Incidente.Estatus;
            }
        }