/// <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; }
/* 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); } }
/// <summary> /// add the child /// </summary> /// <param name="c"></param> public void AddChild(Child c) { dal.AddChild(c); }