public void Eliminar(DtoBanco banco) { var oDatabase = DatabaseFactory.CreateDatabase(); var oDbCommand = oDatabase.GetStoredProcCommand("Banco_Eliminar", banco.IdBanco ); oDatabase.ExecuteNonQuery(oDbCommand); }
public void Registrar(DtoBanco banco) { var oDatabase = DatabaseFactory.CreateDatabase(); var oDbCommand = oDatabase.GetStoredProcCommand("Banco_Insertar", banco.Nombre ?? string.Empty, banco.Direccion ?? string.Empty ); oDatabase.ExecuteNonQuery(oDbCommand); }
public async Task Eliminar(DtoBanco banco) { var myContent = JsonConvert.SerializeObject(banco); var buffer = System.Text.Encoding.UTF8.GetBytes(myContent); var byteContent = new ByteArrayContent(buffer); byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); HttpResponseMessage response = await client.PutAsync("PutEliminaBanco", byteContent); if (response.IsSuccessStatusCode) { } }
public async Task <IActionResult> Grabar(DtoBanco banco) { if (ModelState.IsValid) { if (banco.IdBanco == 0) { await _bancoServicio.Registrar(banco); } else { await _bancoServicio.Actualizar(banco); } } return(RedirectToAction("Index")); }
public DtoBanco Obtener(int id) { var entidad = new DtoBanco(); var oDatabase = DatabaseFactory.CreateDatabase(); var oDbCommand = oDatabase.GetStoredProcCommand("Banco_Obtener", id); using (IDataReader oReader = oDatabase.ExecuteReader(oDbCommand)) { while (oReader.Read()) { entidad.IdBanco = Convert.ToInt32(oReader["IdBanco"]); entidad.Nombre = oReader["Nombre"].ToString(); entidad.Direccion = oReader["Direccion"].ToString(); } } return(entidad); }
public void PutEliminaBanco(DtoBanco banco) { _metricaServicio.Banco.Eliminar(banco); }
public void PutBanco(DtoBanco banco) { _metricaServicio.Banco.Actualizar(banco); }
public void PostBanco(DtoBanco banco) { _metricaServicio.Banco.Registrar(banco); }
public void Eliminar(DtoBanco banco) { _daBanco.Eliminar(banco); }
public void Actualizar(DtoBanco banco) { _daBanco.Actualizar(banco); }
public void Registrar(DtoBanco banco) { _daBanco.Registrar(banco); }
public async Task <IActionResult> Eliminar(DtoBanco banco) { await _bancoServicio.Eliminar(banco); return(RedirectToAction("Index")); }