public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Descripcion,Ingredientes,Imagen,Precio")] Postres postres) { if (id != postres.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(postres); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PostresExists(postres.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(postres)); }
private void labelPostres_Click(object sender, EventArgs e) { Postres P = new Postres(); P.ShowDialog(); Agregaralista(P.Po); }
public async Task <IActionResult> Create([Bind("Id,Nombre,Descripcion,Ingredientes,Imagen,Precio")] Postres postres) { if (ModelState.IsValid) { _context.Add(postres); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(postres)); }