public ActionResult getHistorialMascota(int id) { List <HistorialMascota> historial = new List <HistorialMascota>(); HistorialMascotaBusinessLayer h = new HistorialMascotaBusinessLayer(); historial = h.getHistorialMascotas(id); List <HistorialViewModels> listaPaso = new List <HistorialViewModels>(); if (historial.Count() == 0) { return(View("axVacio")); } else { foreach (HistorialMascota ht in historial) { HistorialViewModels hvm = new HistorialViewModels(); hvm.fecha_visita = ht.fecha_visita; hvm.titulo_visita = ht.titulo_visita; hvm.tema_visita = ht.tema_visita; hvm.nombre_veterinaria = ht.veterinario_visita; listaPaso.Add(hvm); } ListaHistorial datos = new ListaHistorial(); datos.datosHistorial = listaPaso; return(View("axHistorial", datos)); } }
/// <summary> /// Método que obtiene los documentos, y lista la lista de historial /// </summary> /// <param name="parametro"></param> private void buscaDocumento(string parametro) { //Obtiene coincidencias del parametro GetHistorial(parametro); if (ListaHistorial != null) { ListaHistorial.Clear(); } }
private void ActualizarVentanaConstantemente() { while (true) { if (AbrirPestanna) { CrearNuevaPesanna(); } if (CerrarPestanna) { ElinimarPestanna(); if (tabControl1.Controls.Count == 0) { Application.Exit(); } } if (BusquedaEcha) { CambiarTituloDeVentana(); } if (AbrirHistorial) { if (InvokeRequired) { Invoke(new Action(() => { Mutex mutex = new Mutex(); mutex.WaitOne(); Thread.Sleep(50); AbrirHistorial = false; ListaHistorial.Count(); Thread.Sleep(50); mutex.ReleaseMutex(); HistorialMenu historial = new HistorialMenu(); historial.Show(); })); } } if (FinalizarEsteHilo) { Thread.CurrentThread.Abort(); } Thread.Sleep(100); } }
private void CambiarTituloDeVentana() { if (InvokeRequired) { Invoke(new Action(() => tabControl1.SelectedTab.Text = Busqueda)); } Mutex mutex = new Mutex(); mutex.WaitOne(); Thread.Sleep(50); BusquedaEcha = false; Historial historial = new Historial(); historial.DirecionWEB = Busqueda; historial.Fecha = DateTime.Now; ListaHistorial.Add(historial); ListaHistorial.Count(); Busqueda = ""; Thread.Sleep(50); mutex.ReleaseMutex(); }
private void CargarHistorial() { ListaHistorial.BeginUpdate(); ListaHistorial.Items.Clear(); string TextoSql = "SELECT tickets_eventos.id_ticket, tickets_eventos.fecha, tickets_eventos.descripcion, personas.nombre FROM tickets_eventos, personas WHERE tickets_eventos.id_tecnico=personas.id_persona AND tickets_eventos.id_ticket IN (SELECT id_ticket FROM tickets WHERE id_persona=" + EntradaCliente.ValueInt.ToString() + ") ORDER BY tickets_eventos.id_evento DESC"; System.Data.DataTable Eventos = this.Connection.Select(TextoSql); if (Eventos.Rows.Count > 0) { foreach (System.Data.DataRow Evento in Eventos.Rows) { ListViewItem itm = ListaHistorial.Items.Add(System.Convert.ToString(Evento["id_ticket"])); itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Evento["nombre"].ToString())); itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Lfx.Types.Formatting.FormatDate(Evento["fecha"]))); itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, System.Convert.ToString(Evento["descripcion"]).Replace(System.Convert.ToString(Lfx.Types.ControlChars.Cr), " ").Replace(System.Convert.ToString(Lfx.Types.ControlChars.Lf), ""))); if (System.Convert.ToInt32(Evento["id_ticket"]) != this.Elemento.Id) { itm.ForeColor = System.Drawing.Color.Gray; } } if (ListaHistorial.Items.Count > 0) { ListaHistorial.Items[0].Focused = true; ListaHistorial.Items[0].Selected = true; } } ListaHistorial.EndUpdate(); // Ancho automático para las columnas foreach (System.Windows.Forms.ColumnHeader lvHeader in ListaHistorial.Columns) { lvHeader.Width = -2; } }