public void llenarcmbIDAsiento() { DTAsiento_Contable dta = new DTAsiento_Contable(); List <Entidades.Asiento_contable> listacmb = new List <Entidades.Asiento_contable>(); listacmb = dta.ListarAsientos(); foreach (Entidades.Asiento_contable a in listacmb) { cmIDAsiento.AppendValues(a.CodigoAsiento.ToString()); } cmbIDAsientoContable.Model = cmIDAsiento; }
public void llenarTreeporBusquedaFecha(DateTime busqueda) { int existe = 0; recargarTreeView(); DTAsiento_Contable dta = new DTAsiento_Contable(); List <Entidades.Asiento_contable> lista = new List <Entidades.Asiento_contable>(); lista = dta.ListarAsientos(); foreach (Entidades.Asiento_contable a in lista) { if (busqueda == a.Fecha_asiento) { ls.AppendValues(a.IdAsiento.ToString(), a.CodigoAsiento.ToString(), a.CuentaDebeID.ToString(), a.ImporteDebe.ToString(), a.CuentaHaberID.ToString(), a.ImporteHaber.ToString(), a.Activo.ToString(), a.Fecha_asiento.ToString(), a.Catalogo_cuentas_idCatalogo_cuentas.ToString(), a.Usuario_idUsuario.ToString(), a.Detalles_empresa_id_empresa.ToString()); } existe = 1; } if (existe == 0) { foreach (Entidades.Asiento_contable a in lista) { ls.AppendValues(a.IdAsiento.ToString(), a.CodigoAsiento.ToString(), a.CuentaDebeID.ToString(), a.ImporteDebe.ToString(), a.CuentaHaberID.ToString(), a.ImporteHaber.ToString(), a.Activo.ToString(), a.Fecha_asiento.ToString(), a.Catalogo_cuentas_idCatalogo_cuentas.ToString(), a.Usuario_idUsuario.ToString(), a.Detalles_empresa_id_empresa.ToString()); } } //Crear el modelo de datos tvAsientosContables.Model = ls; tvAsientosContables.AppendColumn("idAsiento", new CellRendererText(), "text", 0); tvAsientosContables.AppendColumn("codigoAsiento", new CellRendererText(), "text", 1); tvAsientosContables.AppendColumn("cuentaDebeID", new CellRendererText(), "text", 2); tvAsientosContables.AppendColumn("importeDebe", new CellRendererText(), "text", 3); tvAsientosContables.AppendColumn("cuentaHaberID", new CellRendererText(), "text", 4); tvAsientosContables.AppendColumn("importeHaber", new CellRendererText(), "text", 5); tvAsientosContables.AppendColumn("activo", new CellRendererText(), "text", 6); tvAsientosContables.AppendColumn("fecha_asiento", new CellRendererText(), "text", 7); tvAsientosContables.AppendColumn("Catalogo_cuentas_idCatalogo_cuentas", new CellRendererText(), "text", 8); tvAsientosContables.AppendColumn("Usuario_idUsuario", new CellRendererText(), "text", 9); tvAsientosContables.AppendColumn("Detalles_empresa_id_empresa", new CellRendererText(), "text", 10); }