public async Task <IActionResult> Search(bool isFraud, string searchNameDest)
 {
     return(Ok(await _transactionsService.Find(new TransactionsSearchCriteria()
     {
         IsFraud = isFraud,
         SearchNameDest = searchNameDest
     }, 1, 100)));
 }
Example #2
0
        public async Task <IActionResult> Index(bool?isFraud, string searchNameDest)
        {
            ViewBag.isFraud        = isFraud;
            ViewBag.searchNameDest = searchNameDest;
            IPagedList <Transaction> viewModel = null;

            if ((isFraud.HasValue || !string.IsNullOrEmpty(searchNameDest)) && (User.IsAssistant() || User.IsAdministrator()))
            {
                viewModel = await _transactionsService.Find(new TransactionsSearchCriteria()
                {
                    IsFraud        = isFraud,
                    SearchNameDest = searchNameDest
                }, 1, 100);
            }
            else
            {
                viewModel = await _transactionsService.Paginate(1, 100);
            }

            return(View(viewModel));
        }