예제 #1
0
파일: Budget.cs 프로젝트: 3normt/Budget
        public void AddExpenceRange(string title, decimal amount, DateTime dateFirstIncome, DateTime dateLastIncome)
        {
            // add first income
            Expences.Add(new Expence
            {
                Amount = amount,
                Date   = dateFirstIncome,
                Title  = title
            });

            // add last income
            Expences.Add(new Expence
            {
                Amount = amount,
                Date   = dateLastIncome,
                Title  = title
            });

            // add income inbetween
            var startDate = dateFirstIncome.AddMonths(1);

            while (startDate < dateLastIncome)
            {
                Expences.Add(new Expence
                {
                    Amount = amount,
                    Date   = startDate,
                    Title  = title
                });
                startDate = startDate.AddMonths(1);
            }
        }
예제 #2
0
파일: Budget.cs 프로젝트: 3normt/Budget
 public void AddExpence(IExpence expence)
 {
     Expences.Add(expence);
 }