public async Task <IActionResult> Edit(string id, [Bind("ProgressaoCode,NomeProgressao,Iso5")] ProgressaoCarreira progressaoCarreira) { if (id != progressaoCarreira.ProgressaoCode) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(progressaoCarreira); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProgressaoCarreiraExists(progressaoCarreira.ProgressaoCode)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["Iso5"] = new SelectList(_context.Carreiras, "Iso5", "Iso5", progressaoCarreira.Iso5); return(View(progressaoCarreira)); }
public async Task <IActionResult> Create([Bind("ProgressaoCode,NomeProgressao,Iso5")] ProgressaoCarreira progressaoCarreira) { if (ModelState.IsValid) { _context.Add(progressaoCarreira); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Iso5"] = new SelectList(_context.Carreiras, "Iso5", "Iso5", progressaoCarreira.Iso5); return(View(progressaoCarreira)); }