コード例 #1
0
ファイル: Payment.cs プロジェクト: helen-c/MoneyFox
        public void ClearPayment()
        {
            IsCleared = Date.Date <= DateTime.Today.Date;
            ChargedAccount.AddPaymentAmount(this);

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

            SourceAccount.Debit(Amount);
            TargetAccount.Credit(Amount);
        }
コード例 #3
0
ファイル: Payment.cs プロジェクト: helen-c/MoneyFox
        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();
        }