// GET: Tipopertence/Edit/5
        public ActionResult Edit(int id)
        {
            ViewBag.title_page = "Tipo Pertence";
            ViewBag.path       = "Início / Tipo Pertence / Editar";

            Tipopertence      tipopertence      = _tipopertenceService.Obter(id);
            TipopertenceModel tipopertenceModel = _mapper.Map <TipopertenceModel>(tipopertence);

            IEnumerable <Organizacao> listaorganizacao = _organizacaoService.ObterTodos();

            ViewBag.idOrganizacao = new SelectList(listaorganizacao, "IdOrganizacao", "NomeFantasia", null);

            return(View(tipopertenceModel));
        }
Exemplo n.º 2
0
 public void Atualizar(Tipopertence tipoPertence)
 {
     _context.Update(tipoPertence);
     _context.SaveChanges();
 }
Exemplo n.º 3
0
 public int Inserir(Tipopertence tipoPertence)
 {
     _context.Add(tipoPertence);
     _context.SaveChanges();
     return(tipoPertence.IdTipoPertence);
 }