public async Task <ActionResult> DeleteConfirmed(int id) { TPagos tPagos = await db.TPagos.FindAsync(id); db.TPagos.Remove(tPagos); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "IdPago,IdVenta,Fecha,PeriodoCancelado,Saldo,IdTipoPago,Monto")] TPagos tPagos) { if (ModelState.IsValid) { db.Entry(tPagos).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.IdTipoPago = new SelectList(db.CTipoPago, "IdTipoPago", "Descripcion", tPagos.IdTipoPago); //ViewBag.IdVenta = new SelectList(db.TVenta, "IdVenta", "Placa", tPagos.IdVenta); CargarComboVentas(tPagos.IdVenta); return(View(tPagos)); }
// GET: Pagos/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TPagos tPagos = await db.TPagos.FindAsync(id); if (tPagos == null) { return(HttpNotFound()); } return(View(tPagos)); }
// GET: Pagos/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TPagos tPagos = await db.TPagos.FindAsync(id); if (tPagos == null) { return(HttpNotFound()); } ViewBag.IdTipoPago = new SelectList(db.CTipoPago, "IdTipoPago", "Descripcion", tPagos.IdTipoPago); //ViewBag.IdVenta = new SelectList(db.TVenta, "IdVenta", "Placa", tPagos.IdVenta); CargarComboVentas(tPagos.IdVenta); return(View(tPagos)); }