예제 #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 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);
        }
예제 #3
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);
        }