コード例 #1
0
        // GET: Consulta/Details/5
        public ActionResult Details(int id)
        {
            var profissional = _profissionalApp.GetById(id);
            var taxasExtra   = _taxaExtraProfissionalAppService.GetAll();

            var profissionalViewModel          = Mapper.Map <Profissional, ProfissionalViewModel>(profissional);
            var taxaEstraProfissionalViewModel = Mapper.Map <IEnumerable <TaxaExtraProfissional>, IEnumerable <TaxaExtraProfissionalViewModel> >(taxasExtra.Where(t => t.ProfissionalId == profissional.ProfissionalId));

            var tuple = new Tuple <ProfissionalViewModel, IEnumerable <TaxaExtraProfissionalViewModel> >(profissionalViewModel, taxaEstraProfissionalViewModel);

            return(View(tuple));
        }
コード例 #2
0
        // GET: Consulta
        public ActionResult Index(string palavra, int?LocalizarPor)
        {
            if (Session["Usuario"] == null)
            {
                return(RedirectToAction("index", "login"));
            }

            var taxaExtraProfissionalViewModel = Mapper.Map <IEnumerable <TaxaExtraProfissional>, IEnumerable <TaxaExtraProfissionalViewModel> >(_taxaExtraprofissionalAppService.GetAll());

            //int idLocalizacao = LocalizarPor.GetValueOrDefault();

            //if (!String.IsNullOrEmpty(palavra))
            //{
            //    switch (idLocalizacao)
            //    {
            //        case 1:
            //            profissionalViewModel = profissionalViewModel.Where(s => s.Cpf.Contains(palavra));
            //            break;
            //        case 2:
            //            profissionalViewModel = profissionalViewModel.Where(s => s.NomeProfissional.Contains(palavra));
            //            break;
            //    }

            //}

            return(View(taxaExtraProfissionalViewModel));
        }