public async Task <IActionResult> Edit(int id, [Bind("PaymentTermsID,DescripcionModoDePago,EstadoID")] ModoDePago modoDePago) { if (id != modoDePago.PaymentTermsID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(modoDePago); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ModoDePagoExists(modoDePago.PaymentTermsID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EstadoID"] = new SelectList(_context.Estado, "EstadoID", "StatusCode", modoDePago.EstadoID); return(View(modoDePago)); }
public ActionResult DeleteConfirmed(int id) { ModoDePago modoDePago = db.ModoDePagoes.Find(id); db.ModoDePagoes.Remove(modoDePago); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Descripcion")] ModoDePago modoDePago) { if (ModelState.IsValid) { db.Entry(modoDePago).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(modoDePago)); }
public ActionResult Create([Bind(Include = "ID,Descripcion")] ModoDePago modoDePago) { if (ModelState.IsValid) { db.ModoDePagoes.Add(modoDePago); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(modoDePago)); }
public async Task <IActionResult> Create([Bind("PaymentTermsID,DescripcionModoDePago,EstadoID")] ModoDePago modoDePago) { if (ModelState.IsValid) { _context.Add(modoDePago); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EstadoID"] = new SelectList(_context.Estado, "EstadoID", "StatusCode", modoDePago.EstadoID); return(View(modoDePago)); }
// GET: ModoDePagos/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ModoDePago modoDePago = db.ModoDePagoes.Find(id); if (modoDePago == null) { return(HttpNotFound()); } return(View(modoDePago)); }