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)); }
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)); }
public ActionResult Create([Bind(Include = "idBaseDatos,Administrador")] BaseDatos baseDatos) { if (ModelState.IsValid) { db.BaseDatos.Add(baseDatos); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(baseDatos)); }
public ActionResult Create([Bind(Include = "idDispensadorefectivo,contador,idATM")] DispensadorEfectivo dispensadorEfectivo) { if (ModelState.IsValid) { db.DispensadorEfectivo.Add(dispensadorEfectivo); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.idATM = new SelectList(db.ATM, "idATM", "Direccion", dispensadorEfectivo.idATM); return(View(dispensadorEfectivo)); }
public ActionResult Create([Bind(Include = "idPantalla,idATM")] Pantalla pantalla) { if (ModelState.IsValid) { db.Pantalla.Add(pantalla); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.idATM = new SelectList(db.ATM, "idATM", "Direccion", pantalla.idATM); return(View(pantalla)); }
public ActionResult Create([Bind(Include = "idRanuraDeposito,idATM")] RanuraDeposito ranuraDeposito) { if (ModelState.IsValid) { db.RanuraDeposito.Add(ranuraDeposito); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.idATM = new SelectList(db.ATM, "idATM", "Direccion", ranuraDeposito.idATM); return(View(ranuraDeposito)); }
public ActionResult Create([Bind(Include = "idCuenta,NumeroCuenta,pin,saldo,idBaseDatos")] Cuenta cuenta) { if (ModelState.IsValid) { db.Cuenta.Add(cuenta); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.idBaseDatos = new SelectList(db.BaseDatos, "idBaseDatos", "Administrador", cuenta.idBaseDatos); return(View(cuenta)); }
public ActionResult Create([Bind(Include = "idTeclado,Marca,idATM")] Teclado teclado) { if (ModelState.IsValid) { db.Teclado.Add(teclado); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.idATM = new SelectList(db.ATM, "idATM", "Direccion", teclado.idATM); return(View(teclado)); }
public ActionResult Create([Bind(Include = "idATM,Direccion,CodigoATM,idBaseDatos")] ATM aTM) { if (ModelState.IsValid) { db.ATM.Add(aTM); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.idBaseDatos = new SelectList(db.BaseDatos, "idBaseDatos", "Administrador", aTM.idBaseDatos); return(View(aTM)); }
public ActionResult Create([Bind(Include = "idRetiro,Monto,DNIPersona,NombrePersona,idATM,idCuenta")] Retiro retiro) { if (ModelState.IsValid) { db.Retiro.Add(retiro); 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)); }
public int SaveChanges() { return(_Context.SaveChanges()); }