public override void ActualizarControl() { ListaComentarios.BeginUpdate(); ListaComentarios.Items.Clear(); qGen.Select SelectComentarios = new qGen.Select("sys_log"); SelectComentarios.WhereClause = new qGen.Where(); SelectComentarios.WhereClause.Add(new qGen.ComparisonCondition("comando", "Comment")); SelectComentarios.WhereClause.Add(new qGen.ComparisonCondition("tabla", this.Elemento.TablaDatos)); SelectComentarios.WhereClause.Add(new qGen.ComparisonCondition("item_id", this.Elemento.Id)); SelectComentarios.Order = "id_log DESC"; System.Data.DataTable Comentarios = Elemento.Connection.Select(SelectComentarios); foreach (System.Data.DataRow Com in Comentarios.Rows) { Lbl.Sys.Log.Entrada Log = new Lbl.Sys.Log.Entrada(this.Connection, (Lfx.Data.Row)Com); ListViewItem Itm = ListaComentarios.Items.Add(Log.Id.ToString()); Itm.SubItems.Add(Lfx.Types.Formatting.FormatShortSmartDateAndTime(Log.Fecha)); Itm.SubItems.Add(this.Elemento.Connection.Tables["personas"].FastRows[Log.IdUsuario].Fields["nombre_visible"].Value.ToString()); Itm.SubItems.Add(Log.Carga); } ListaComentarios.EndUpdate(); EntradaComentario.Enabled = this.Elemento.Existe; BotonAgregar.Enabled = EntradaComentario.Enabled; base.ActualizarControl(); }
public override void ActualizarControl() { ListaComentarios.BeginUpdate(); ListaComentarios.Items.Clear(); qGen.Select SelectComentarios = new qGen.Select("sys_log"); SelectComentarios.WhereClause = new qGen.Where(); SelectComentarios.WhereClause.Add(new qGen.ComparisonCondition("comando", "Comment")); SelectComentarios.WhereClause.Add(new qGen.ComparisonCondition("tabla", this.Elemento.TablaDatos)); SelectComentarios.WhereClause.Add(new qGen.ComparisonCondition("item_id", this.Elemento.Id)); SelectComentarios.Order = "id_log DESC"; System.Data.DataTable Comentarios = Elemento.Connection.Select(SelectComentarios); foreach (System.Data.DataRow Com in Comentarios.Rows) { Lbl.Sys.Log.Entrada Log = new Lbl.Sys.Log.Entrada(this.Connection, (Lfx.Data.Row)Com); ListViewItem Itm = ListaComentarios.Items.Add(Log.Id.ToString()); Itm.SubItems.Add(Lfx.Types.Formatting.FormatShortSmartDateAndTime(Log.Fecha)); Itm.SubItems.Add(Lfx.Workspace.Master.Tables["personas"].FastRows[Log.IdUsuario].Fields["nombre_visible"].Value.ToString()); Itm.SubItems.Add(Log.Carga); } ListaComentarios.EndUpdate(); EntradaComentario.Enabled = this.Elemento.Existe; BotonAgregar.Enabled = EntradaComentario.Enabled; base.ActualizarControl(); }
private void MostrarSeleccionado() { if (ListaHistoral.SelectedItems.Count == 0) { return; } Lbl.Sys.Log.Entrada Log = ListaHistoral.SelectedItems[0].Tag as Lbl.Sys.Log.Entrada; if (Log == null) { return; } if (Log.Comando == Lbl.Sys.Log.Acciones.Save) { Lui.Forms.MessageBox.Show(Log.ExplainSave(true), "Acción guardar"); } else { Lui.Forms.MessageBox.Show(Log.Carga, "Acción"); } }
private void TimerRefrescar_Tick(object sender, EventArgs e) { TimerRefrescar.Stop(); ListaHistoral.SuspendLayout(); ListaHistoral.BeginUpdate(); System.Data.DataTable LogsTable = this.Connection.Select("SELECT * FROM sys_log WHERE tabla='" + this.Tabla + "' AND item_id=" + this.ItemId.ToString() + " ORDER BY id_log DESC"); Lbl.ColeccionGenerica <Lbl.Sys.Log.Entrada> Logs = new Lbl.ColeccionGenerica <Lbl.Sys.Log.Entrada>(this.Connection, LogsTable); for (int i = 0; i < Logs.Count; i++) { Lbl.Sys.Log.Entrada Log = Logs[i]; Lfx.Data.Row Usuario = Lfx.Workspace.Master.Tables["personas"].FastRows[Log.IdUsuario]; ListViewItem Itm = ListaHistoral.Items.Add(Lfx.Types.Formatting.FormatSmartDateAndTime(Log.Fecha)); if (Usuario == null) { Itm.SubItems.Add(""); } else { Itm.SubItems.Add(Usuario.Fields["nombre_visible"].Value.ToString()); } switch (Log.Comando) { case Lbl.Sys.Log.Acciones.Save: Itm.SubItems.Add("Guardar"); break; case Lbl.Sys.Log.Acciones.Comment: Itm.SubItems.Add("Comentario"); break; case Lbl.Sys.Log.Acciones.Print: Itm.SubItems.Add("Imprimir"); break; case Lbl.Sys.Log.Acciones.Delete: Itm.SubItems.Add("Eliminar"); break; case Lbl.Sys.Log.Acciones.DeleteAndRevert: Itm.SubItems.Add("Eliminar y revertir"); break; case Lbl.Sys.Log.Acciones.LogOn: Itm.SubItems.Add("Ingreso al sistema"); break; default: Itm.SubItems.Add(Log.Comando.ToString()); break; } if (Log.Comando == Lbl.Sys.Log.Acciones.Save) { Itm.SubItems.Add(Log.ExplainSave(false)); } else { Itm.SubItems.Add(Log.Carga); } Itm.Tag = Log; if (ListaHistoral.Items.Count == 200) { // Muestro un parcial ListaHistoral.EndUpdate(); System.Windows.Forms.Application.DoEvents(); ListaHistoral.BeginUpdate(); } } ColDatos.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); ListaHistoral.EndUpdate(); ListaHistoral.ResumeLayout(true); }