public bool DeleteNanny(int inputNannyId) { Nanny tempNanny = BlTools.GetNanny(inputNannyId); if (tempNanny != null && tempNanny.IsNannyInContract()) { throw new Exception("Nanny with the same id found in contract. please delete all contracts the nanny is connected to, and then delete the child"); } return(dal.DeleteNanny(inputNannyId)); }