public ActionResult EditarContatos(int id) { var dados = AgendaContatosService.GetById(id); var saida = new ListaContatosViewModel(dados); return(View(saida)); }
public ActionResult CadastrarContatos(ListaContatosViewModel Itens) { try { Itens.Status = true; AgendaContatosService.Add(Itens.ToDomain()); return(RedirectToAction("Index", "Home")); } catch (Exception ex) { return(RedirectToAction("Index", "Home")); } }
public ActionResult BuscarContatos() { var saida = new List <ListaContatosViewModel>(); var listagemContatos = AgendaContatosService.GetAll(); foreach (var item in listagemContatos) { var registro = new ListaContatosViewModel(item); saida.Add(registro); } return(View("_Lista", saida)); }
public ActionResult EditarContatos(ListaContatosViewModel Itens) { try { Itens.Status = true; AgendaContatosService.Update(Itens.ToDomain()); return(RedirectToAction("Index", "Home")); } catch { return(RedirectToAction("Index", "Home")); } }