public object GetBankAccounts(SearchPackage searchPackage)
        {
            var dataBuilder = new SearchPackageDataBuilder <BankAccount>(searchPackage,
                                                                         _paymentQueries.GetBankAccounts()
                                                                         .Where(x => x.Status == BankAccountStatus.Active)
                                                                         );

            dataBuilder
            .SetFilterRule(x => x.PaymentLevels, (value) => ba => (value == null) || ba.PaymentLevels.Any(x => x.Id == new Guid(value)))
            .SetFilterRule(x => x.Bank.Brand, (value) => x => x.Bank.Brand.Id == new Guid(value))
            .SetFilterRule(x => x.CurrencyCode, (value) => c => c.CurrencyCode == value)
            .Map(account => account.Id,
                 account =>
                 new[]
            {
                account.AccountId,
                account.Bank.BankName,
                account.Branch,
                account.AccountName,
                account.AccountNumber,
                account.InternetSameBank.ToString(),
                account.AtmSameBank.ToString(),
                account.CounterDepositSameBank.ToString(),
                account.InternetDifferentBank.ToString(),
                account.AtmDifferentBank.ToString(),
                account.CounterDepositDifferentBank.ToString()
            }
                 );
            var data = dataBuilder.GetPageData(account => account.AccountId);

            return(new JsonResult {
                Data = data, MaxJsonLength = int.MaxValue, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
 public object GetBankAccounts(Guid brandId, string currencyCode)
 {
     return(_paymentQueries.GetBankAccounts(brandId, currencyCode)
            .Select(x => new
     {
         x.Id,
         Name = string.Format("Offline - {0}", x.AccountId)
     }));
 }
Example #3
0
 public ActionResult List()
 {
     return(Json(_paymentQueries.GetBankAccounts(), JsonRequestBehavior.AllowGet));
 }