Example #1
0
        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());
            }
        }
Example #2
0
        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
            });
        }
Example #3
0
        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()));
 }
Example #7
0
 public IEnumerable <Clientes> GetAll()
 {
     return(_userRepository.GetAll());
 }