public void llenarcmbIDCatalogo() { DTCatalogoCuentas dta = new DTCatalogoCuentas(); List <Entidades.Catalogo_de_cuenta> listacmb = new List <Entidades.Catalogo_de_cuenta>(); listacmb = dta.ListarCatalogo(); foreach (Entidades.Catalogo_de_cuenta a in listacmb) { cmCatalogo.AppendValues(a.Numero_cuenta.ToString()); } cmbIDCatalogoCuentas.Model = cmCatalogo; }
public void llenarTreeporBusquedaNombre(string busqueda) { int existe = 0; recargarTreeView(); DTCatalogoCuentas dta = new DTCatalogoCuentas(); List <Entidades.Catalogo_de_cuenta> lista = new List <Entidades.Catalogo_de_cuenta>(); lista = dta.ListarCatalogo(); foreach (Entidades.Catalogo_de_cuenta a in lista) { if (busqueda == a.Nombre_cuenta) { ls.AppendValues(a.IdCatalogo_cuentas.ToString(), a.Numero_cuenta.ToString(), a.Nombre_cuenta.ToString(), a.Descripcion_cuenta.ToString(), a.Activo.ToString(), a.Pais_cuenta.ToString(), a.Id_cuentaPadre.ToString(), a.Detalles_empresa_id_empresa.ToString(), a.Tipos_naturaleza_id_naturalezaCuenta.ToString(), a.Usuario_idUsuario.ToString()); } existe = 1; } if (existe == 0) { foreach (Entidades.Catalogo_de_cuenta a in lista) { ls.AppendValues(a.IdCatalogo_cuentas.ToString(), a.Numero_cuenta.ToString(), a.Nombre_cuenta.ToString(), a.Descripcion_cuenta.ToString(), a.Activo.ToString(), a.Pais_cuenta.ToString(), a.Id_cuentaPadre.ToString(), a.Detalles_empresa_id_empresa.ToString(), a.Tipos_naturaleza_id_naturalezaCuenta.ToString(), a.Usuario_idUsuario.ToString()); } } //Crear el modelo de datos tvCatalogoCuentas.Model = ls; tvCatalogoCuentas.AppendColumn("idCatalogo_cuentas", new CellRendererText(), "text", 0); tvCatalogoCuentas.AppendColumn("numero_cuenta", new CellRendererText(), "text", 1); tvCatalogoCuentas.AppendColumn("nombre_cuenta", new CellRendererText(), "text", 2); tvCatalogoCuentas.AppendColumn("descripcion_cuenta", new CellRendererText(), "text", 3); tvCatalogoCuentas.AppendColumn("activo", new CellRendererText(), "text", 4); tvCatalogoCuentas.AppendColumn("pais_cuenta", new CellRendererText(), "text", 5); tvCatalogoCuentas.AppendColumn("id_cuentaPadre", new CellRendererText(), "text", 6); tvCatalogoCuentas.AppendColumn("Detalles_empresa_id_empresa", new CellRendererText(), "text", 7); tvCatalogoCuentas.AppendColumn("Tipos_naturaleza_id_naturalezaCuenta", new CellRendererText(), "text", 8); tvCatalogoCuentas.AppendColumn("Usuario_idUsuario", new CellRendererText(), "text", 9); }