Exemple #1
0
        public IActionResult Create()
        {
            ViewData["Numero"]        = _ordemServicoAppService.GetLastNumber().Result + 1;
            ViewData["ConvenioId"]    = new SelectList(_convenioAppService.GetAll().Result, "Id", "Nome");
            ViewData["MedicoId"]      = new SelectList(_medicoAppService.GetAll().Result, "Id", "Nome");
            ViewData["PacienteId"]    = new SelectList(_pacienteAppService.GetAll().Result, "Id", "Nome");
            ViewData["PostoColetaId"] = new SelectList(_postoColetaAppService.GetAll().Result, "Id", "Descricao");

            return(View());
        }
        public IEnumerable <SelectListItem> listaPaciente(int idPaciente)
        {
            IEnumerable <SelectListItem> selectListPaciente =
                from c in _pacienteApp.GetAll().OrderBy(p => p.NomePaciente)
                select new SelectListItem
            {
                Selected = (c.PacienteId == idPaciente),
                Text     = c.NomePaciente,
                Value    = c.PacienteId.ToString()
            };

            return(selectListPaciente);
        }
Exemple #3
0
 // GET: Pacientes
 public ActionResult Index()
 {
     return(View(pacienteAppService.GetAll()));
 }
Exemple #4
0
 public void CarregarCombos()
 {
     ViewBag.Pacientes = pacienteAppService.GetAll();
     ViewBag.Clinicas  = clinicaAppService.GetAll();
 }
        // GET: Paciente
        public ActionResult Index(LocalizarViewModel localizar)
        {
            IEnumerable <PacienteViewModel> pacienteViewModel;

            if (Session["Usuario"] == null)
            {
                return(RedirectToAction("index", "login"));
            }


            if (!String.IsNullOrEmpty(localizar.palavra))
            {
                pacienteViewModel = Mapper.Map <IEnumerable <Paciente>, IEnumerable <PacienteViewModel> >(_pacienteApp.GetAll());

                switch (localizar.localizarPor[0])
                {
                case "Carteira":
                    pacienteViewModel = pacienteViewModel.Where(s => s.CarteirinhaPaciente.Contains(localizar.palavra));
                    break;

                case "Nome":
                    pacienteViewModel = pacienteViewModel.Where(s => s.NomePaciente.ToLower().Contains(localizar.palavra.ToLower()));
                    break;
                }
            }
            else
            {
                pacienteViewModel = new List <PacienteViewModel> {
                    new PacienteViewModel()
                };
            }

            LocalizarViewModel localizarViewModel = new LocalizarViewModel();

            localizarViewModel.localizarPor = new List <string>(new string[] { "Nome", "Carteira" });

            var tuple = new Tuple <IEnumerable <PacienteViewModel>, LocalizarViewModel>(pacienteViewModel.OrderBy(p => p.NomePaciente), localizarViewModel);

            return(View(tuple));
        }
Exemple #6
0
 public async Task <IActionResult> Paciente()
 {
     return(View(await _pacienteAppService.GetAll()));
 }
 // GET: api/Paciente
 public IEnumerable <PacienteViewModel> Get()
 {
     return(PacienteViewModel.Map(_pacienteApp.GetAll()));
 }