public List <Activity> GetActivities() { try { List <Activity> activities = activity_db.Db_Get_All_Activity(); return(activities); } catch (Exception) { throw new Exception("Someren couldn't connect to the database"); } }
public List <Activity> GetActivities() { try { List <Activity> activity = activity_db.Db_Get_All_Activity(); return(activity); } catch (Exception) { // something went wrong connecting to the database, so we will add a fake student to the list to make sure the rest of the application continues working! List <Activity> activities = new List <Activity>(); Activity a = new Activity(); a.Id = 00; a.Description = "oepsie"; a.AantalStudenten = 0; a.AantalBegeleider = 0; activities.Add(a); return(activities); //throw new Exception("Someren couldn't connect to the database"); } }