Example #1
0
        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));
        }
Example #2
0
        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));
        }