public List <ObjetoGenerico> obtieneListaObjeto() { try { List <ObjetoGenerico> listaObjetoGenerico = new List <ObjetoGenerico>(); ObjetoGenerico objecto = new ObjetoGenerico(); int recorre = 50; for (int i = 0; i < recorre; i++) { objecto.id = i; objecto.postId = i + 1000; objecto.name = String.Format("nombre generico {0}", i); objecto.email = String.Format("correogenerico{0}@webservices.cl", i); objecto.body = @"est natus enim nihil est dolore omnis voluptatem numquam\net omnis " + "occaecati quod ullam at\nvoluptatem error expedita pariatur\nnihil sint nostrum " + "voluptatem reiciendis et"; listaObjetoGenerico.Add(objecto); } return(listaObjetoGenerico); } catch (Exception ex) { string error = ex.InnerException.ToString(); return(null); } }
public bool GuardaObjetoGenerico([FromBody] ObjetoGenerico objeto) { try { bool retorno = false; if (objeto != null) { retorno = true; } return(retorno); } catch (Exception ex) { string error = ex.InnerException.ToString(); return(false); } }
public ObjetoGenerico obtieneObjetoPorID(int id) { try { ObjetoGenerico objeto = new ObjetoGenerico(); objeto.postId = id + 1000; objeto.id = id; objeto.name = "objeto generico"; objeto.email = "*****@*****.**"; objeto.body = "Cuerpo generico del retorno"; return(objeto); } catch (Exception ex) { string error = ex.InnerException.ToString(); return(null); } }
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); } }