public List <string> TodoToday() { List <string> returnList = new List <string>(); if (caretakingLogic.CalcDateWhenNoFoodLeft() <= DateTime.Today.AddDays(3)) { returnList.Add($"WAARSCHUWING: Er is nog maar eten genoeg voor {(caretakingLogic.CalcDateWhenNoFoodLeft() - DateTime.Today).Days} dag(en)!"); } foreach (Animal animal in animalLogic.GetAllAnimals()) { if (caretakingLogic.GetFeedingDate(animal) <= DateTime.Today.AddDays(-1)) { returnList.Add($"Geef {animal.name} eten. (Laatst gevoerd op {caretakingLogic.GetFeedingDate(animal).ToShortDateString()})"); } if (animal.species == Animal.Species.Dog && caretakingLogic.GetWalkingDate(animal) <= DateTime.Today.AddDays(-1)) { returnList.Add($"Laat {animal.name} uit. (Laatst uitgelaten op {caretakingLogic.GetWalkingDate(animal).ToShortDateString()})"); } } foreach (Cage cage in caretakingLogic.GetAllCages()) { if (cage.lastCleaningdate <= DateTime.Today.AddDays(-7)) { returnList.Add($"Maak hok {cage.cageNumber} schoon. (Laatst schoon gemaakt op {cage.lastCleaningdate.ToShortDateString()})"); } } return(returnList); }
/// <summary> /// Event that triggers when another item in the listbox is clicked/focused. /// Shows the information of the chosen item. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LbFeedingAnimals_SelectedIndexChanged(object sender, EventArgs e) { DtpLastFeedingDate.Value = caretakingLogic.GetFeedingDate(animalLogic.GetAnimalFromList(LbFeedingAnimals.SelectedIndex)); }