Example #1
0
 // deletes a child from the ds
 public void DeleteChild(uint childId)
 {
     if (DataSource.Children.Exists(x => x.Id == childId))
     {
         DataSource.Children.Remove(DataSource.Children.Find(x => x.Id == childId));
     }
     else
     {
         IdException E = new IdException
         {
             Message = "A child with this id does not exist," +
                       "please change the id number."
         };
         throw E;
     }
 }
Example #2
0
 // deletes nanny from the DS
 public void DeleteNanny(uint nannyId)
 {
     if (DataSource.Nannys.Exists(x => x.Id == nannyId))
     {
         DataSource.Nannys.Remove(DataSource.Nannys.Find(x => x.Id == nannyId));
     }
     else
     {
         IdException E = new IdException
         {
             Message = "A nanny with this id does not exist," +
                       "please change the id number."
         };
         throw E;
     }
 }
Example #3
0
 // deletes mother from the DS
 public void DeleteMother(uint motherId)
 {
     if (DataSource.Mothers.Exists(x => x.Id == motherId))
     {
         DataSource.Mothers.Remove(DataSource.Mothers.Find(x => x.Id == motherId));
     }
     else
     {
         IdException E = new IdException
         {
             Message = "A mother with this id does not exist," +
                       "please change the id number."
         };
         throw E;
     }
 }