示例#1
0
        public void ClearPayment()
        {
            IsCleared = Date.Date <= DateTime.Today.Date;
            ChargedAccount.AddPaymentAmount(this);

            if (Type == PaymentType.Transfer)
            {
                TargetAccount.AddPaymentAmount(this);
            }
        }
        public void Transference()
        {
            if (SourceAccount.Balance < Amount)
            {
                AddNotification(new Notification("", "Saldo insuficiente"));
                return;
            }

            SourceAccount.Debit(Amount);
            TargetAccount.Credit(Amount);
        }
示例#3
0
        public void UpdatePayment(DateTime date,
                                  decimal amount,
                                  PaymentType type,
                                  Account chargedAccount,
                                  Account targetAccount = null,
                                  Category category     = null,
                                  string note           = "")
        {
            ChargedAccount.RemovePaymentAmount(this);
            TargetAccount?.RemovePaymentAmount(this);

            AssignValues(date, amount, type, chargedAccount, targetAccount, category, note);

            ClearPayment();
        }