Ejemplo n.º 1
0
 public void DeleteTrainee(int TraineeID)
 {
     XElement TraineeElement;
     TraineeElement = (from p in TraineeRoot.Elements()
                      where Convert.ToInt32(p.Element("TraineeID").Value) == TraineeID
                      select p).FirstOrDefault();
     if (TraineeElement == null)
         throw new Exception("Trainee doesn't exist in system");
     TraineeElement.Remove();
     TraineeRoot.Save(TraineePath);
 }
Ejemplo n.º 2
0
        public void deleteTrainee(Trainee o)
        {
            XElement TraineeElement;

            TraineeElement = (from p in TraineeRoot.Elements()
                              where Convert.ToInt32(p.Element("Identify address").Value) == o.id
                              select p).FirstOrDefault();
            if (TraineeElement == null)
            {
                throw new Exception("The Trainee doesn't exsist in the system");
            }
            TraineeElement.Remove();
            TraineeRoot.Save(TraineePath);
        }