예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nome,NumeroWhats,Linkedin,Local,Estado,Portifolio,HorarioManha,HorarioNoite,HorarioMadrugada,HorarioTarde,HorarioComercial,Salario")] InfoProgramador infoProgramador)
        {
            if (id != infoProgramador.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(infoProgramador);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InfoProgramadorExists(infoProgramador.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(infoProgramador));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,Nome,NumeroWhats,Linkedin,Local,Estado,Portifolio,HorarioManha,HorarioNoite,HorarioMadrugada,HorarioTarde,HorarioComercial,Salario")] InfoProgramador infoProgramador)
        {
            if (ModelState.IsValid)
            {
                _context.Add(infoProgramador);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(infoProgramador));
        }