//[HttpPost]
        public ActionResult Report(LocalizarViewModel localizar)
        {
            var pacienteViewModel = Mapper.Map <IEnumerable <Paciente>, IEnumerable <PacienteViewModel> >(_pacienteApp.GetAll());

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

                case "Nome":
                    pacienteViewModel = pacienteViewModel.Where(s => s.NomePaciente.Contains(localizar.palavra));
                    break;
                }
            }

            var viewer = new Microsoft.Reporting.WebForms.ReportViewer();

            viewer.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
            viewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"..\ProjetoModeloDDD.Infra.Data\Reports\Pacientes.rdlc";

            viewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("PacienteDataSet", pacienteViewModel));

            viewer.SizeToReportContent = true;
            viewer.Width  = System.Web.UI.WebControls.Unit.Percentage(10);
            viewer.Height = System.Web.UI.WebControls.Unit.Percentage(10);

            ViewBag.ReportViewer = viewer;

            return(View());
        }
        // 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));
        }