Exemple #1
0
 /// <summary>
 /// Add a child in our database
 /// </summary>
 /// <param name="c"></param>
 public void AddChild(Child c)
 {
     if ((DateTime.Now - c.Birth).TotalMilliseconds < 0)
     {
         throw new Exception("This child isn't born yet.");
     }
     dal.AddChild(c);
     c.FamilyName = GetAllMother(x => x.ID == c.MotherID).First().FamilyName;
 }
Exemple #2
0
        /* child functions */

        /// <summary>
        /// add child to child's DB
        /// </summary>
        /// <param name="child">the child to add to ChildList</param>
        /// <remarks>
        /// call dal.AddChild
        /// </remarks>
        public void AddChild(Child child)
        {
            if (FindMother(child.MotherID) == null)
            {
                throw new BLException("mother with ID: " + child.MotherID + " dosn't exsist", "Add Child");
            }
            try
            {
                dal.AddChild(child.Clone());
            }
            catch (DALException ex)
            {
                throw new BLException(ex.Message, ex.sender);
            }
        }
Exemple #3
0
 /// <summary>
 /// add the child
 /// </summary>
 /// <param name="c"></param>
 public void AddChild(Child c)
 {
     dal.AddChild(c);
 }