public ActionResult UpdateMedicoVet(MedicoVetViewModel medicoVet) { if (ModelState.IsValid) { _medicoVetApp.Update(medicoVet); return(RedirectToAction("DetailsMedicoVet", new { @id = medicoVet.MedicoVetId })); } else { ModelState.AddModelError("erro", "falha em atualizar"); return(View(ModelState)); } }
public ActionResult AddMedicoVet(MedicoVetViewModel medicoVet) { if (ModelState.IsValid) { _medicoVetApp.Add(medicoVet); return(RedirectToAction("Index")); } else { ModelState.AddModelError("erro", "falha ao criar cadastro"); return(View(ModelState)); } }
public void Update(MedicoVetViewModel obj) { var medicoVetEntt = Mapper.Map <MedicoVetViewModel, MedicoVeterinario>(obj); _medicoVet.Update(medicoVetEntt); }