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); } }
public void AddExpence(IExpence expence) { Expences.Add(expence); }