示例#1
0
        public Contract GetContract(int id)
        {
            DAL_XML_Imp b = new DAL_XML_Imp();

            return(b.GetContract(id));
            //return DataSource.ContractList.FirstOrDefault(n => n.Contract_ID == id);
        }
示例#2
0
        public Mother GetMother(int id)
        {
            DAL_XML_Imp a = new DAL_XML_Imp();

            return(a.GetMother(id));
            //return DataSource.MotherList.FirstOrDefault(n => n.ID == id);
        }
示例#3
0
        public Child GetChild(int id)
        {
            DAL_XML_Imp b = new DAL_XML_Imp();

            //return DataSource.ChildList.FirstOrDefault(n => n.ID == id);
            return(b.getChildList().FirstOrDefault(n => n.ID == id));
        }
示例#4
0
        public Nanny GetNanny(int id)
        {
            DAL_XML_Imp b = new DAL_XML_Imp();

            return(b.GetNanny(id));
            //return DataSource.NannyList.FirstOrDefault(n => n.ID == id);
        }
示例#5
0
        public void UpdateContract(Contract contract)
        {
            //DataSource.ContractList.RemoveAll(n => n.Contract_ID == contract.Contract_ID);
            //DataSource.ContractList.Add(contract);
            DAL_XML_Imp b = new DAL_XML_Imp();

            b.UpdateContract(contract);
        }
示例#6
0
        public void UpdateChild(Child chil)
        {
            DAL_XML_Imp b = new DAL_XML_Imp();

            b.UpdateChild(chil);
            //DataSource.ChildList.RemoveAll(n => n.ID == chil.ID);
            //DataSource.ChildList.Add(chil);
        }
示例#7
0
        public void UpdateNanny(Nanny nanny)
        {
            DAL_XML_Imp b = new DAL_XML_Imp();

            b.UpdateNanny(nanny);
            //DataSource.NannyList.RemoveAll(n => n.ID == nanny.ID);
            //DataSource.NannyList.Add(nanny);
        }
示例#8
0
        public void UpdateMother(Mother mother)
        {
            DAL_XML_Imp a = new DAL_XML_Imp();

            a.UpdateMother(mother);
            //DataSource.MotherList.RemoveAll(n => n.ID == mother.ID);
            //DataSource.MotherList.Add(mother);
        }
示例#9
0
        public IEnumerable <BE.Child> getChildList(Func <Child, bool> predicate = null)
        {
            DAL_XML_Imp b = new DAL_XML_Imp();

            if (predicate == null)
            {
                return(b.getChildList().AsEnumerable());
            }
            return(b.getChildList().Where(predicate));
        }
示例#10
0
        public IEnumerable <BE.Contract> getContractList(Func <Contract, bool> predicate = null)
        {
            DAL_XML_Imp b = new DAL_XML_Imp();

            if (predicate == null)
            {
                //return DataSource.ContractList.AsEnumerable();
                return(b.getContractList().AsEnumerable());
            }
            //return DataSource.ContractList.Where(predicate);
            return(b.getContractList().Where(predicate));
        }
示例#11
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);
        }
示例#12
0
        public void AddNanny(Nanny nanny)
        {
            DAL_XML_Imp b = new DAL_XML_Imp();
            //Nanny nann = GetNanny(nanny.ID);
            Nanny nann = b.GetNanny(nanny.ID);

            if (nann != null)
            {
                throw new Exception("Nanny with the same id already exists...");
            }
            //DataSource.NannyList.Add(nanny);
            b.AddNanny(nanny);
        }
示例#13
0
        public IEnumerable <BE.Nanny> getNannyList(Func <Nanny, bool> predicate = null)
        {
            /*if(predicate==null)
             *  return DataSource.NannyList.AsEnumerable();
             * return DataSource.NannyList.Where(predicate);*/
            DAL_XML_Imp b = new DAL_XML_Imp();

            if (predicate == null)
            {
                return(b.getNannyList().AsEnumerable());
            }
            return(b.getNannyList().Where(predicate));
        }
示例#14
0
        public void AddContract(Contract contract)
        {
            DAL_XML_Imp b = new DAL_XML_Imp();

            Contract contr = b.GetContract(contract.Contract_ID);

            if (contr != null)
            {
                throw new Exception("Contract with the same id already exists...");
            }
            b.AddContract(contract);

            //DataSource.ContractList.Add(contract);
        }
示例#15
0
        public void RemoveContract(int id)
        {
            DAL_XML_Imp b     = new DAL_XML_Imp();
            Contract    contr = b.GetContract(id);

            if (contr == null)
            {
                throw new Exception("Contract with the same id not found...");
            }
            b.RemoveContract(id);
            //DataSource.ContractList.RemoveAll(n => n.Contract_ID == id);

            //DataSource.ContractList.Remove(contr);
        }
示例#16
0
        public void AddMother(Mother mother)
        {
            DAL_XML_Imp a   = new DAL_XML_Imp();
            Mother      mom = a.GetMother(mother.ID);

            if (mom != null)
            {
                throw new Exception("Mother with the same id already exists...");
            }
            a.AddMother(mother);
            //Mother mom = GetMother(mother.ID);
            //if (mom != null)
            //    throw new Exception("Mother with the same id already exists...");
            //DataSource.MotherList.Add(mother);
        }
示例#17
0
        public void RemoveMother(int id)
        {
            DAL_XML_Imp a = new DAL_XML_Imp();

            a.RemoveMother(id);
            //Mother moth = GetMother(id);
            //if (moth == null)
            //    throw new Exception("Mother with the same id not found...");

            //DataSource.MotherList.RemoveAll(n => n.ID == id);

            //DataSource.MotherList.Remove(moth);
            //IEnumerable<Child> children = getChildList(x => x.Mother_ID == id);
            //foreach (Child child in children.ToList())
            //{
            //    RemoveChild(child.ID);
            //}
        }
示例#18
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);
            //}
        }
示例#19
0
        public void RemoveNanny(int id)
        {
            DAL_XML_Imp b = new DAL_XML_Imp();
            //Nanny nann = GetNanny(id);
            Nanny nann = b.GetNanny(id);

            if (nann == null)
            {
                throw new Exception("Nanny with the same id not found...");
            }
            b.RemoveNanny(id);
            //DataSource.NannyList.RemoveAll(n => n.ID == id);

            //DataSource.NannyList.Remove(nann);
            //IEnumerable<Contract> contractsofNanny = getContractList(x => x.Nanny_ID == id);
            //foreach (Contract contr in contractsofNanny.ToList())
            //{
            //    RemoveContract(contr.Contract_ID);
            //}
        }