/// <summary> /// This method adds the given Income object in the end of the List. /// </summary> /// <param name="task"></param> public void Add(Income income) { incomeList.Add(income); incomeList.Sort((x, y) => x.Date.CompareTo(y.Date)); }
/// <summary> /// This method changes the Income object with a new one. /// </summary> /// <param name="index"></param> /// <param name="newIncome"></param> public void Edit(int index, Income newIncome) { incomeList[index] = newIncome; incomeList.Sort((x, y) => x.Date.CompareTo(y.Date)); }