public async Task <IActionResult> Obter() { try { var data = await clientesRepository.GetAll(); if (data == null) { var resultNotFound = new { code = 20000, data = new {} }; return(Ok(resultNotFound)); } else { var result = new { code = 20000, data }; return(Ok(result)); } } catch (Exception ex) { return(BadRequest()); } }
public KpiClientes ObtenerKpiDeClientes() { var edades = _clientesRepository.GetAll().ToList().Select(x => x.Edad); var media = GetMedia(edades); var cuadradoDistancia = GetSumaCuadradoDeDistacia(edades, media); var division = cuadradoDistancia / edades.Count(); var desvioEstandar = Math.Sqrt(division); return(new KpiClientes() { PromedioEdad = media, DesvioEstandar = desvioEstandar }); }
public IEnumerable <ClientesViewModel> GetAll() { var loggedClient = GetClienteByIdUsuario(); IEnumerable <Clientes> data = null; if (loggedClient != null) { var models = _rep.GetAll(); data = models.Where(t => t.Id == loggedClient.Id); } else { data = _rep.GetAll(); } var result = Mapper.Map <IEnumerable <ClientesViewModel> >(data); return(result); }
public IActionResult Create() { ViewBag.clientes = _repositoryCliente.GetAll(); ViewBag.situacoes = _repositorySituacoes.GetAll(); return(View()); }
public IActionResult Index() { var clientes = _repository.GetAll(); return(View(clientes)); }
// GET: Clientes public async Task <ActionResult> Index() { return(View(await repositorio.GetAll())); }
public IEnumerable <Clientes> GetAll() { return(_userRepository.GetAll()); }