Beispiel #1
0
        public virtual SavingValue Withdraw(decimal value, DateTime date, string description, Budget withdrawToBudget)
        {
            SavingValue newSavingValue = new SavingValue
            {
                Saving      = this,
                Date        = date,
                Value       = -value,
                Description = description,
                Budget      = withdrawToBudget,
                Expense     = new Expense(),
            };

            newSavingValue.UpdateDescription();
            Values.Add(newSavingValue);
            return(newSavingValue);
        }
Beispiel #2
0
        public virtual SavingValue Deposit(Expense depositSource, decimal value, DateTime date, string description = null)
        {
            SavingValue newSavingValue = new SavingValue
            {
                Date        = date,
                Value       = value,
                Saving      = this,
                Description = description,
                Expense     = depositSource,
            };

            if (depositSource != null)
            {
                newSavingValue.Budget = depositSource.Budget;
                newSavingValue.UpdateDescription();
            }

            Values.Add(newSavingValue);

            return(newSavingValue);
        }
Beispiel #3
0
 public virtual SavingValue Withdraw(decimal value, DateTime date, string description, Budget withdrawToBudget)
 {
     SavingValue newSavingValue = new SavingValue
     {
         Saving      = this,
         Date        = date,
         Value       = -value,
         Description = description,
         Budget      = withdrawToBudget,
         Expense     = new Expense(),
     };
     newSavingValue.UpdateDescription();
     Values.Add(newSavingValue);
     return newSavingValue;
 }
Beispiel #4
0
        public virtual SavingValue Deposit(Expense depositSource, decimal value, DateTime date, string description = null)
        {
            SavingValue newSavingValue = new SavingValue
                            {
                                Date        = date,
                                Value       = value,
                                Saving      = this,
                                Description = description,
                                Expense     = depositSource,
                            };
            if (depositSource != null)
            {
                newSavingValue.Budget = depositSource.Budget;
                newSavingValue.UpdateDescription();
            }

            Values.Add(newSavingValue);

            return newSavingValue;
        }