public void DeleteTester(int TesterID) { XElement TesterElement; TesterElement = (from p in TesterRoot.Elements() where Convert.ToInt32(p.Element("TesterID").Value) == TesterID select p).FirstOrDefault(); if (TesterElement == null) throw new Exception("The dish dos'nt exsist in the system"); TesterElement.Remove(); TesterRoot.Save(TesterPath); }
public void deleteTester(Tester o) { XElement TesterElement; TesterElement = (from p in TesterRoot.Elements() where Convert.ToInt32(p.Element("Identify address").Value) == o.id select p).FirstOrDefault(); if (TesterElement == null) { throw new Exception("The Tester doesn't exsist in the system"); } TesterElement.Remove(); TesterRoot.Save(TesterPath); }