public List<ObjetoGenerico> consultaTarjetaCreditoGeneralINNER() { try { List<ObjetoGenerico> lista = new List<ObjetoGenerico>(); CuentasPorCobrarEntities ent = new CuentasPorCobrarEntities(); var con = from t1 in ent.TarjetaCredito join t2 in ent.Banco on t1.idBanco equals t2.idBanco select new { t1.idEmpresa, t1.idTarjeta, t1.descripcion, t2.Nombre, t1.Estado } /*from b in ent.CuentaBancaria select b*/; foreach (var item in con) { ObjetoGenerico TarjetaCredito = new ObjetoGenerico(); TarjetaCredito.Campo1 = Convert.ToString(item.idEmpresa); TarjetaCredito.Campo2 = Convert.ToString(item.idTarjeta); TarjetaCredito.Campo3 = Convert.ToString(item.descripcion); TarjetaCredito.Campo4 = Convert.ToString(item.Nombre); TarjetaCredito.Campo8 = Convert.ToString(item.Estado); lista.Add(TarjetaCredito); } return lista; } catch (Exception) { return null; } }
public List<ObjetoGenerico> consultaCuentaBancariaGeneralINNER() { try { List<ObjetoGenerico> lista = new List<ObjetoGenerico>(); CuentasPorCobrarEntities ent = new CuentasPorCobrarEntities(); var con = from t1 in ent.CuentaBancaria join t2 in ent.Banco on t1.idBanco equals t2.idBanco join t3 in ent.Persona on t1.idTitular equals t3.IdPersona select new { t1.idEmpresa, t1.idCuentaBancaria, t2.Nombre, t3.NombreRazonSocial, t3.Apellido, t1.NumeroCuenta, t1.TipoCuenta, t1.Saldo, t1.Estado } /*from b in ent.CuentaBancaria select b*/; foreach (var item in con) { ObjetoGenerico CuentaBancaria = new ObjetoGenerico(); CuentaBancaria.Campo1 = Convert.ToString(item.idEmpresa); CuentaBancaria.Campo2 = Convert.ToString(item.idCuentaBancaria); CuentaBancaria.Campo3 = Convert.ToString(item.Nombre); CuentaBancaria.Campo4 = Convert.ToString(item.NombreRazonSocial + " " + item.Apellido); CuentaBancaria.Campo5 = Convert.ToString(item.NumeroCuenta); CuentaBancaria.Campo6 = Convert.ToString(item.TipoCuenta); CuentaBancaria.Campo7 = Convert.ToString(item.Saldo); CuentaBancaria.Campo8 = Convert.ToString(item.Estado); lista.Add(CuentaBancaria); } return lista; } catch (Exception) { return null; } }