예제 #1
0
 /// <summary>
 /// Herd change occurred
 /// </summary>
 /// <param name="e"></param>
 protected virtual void HerdChanged(HerdChangedEventArgs e)
 {
     if (OnHerdChanged != null)
     {
         OnHerdChanged(this, e);
     }
 }
예제 #2
0
 /// <summary>
 /// Add individual/cohort to the the herd
 /// </summary>
 /// <param name="ind">Individual Ruminant to add</param>
 public void AddRuminant(Ruminant ind)
 {
     if (ind.ID == 0)
     {
         ind.ID = this.NextUniqueID;
     }
     Herd.Add(ind);
     LastIndividualChanged = ind;
     HerdChangedEventArgs args = new HerdChangedEventArgs();
     args.Details = ind;
     HerdChanged(args);
     // remove change flag
     ind.SaleFlag = Common.HerdChangeReason.None;
 }
예제 #3
0
        /// <summary>
        /// Add individual/cohort to the the herd
        /// </summary>
        /// <param name="ind">Individual Ruminant to add</param>
        public void AddRuminant(Ruminant ind)
        {
            if (ind.ID == 0)
            {
                ind.ID = this.NextUniqueID;
            }
            Herd.Add(ind);
            LastIndividualChanged = ind;
            HerdChangedEventArgs args = new HerdChangedEventArgs();

            args.Details = ind;
            HerdChanged(args);
            // remove change flag
            ind.SaleFlag = Common.HerdChangeReason.None;
        }
예제 #4
0
        /// <summary>
        /// Remove individual/cohort from the herd
        /// </summary>
        /// <param name="ind">Individual Ruminant to remove</param>
        public void RemoveRuminant(Ruminant ind)
        {
            // Remove mother ID from any suckling offspring
            if (ind.Gender == Sex.Female)
            {
                foreach (var offspring in (ind as RuminantFemale).SucklingOffspring)
                {
                    offspring.Mother = null;
                }
            }
            Herd.Remove(ind);
            LastIndividualChanged = ind;
            HerdChangedEventArgs args = new HerdChangedEventArgs();

            args.Details = ind;
            HerdChanged(args);
            // remove change flag
            ind.SaleFlag = Common.HerdChangeReason.None;
        }
예제 #5
0
 /// <summary>
 /// Remove individual/cohort from the herd
 /// </summary>
 /// <param name="ind">Individual Ruminant to remove</param>
 public void RemoveRuminant(Ruminant ind)
 {
     // Remove mother ID from any suckling offspring
     if (ind.Gender == Sex.Female)
     {
         foreach (var offspring in (ind as RuminantFemale).SucklingOffspring)
         {
             offspring.Mother = null;
         }
     }
     Herd.Remove(ind);
     LastIndividualChanged = ind;
     HerdChangedEventArgs args = new HerdChangedEventArgs();
     args.Details = ind;
     HerdChanged(args);
     // remove change flag
     ind.SaleFlag = Common.HerdChangeReason.None;
 }
예제 #6
0
 /// <summary>
 /// Herd change occurred 
 /// </summary>
 /// <param name="e"></param>
 protected virtual void HerdChanged(HerdChangedEventArgs e)
 {
     if (OnHerdChanged != null)
         OnHerdChanged(this, e);
 }