public static void GetHulpBehoevende() { Connect(); ReadData("SELECT * FROM ACCOUNT WHERE DISCRIMINATOR = 'H'"); try { while (dr.Read()) { int id; string firstName; string lastName; id = Convert.ToInt32(dr.GetValue(0)); firstName = dr.GetString(8); lastName = dr.GetString(9); AccountHandler accounthandler = new AccountHandler(); HelpBehoevende helpbehoevende = new HelpBehoevende(id, firstName, lastName); accounthandler.AddHelpbehoevende(helpbehoevende); } } catch (InvalidCastException ex) { MessageBox.Show(ex.ToString()); } finally { Disconnect(); } }
public static void GetVrijwilliger() { Connect(); ReadData("SELECT * FROM ACCOUNT WHERE DISCRIMINATOR = 'V'"); try { while (dr.Read()) { int id; string firstName; string lastName; id = dr.GetInt32(0); firstName = dr.GetString(8); lastName = dr.GetString(9); AccountHandler accounthandler = new AccountHandler(); Vrijwilliger vrijwilliger = new Vrijwilliger(id, firstName, lastName); accounthandler.AddVrijwilliger(vrijwilliger); } } catch (InvalidCastException ex) { MessageBox.Show(ex.ToString()); } finally { Disconnect(); } }