private void AddTheBabies() { ThisPeriodStats.Born = CurrentBabyCount; Organisms.AddRange(Babies); LastBabyCount = CurrentBabyCount; Babies.RemoveAll(r => true); }
private void HandleBabiesChanged() { var babies = _dataService.ListBabies(); Babies.Clear(); foreach (Baby baby in babies) { Babies.Add(baby); } }
void IDataService.DeleteBaby(Baby baby) { try { Babies.DeleteOnSubmit(baby); SubmitChanges(); } catch (Exception ex) { throw ex; } }
Baby IDataService.PersistBaby(Baby baby) { try { if (baby.Id == 0) { Babies.InsertOnSubmit(baby); } SubmitChanges(); return(baby); } catch (Exception ex) { throw ex; } }
// **************** Internal functions ******************************************* /// <summary> /// Add a baby to the list of babies. The babies added to this list will become /// part of the main list once the AddBabiesToList method is called. An /// ArgumentNullException exception is raised if Baby is null. This is an internal /// method that may only be called by classes in the Rabies_Model_Core namespace. /// </summary> /// <param name="Baby">The new baby animal to add to the list.</param> internal void AddBaby(cAnimal Baby) { Babies.Add(Baby); }
public void AddBaby(Organism baby) { Babies.Add(baby); }