public ActionResult Create(Medico medico) { try { if (!ModelState.IsValid) { return(View()); } medico.AddMedico(medico); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult CriarMedico(Medico medico) { if (!Request.IsAuthenticated) { return(RedirectToAction("Login", "Account")); } try { if (!ModelState.IsValid) { return(View()); } medico.AddMedico(medico); return(RedirectToAction("Medicos")); } catch { return(View()); } }