Beispiel #1
0
 // GET api/deposit
 public IHttpActionResult Get(int?page = null)
 {
     try
     {
         const int pageSize   = 10;
         var       pageNumber = page ?? 1;
         var       result     = Mapper.Map <CustomPagedList <ShortDeposit> >(_depositService.GetAll(pageNumber, pageSize));
         return(Ok(result));
     }
     catch (BankClientException ex)
     {
         return(BadRequest(ex.Message));
     }
     catch (Exception ex)
     {
         return(InternalServerError(ex));
     }
 }
Beispiel #2
0
        public ActionResult Index(DepositListFiltersModel filters)
        {
            int pageTotal;

            var deposits = _depositService.GetAll("CreatedDate", "DESC", filters.Criteria, filters.Page, DefaultPageSize, out pageTotal);

            var pagedList = new StaticPagedList <DepositDto>(deposits, filters.Page, DefaultPageSize, pageTotal);

            var listModel = new DepositListModel(pagedList, filters);

            return(View(listModel));
        }