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