public ActionResult Index()
        {
            PETiano petiano = LoggedPETiano.GetLogedPETiano();

            PaymentFilter paymentFilter = new PaymentFilter()
            {
                PETianoId = petiano.Id
            };

            List<Payment> payments = _PaymentService.GetPayments(paymentFilter);
            List<Payment> paymentsStatement = _PaymentService.GetAccountStatement(paymentFilter);

            PaymentIndex pi = new PaymentIndex();
            pi.Balance = petiano.Balance;
            pi.Payments = payments;
            pi.PaymentsStatement = paymentsStatement;

            Payment credit = new Payment();
            credit.Type = EPaymentType.Credit;
            credit.Date = DateTime.Now;
            credit.PETiano = petiano;
            credit.PETianoId = petiano.Id;
            pi.NewCredit = credit;

            return View(pi);
        }
        public void UpdatePayments(string ids)
        {
            using (IDataProvider provider = base.CreateDataProvider())
            using (IPaymentRepository repository = provider.CreatePaymentRepository())
            {
                List<int> paymentsIds = ids.Split(',').Select(x => Int32.Parse(x)).ToList();
                PaymentFilter pf = new PaymentFilter()
                {
                    Ids = paymentsIds
                };
                List<Payment> payments = repository.GetPayments(pf);

                foreach (var p in payments)
                {
                    p.Status = EPaymentStatus.WaitingApproval;
                }

                repository.Update(payments);
            }
        }
 public List<Payment> GetPayments(PaymentFilter paymentFilter = null)
 {
     using (IDataProvider provider = base.CreateDataProvider())
     using (IPaymentRepository repository = provider.CreatePaymentRepository())
         return repository.GetPayments(paymentFilter);
 }
 public List<Payment> GetPayments(PaymentFilter paymentFilter = null)
 {
     using (IBusinessProvider provider = base.CreateBusinessProvider())
     using (IPaymentBusinessProvider prov = provider.CreatePaymentBusinessProvider())
         return prov.GetPayments(paymentFilter);
 }