Exemplo n.º 1
0
        public Lender GetMostHighestLender()
        {
            var    allLoans  = _reportsRepository.GetAll();
            Loan   maxLoan   = allLoans.MaxBy(loan => loan.LoanBalance).FirstOrDefault();
            Lender maxLender = new Lender()
            {
                Name    = "",
                Balance = 0
            };

            if (maxLoan != null)
            {
                maxLender         = _lenderRepository.GetById(maxLoan.LenderId);
                maxLender.Balance = maxLoan.LoanBalance;
            }


            return(maxLender);
        }
        public IActionResult GetAll([FromQuery] Helpers.Pager query)
        {
            var pager = _mapper.Map <Domain.Helpers.Pager>(query);

            var records = _reportsRepository.GetAll(pager);

            var items = _mapper.Map <List <Models.ReportsView.Reports> >(records);

            var result = new Models.ReportsView
            {
                Items      = items,
                TotalItems = pager.TotalItems
            };

            return(Ok(result));
        }
Exemplo n.º 3
0
 public List <tblReport> GetAll()
 {
     return(_reportsRepository.GetAll());
 }
Exemplo n.º 4
0
 public IEnumerable <UserReport> GetAll(DateTime dateFrom, DateTime dateTo)
 {
     return(_reportsRepository.GetAll(dateFrom, dateTo));
 }
Exemplo n.º 5
0
        public IHttpActionResult GetAll()
        {
            IEnumerable <Report> reports = _reportsRepository.GetAll();

            return(Ok(reports.Select(r => r.MapToViewModel())));
        }