Beispiel #1
0
        // GET: Clinicas
        public ActionResult Index()
        {
            Clinica cliente = new Clinica();

            cliente = ClinicaLoginDAO.RetornarClinicaLogada();
            return(View(cliente));
        }
Beispiel #2
0
        public ActionResult Create([Bind(Include = "ConsultaId, PacienteId, DataConsulta")] Consulta consulta)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    consulta.Clinica = ClinicaLoginDAO.RetornarClinicaLogada();
                    db.Consultas.Add(consulta);
                    db.SaveChanges();
                    return(RedirectToAction("Index"));
                }
                catch (Exception e)
                {
                    return(RedirectToAction("Index"));
                }
            }

            return(View(consulta));
        }