예제 #1
0
        public void AddChild(Child child)
        {
            DAL_XML_Imp b    = new DAL_XML_Imp();
            Child       chil = b.GetChild(child.ID);

            if (chil != null)
            {
                throw new Exception("Child with the same id already exists...");
            }
            //b.getChildList().Add(child);
            b.AddChild(child);
        }
예제 #2
0
        public void RemoveChild(int id)
        {
            DAL_XML_Imp b    = new DAL_XML_Imp();
            Child       chil = b.GetChild(id);

            if (chil == null)
            {
                throw new Exception("Child with the same id not found...");
            }
            b.RemoveChild(id);
            //DataSource.ChildList.RemoveAll(n => n.ID == id);

            //DataSource.ChildList.Remove(chil);
            //IEnumerable<Contract> contractsofChild = getContractList(x => x.Child_ID == id);
            //foreach (Contract contr in contractsofChild.ToList())
            //{
            //    RemoveContract(contr.Contract_ID);
            //}
        }