Exemple #1
0
        public async Task <ActionResult <Barbeiro> > GetByID(int id)
        {
            var barbeiro = await _barbeiroRepo.GetByID(id);

            var servicos = await _servicosRepo.GetAll();

            var fotos = await _fotosRepo.GetByBarbeiroID(id);

            var depoimentos = await _depoimentosRepo.GetByBarbeiroID(id);

            var agenda = await _agendaRepo.GetByBarbeiroID(id);

            Barbeiro barber = new Barbeiro(
                barbeiro.IdBarbeiro,
                barbeiro.Avatar,
                barbeiro.Nome,
                barbeiro.Distancia,
                barbeiro.Latitude,
                barbeiro.Longitude,
                barbeiro.Estrelas
                );

            barber.Depoimentos = depoimentos;
            barber.Servicos    = servicos;
            barber.Fotos       = fotos;
            barber.Horarios    = agenda;



            return(barber);
        }
Exemple #2
0
        public async Task <ListarServicoResult> Execute()
        {
            var servicos = await _servicoRepository.GetAll();

            return(new ListarServicoResult {
                Servicos = _mapper.Map <IEnumerable <ServicoModel> >(servicos)
            });
        }
        public async Task <IActionResult> Index()
        {
            Usuario usuario = await _usuarioRepository.GetUsuarioByName(User);

            if (await _usuarioRepository.VerificarSeUsuarioTemRole(usuario, "Morador"))
            {
                return(View(await _servicoRepository.GetServicoByUsuario(usuario.Id)));
            }
            return(View(await _servicoRepository.GetAll()));
        }
Exemple #4
0
        // GET: Agenda/Create
        public ActionResult Create()
        {
            var cliente = clienteRepository.GetAll();
            var select  = new SelectList(cliente, "Id", "Nome");

            ViewBag.ClienteId = select;

            var servicos       = sevicoRepository.GetAll();
            var selectServices = new SelectList(servicos, "Id", "Descricao");

            ViewBag.ServicoId = selectServices;
            return(View());
        }
Exemple #5
0
 public IEnumerable <Servico> GetAll()
 {
     return(_repositorio.GetAll());
 }
 public async Task <ActionResult <IEnumerable <ServicoOutput> > > GetServicos()
 {
     return(await _servicos.GetAll().Include(x => x.TipoServico).Select(x => x.MapTo <ServicoOutput>()).ToListAsync());
 }
Exemple #7
0
        public ActionResult ObterTodos()
        {
            var item = _servicoRepository.GetAll();

            return(Ok(item));
        }