public async Task <IActionResult> Edit(int id, [Bind("IDPL,Temporada,PrecioPL")] PrecioLata precioLata) { if (id != precioLata.IDPL) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(precioLata); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrecioLataExists(precioLata.IDPL)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(precioLata)); }
public async Task <IActionResult> Create([Bind("IDPL,Temporada,PrecioPL")] PrecioLata precioLata) { if (ModelState.IsValid) { _context.Add(precioLata); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(precioLata)); }