public IHttpActionResult PutBaseDatos(int id, BaseDatos baseDatos)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != baseDatos.idBaseDatos)
            {
                return(BadRequest());
            }

            db.Entry(baseDatos).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BaseDatosExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PutTeclado(int id, Teclado teclado)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != teclado.idTeclado)
            {
                return(BadRequest());
            }

            db.Entry(teclado).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TecladoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemple #3
0
        public IHttpActionResult PutCuenta(int id, Cuenta cuenta)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != cuenta.idCuenta)
            {
                return(BadRequest());
            }

            db.Entry(cuenta).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CuentaExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemple #4
0
 public ActionResult Edit([Bind(Include = "idBaseDatos,Administrador")] BaseDatos baseDatos)
 {
     if (ModelState.IsValid)
     {
         db.Entry(baseDatos).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(baseDatos));
 }
 public ActionResult Edit([Bind(Include = "idDispensadorefectivo,contador,idATM")] DispensadorEfectivo dispensadorEfectivo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dispensadorEfectivo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idATM = new SelectList(db.ATM, "idATM", "Direccion", dispensadorEfectivo.idATM);
     return(View(dispensadorEfectivo));
 }
 public ActionResult Edit([Bind(Include = "idPantalla,idATM")] Pantalla pantalla)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pantalla).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idATM = new SelectList(db.ATM, "idATM", "Direccion", pantalla.idATM);
     return(View(pantalla));
 }
Exemple #7
0
 public ActionResult Edit([Bind(Include = "idRanuraDeposito,idATM")] RanuraDeposito ranuraDeposito)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ranuraDeposito).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idATM = new SelectList(db.ATM, "idATM", "Direccion", ranuraDeposito.idATM);
     return(View(ranuraDeposito));
 }
 public ActionResult Edit([Bind(Include = "idCuenta,NumeroCuenta,pin,saldo,idBaseDatos")] Cuenta cuenta)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cuenta).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idBaseDatos = new SelectList(db.BaseDatos, "idBaseDatos", "Administrador", cuenta.idBaseDatos);
     return(View(cuenta));
 }
Exemple #9
0
 public ActionResult Edit([Bind(Include = "idTeclado,Marca,idATM")] Teclado teclado)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teclado).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idATM = new SelectList(db.ATM, "idATM", "Direccion", teclado.idATM);
     return(View(teclado));
 }
Exemple #10
0
 public ActionResult Edit([Bind(Include = "idATM,Direccion,CodigoATM,idBaseDatos")] ATM aTM)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aTM).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idBaseDatos = new SelectList(db.BaseDatos, "idBaseDatos", "Administrador", aTM.idBaseDatos);
     return(View(aTM));
 }
Exemple #11
0
 public ActionResult Edit([Bind(Include = "idRetiro,Monto,DNIPersona,NombrePersona,idATM,idCuenta")] Retiro retiro)
 {
     if (ModelState.IsValid)
     {
         db.Entry(retiro).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idATM    = new SelectList(db.ATM, "idATM", "Direccion", retiro.idATM);
     ViewBag.idCuenta = new SelectList(db.Cuenta, "idCuenta", "idCuenta", retiro.idCuenta);
     return(View(retiro));
 }
Exemple #12
0
 public void StateModified(object Entity)
 {
     _Context.Entry(Entity).State = System.Data.Entity.EntityState.Modified;
 }