public async Task <IActionResult> Edit(int id, [Bind("Id,PessoaId,ProfissaoId")] ProfissaoPessoa profissaoPessoa) { if (id != profissaoPessoa.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(profissaoPessoa); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProfissaoPessoaExists(profissaoPessoa.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["PessoaId"] = new SelectList(_context.Pessoa, "PessoaId", "Nome", profissaoPessoa.PessoaId); ViewData["ProfissaoId"] = new SelectList(_context.Profissao, "ProfissaoId", "CBO", profissaoPessoa.ProfissaoId); return(View(profissaoPessoa)); }
public async Task <IActionResult> Create([Bind("Id,PessoaId,ProfissaoId")] ProfissaoPessoa profissaoPessoa) { if (ModelState.IsValid) { _context.Add(profissaoPessoa); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["PessoaId"] = new SelectList(_context.Pessoa, "PessoaId", "Nome", profissaoPessoa.PessoaId); ViewData["ProfissaoId"] = new SelectList(_context.Profissao, "ProfissaoId", "CBO", profissaoPessoa.ProfissaoId); return(View(profissaoPessoa)); }
public void Atualizar(ProfissaoPessoa Objeto) { _IProfissaoPessoa.Atualizar(Objeto); }
public void Excluir(ProfissaoPessoa Objeto) { _IProfissaoPessoa.Excluir(Objeto); }
public void Adicionar(ProfissaoPessoa Objeto) { _IProfissaoPessoa.Adicionar(Objeto); }