示例#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;
     }
 }
示例#2
0
 public void setDataGridView(Models.Usuarios usuario)
 {
     if (DataGrid_Usuarios.InvokeRequired)
     {
         setDataList d = new setDataList(setDataGridView);
         this.Invoke(d, new object[] { usuario });
     }
     else
     {
         var n = this.DataGrid_Usuarios.Rows.Add();
         this.ProgressBar.Value += 1;
         DataGrid_Usuarios.Rows[n].Cells[0].Value = usuario.Id;
         DataGrid_Usuarios.Rows[n].Cells[1].Value = usuario.Usuario;
         DataGrid_Usuarios.Rows[n].Cells[2].Value = usuario.TipoUsuario;
         DataGrid_Usuarios.Rows[n].Cells[3].Value = usuario.Roles;
         DataGrid_Usuarios.Rows[n].Cells[4].Value = usuario.Activo;
     }
 }
示例#3
0
 public void setDataGridView(Models.Clientes cliente)
 {
     if (DataGrid_Clientes.InvokeRequired)
     {
         setDataList d = new setDataList(setDataGridView);
         this.Invoke(d, new object[] { cliente });
     }
     else
     {
         var n = DataGrid_Clientes.Rows.Add();
         this.ProgressBar.Value += 1;
         DataGrid_Clientes.Rows[n].Cells[0].Value = cliente.IdCliente;
         DataGrid_Clientes.Rows[n].Cells[1].Value = cliente.NumeroDeCuenta;
         DataGrid_Clientes.Rows[n].Cells[2].Value = cliente.Nombres;
         DataGrid_Clientes.Rows[n].Cells[3].Value = cliente.ApellidoPaterno;
         DataGrid_Clientes.Rows[n].Cells[4].Value = cliente.ApellidoMaterno;
         DataGrid_Clientes.Rows[n].Cells[5].Value = cliente.Telefono;
         DataGrid_Clientes.Rows[n].Cells[6].Value = cliente.Email;
         DataGrid_Clientes.Rows[n].Cells[7].Value = cliente.NumeroTelefonoAlarma;
     }
 }
示例#4
0
 public void setDataGridView(Models.Clientes cliente)
 {
     if (dataGridView_Clientes.InvokeRequired)
     {
         setDataList d = new setDataList(setDataGridView);
         this.Invoke(d, new object[] { cliente });
     }
     else
     {
         var n = this.dataGridView_Clientes.Rows.Add();
         dataGridView_Clientes.Rows[n].Cells[0].Value = cliente.IdCliente;
         dataGridView_Clientes.Rows[n].Cells[1].Value = cliente.NumeroDeCuenta;
         dataGridView_Clientes.Rows[n].Cells[2].Value = cliente.Nombres;
         dataGridView_Clientes.Rows[n].Cells[3].Value = cliente.ApellidoPaterno;
         dataGridView_Clientes.Rows[n].Cells[4].Value = cliente.ApellidoMaterno;
         dataGridView_Clientes.Rows[n].Cells[6].Value = cliente.NumeroTelefonoAlarma;
         dataGridView_Clientes.Rows[n].Cells[5].Value = cliente.Telefono;
         dataGridView_Clientes.Rows[n].Cells[7].Value = cliente.Email;
         //                dataGridView_Clientes.Rows[n].Cells[9].Nam
         //dataGridView_Clientes.Rows[n].Cells[8].Value = "Editar";
     }
 }
示例#5
0
 public void setDataPanel(Models.Clientes cliente)
 {
     if (panel.InvokeRequired)
     {
         setDataList d = new setDataList(setDataPanel);
         this.Invoke(d, new object[] { cliente });
     }
     else
     {
         this.ProgressBar.Value += 1;
         System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Monitor_));
         Button buttonStatus = new Button();
         buttonStatus.BackColor = System.Drawing.Color.LightGray;
         buttonStatus.Location  = new System.Drawing.Point(x, y);
         buttonStatus.Name      = cliente.NumeroDeCuenta;
         buttonStatus.Text      = cliente.NumeroDeCuenta;
         buttonStatus.FlatStyle = FlatStyle.Flat;
         buttonStatus.Font      = new System.Drawing.Font("Century Gothic", 5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
         buttonStatus.Size      = new System.Drawing.Size(30, 30);
         buttonStatus.TabIndex  = 3;
         buttonStatus.TabStop   = false;
         buttonStatus.Click    += new EventHandler(buttonStatus_Click);
         this.panel.Controls.Add(buttonStatus);
         this.panel.Location = new System.Drawing.Point(20, 60);
         this.panel.Name     = "panel_" + cliente.NumeroDeCuenta;
         this.panel.TabIndex = 1;
         List <LogMonitoreo360> logs = db.LogMonitoreo360.Where(model => cliente.NumeroDeCuenta.Contains(model.Log.Substring(61, 4)) && cliente.NumeroTelefonoAlarma.Contains(model.Log.Substring(54, 6).Replace("-", ""))).ToList();
         foreach (var log in logs.OrderBy(model => model.FechaCreacion))
         {
             string   report  = log.Log.Substring(66, log.Log.Length - 66);
             string[] eventos = report.Split('-')[1].Split('/');
             if (eventos.Count() > 1)
             {
                 List <CodigoEventos> CodigosEventos = db.CodigoEventos.ToList();
                 foreach (var evento in eventos)
                 {
                     if (evento.Substring(0, 2).Contains("OP"))
                     {
                         buttonStatus.BackColor = System.Drawing.Color.SeaGreen;
                     }
                     else if (evento.Substring(0, 2).Contains("CL"))
                     {
                         buttonStatus.BackColor = System.Drawing.Color.GreenYellow;
                     }
                     else if (evento.Substring(0, 2).Contains("CR"))
                     {
                         buttonStatus.BackColor = System.Drawing.Color.IndianRed;
                     }
                     else if (evento.Substring(0, 2).Contains("OR"))
                     {
                         buttonStatus.BackColor = System.Drawing.Color.BlueViolet;
                     }
                 }
             }
         }
         x     = x + 35;
         count = count + 1;
         if ((x + 30) > width)
         {
             y     = y + 35;
             x     = 5;
             count = 0;
         }
     }
 }