/// <summary>
        /// Método para exibição de pesquisa para exclusão de registro.
        /// </summary>
        /// <returns>view com registros</returns>
        public ActionResult Index2()
        {
            if (Request.Form["namePesquisa"] == null)
            {
                return(View(ctx.atendimentoes.ToList()));
            }
            else
            {
                string name                = Request.Form["namePesquisa"];
                var    paciente            = new SGPS.Models.pacienteEntities();
                var    pacienteSelecionado = (from p in paciente.pacientes
                                              where p.strNome.Contains(name)
                                              select p).First();

                var result = (from at in ctx.atendimentoes
                              where at.idPaciente == pacienteSelecionado.idPaciente
                              select at).First();
                return(View(result));
            }
        }
        /// <summary>
        /// Método para exibição de pesquisa para exclusão de registro.
        /// </summary>
        /// <returns>view com registros</returns>
        public ActionResult Index2()
        {
            if (Request.Form["namePesquisa"] == null)
                return View(ctx.atendimentoes.ToList());
            else
            {
                string name = Request.Form["namePesquisa"];
                var paciente = new SGPS.Models.pacienteEntities();
                var pacienteSelecionado = (from p in paciente.pacientes
                                           where p.strNome.Contains(name)
                                           select p).First();

                var result = (from at in ctx.atendimentoes
                              where at.idPaciente == pacienteSelecionado.idPaciente
                              select at).First();
                return View(result);
            }
        }
        //
        // GET: /Atendimento/
        /// <summary>
        /// Método que exibe um atendimento
        /// </summary>
        /// <returns>view com atendimentos</returns>
        public ActionResult Index()
        {
            var paciente = new SGPS.Models.pacienteEntities();
            string name = Request.Form["namePesquisa"];
            if (Request.Form["namePesquisa"] == null)
            {
                ViewData["SelectList"] = new SelectList(paciente.pacientes, "IdPaciente", "strNome");
                return View();
            }
            else
            {
                var pacienteSelecionado = (from p in paciente.pacientes
                                           where p.strNome.Contains(name)
                                           select p).First();

                var result = (from at in ctx.atendimentoes
                              where at.idPaciente == pacienteSelecionado.idPaciente
                              select at).First();
                return View(result);
            }
        }
Example #4
0
 //
 // GET: /Atendimento/Create
 public ActionResult Create()
 {
     SGPS.Models.pacienteEntities listaPaciente = new SGPS.Models.pacienteEntities();
     ViewData["idPaciente"] = new SelectList(listaPaciente.pacientes.ToList(), "IdPaciente", "strNome");
     return(View());
 }
Example #5
0
 //
 // GET: /Atendimento/Create
 public ActionResult Create()
 {
     SGPS.Models.pacienteEntities listaPaciente = new SGPS.Models.pacienteEntities();
     ViewData["idPaciente"] = new SelectList(listaPaciente.pacientes.ToList(), "IdPaciente", "strNome");
     return View();
 }