Exemple #1
0
        public void Eliminar(DtoBanco banco)
        {
            var oDatabase  = DatabaseFactory.CreateDatabase();
            var oDbCommand = oDatabase.GetStoredProcCommand("Banco_Eliminar",
                                                            banco.IdBanco
                                                            );

            oDatabase.ExecuteNonQuery(oDbCommand);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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"));
        }
Exemple #5
0
        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);
 }
Exemple #9
0
 public void Eliminar(DtoBanco banco)
 {
     _daBanco.Eliminar(banco);
 }
Exemple #10
0
 public void Actualizar(DtoBanco banco)
 {
     _daBanco.Actualizar(banco);
 }
Exemple #11
0
 public void Registrar(DtoBanco banco)
 {
     _daBanco.Registrar(banco);
 }
Exemple #12
0
        public async Task <IActionResult> Eliminar(DtoBanco banco)
        {
            await _bancoServicio.Eliminar(banco);

            return(RedirectToAction("Index"));
        }