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); }
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); }
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)); }
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); }
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); }
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); }
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); }
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); }
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)); }
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)); }
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); }
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); }
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)); }
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); }
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); }
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); }
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); //} }
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); //} }
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); //} }