public async Task <ActionResult <Ahorros> > PostAhorros(Ahorros ahorros) { _context.Ahorros.Add(ahorros); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAhorros", new { id = ahorros.IdAhorros }, ahorros)); }
public async Task <IActionResult> PutAhorros(int id, Ahorros ahorros) { if (id != ahorros.IdAhorros) { return(BadRequest()); } _context.Entry(ahorros).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AhorrosExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult DeleteConfirmed(int id) { Ahorros ahorros = db.ahorros.Find(id); db.ahorros.Remove(ahorros); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID_Saving,Name,Last_Name,Nationality,Identification,Material_Status,Phone_Number,Home_Phone,Email,Address,Account_type,Currency")] Ahorros ahorros) { if (ModelState.IsValid) { db.Entry(ahorros).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ahorros)); }
// GET: Ahorros/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Ahorros ahorros = db.ahorros.Find(id); if (ahorros == null) { return(HttpNotFound()); } return(View(ahorros)); }
private void btnCrearCta_Click(object sender, EventArgs e) { if (rbAhorros.Checked) { CtaAhorros = new Ahorros(); CtaAhorros.Numero = int.Parse(txtNumCta.Text); CtaAhorros.Nombre = txtNomCta.Text; CtaAhorros.Saldo = double.Parse(txtSaldoCta.Text); CtaAhorros.FechaVencimiento = dtpFecheVencimiento.Value; CtaAhorros.PorcentajeInteres = int.Parse(txtPorcentajeInteres.Text); MessageBox.Show("Cuenta de ahorros creada correctamente"); } if (rbCheques.Checked) { CtaCheques = new Cheques(); CtaCheques.Numero = int.Parse(txtNumCta.Text); CtaCheques.Nombre = txtNomCta.Text; CtaCheques.Saldo = double.Parse(txtSaldoCta.Text); CtaCheques.ComisionChequera = int.Parse(txtComisionChequera.Text); MessageBox.Show("Cuenta de cheques creada correctamente"); } }