예제 #1
0
        private void AddTheBabies()
        {
            ThisPeriodStats.Born = CurrentBabyCount;

            Organisms.AddRange(Babies);
            LastBabyCount = CurrentBabyCount;
            Babies.RemoveAll(r => true);
        }
예제 #2
0
        private void HandleBabiesChanged()
        {
            var babies = _dataService.ListBabies();

            Babies.Clear();
            foreach (Baby baby in babies)
            {
                Babies.Add(baby);
            }
        }
예제 #3
0
 void IDataService.DeleteBaby(Baby baby)
 {
     try
     {
         Babies.DeleteOnSubmit(baby);
         SubmitChanges();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #4
0
        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);
 }
예제 #6
0
 public void AddBaby(Organism baby)
 {
     Babies.Add(baby);
 }