public async Task <IActionResult> Edit(int id, [Bind("TipoBodegaId,Detalle")] TipoBodega tipoBodega) { if (id != tipoBodega.TipoBodegaId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tipoBodega); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TipoBodegaExists(tipoBodega.TipoBodegaId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tipoBodega)); }
public async Task <IActionResult> Create([Bind("TipoBodegaId,Detalle")] TipoBodega tipoBodega) { if (ModelState.IsValid) { _context.Add(tipoBodega); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tipoBodega)); }