public void deleteSpecialization(Specialization s) { var em = dal.GetAllEmployee(); foreach (var item in em) { if (item.SpecializationNumber == s.number) { throw new Exception("You can't delete the specialization.\n Because there is an employee realted to it!!!"); } } try { dal.deleteSpecialization(s); } catch (InvalidCastException e) { throw e; } }
public List <Employee> GetAllEmployee() { return(dal.GetAllEmployee()); }