public List <Biler> GetCars() { try { DatabaseWrapper wr = new DatabaseWrapper("Data Source=01BIBME14RHJ;Initial Catalog=H2DatabaseRefreshed;Integrated Security=True"); wr.ExecuteReadQuery($"SELECT * FROM dbo.Personer"); foreach (Kunder kunde in wr.Kundeliste) { ListViewItem lvi = new ListViewItem(); lvi.SubItems.Add(kunde.returnNavn()); lvi.SubItems.Add(kunde.returnEfter()); lvi.SubItems.Add(kunde.returnTlf().ToString()); } } catch (Exception b) { } return(BilListe); }
public void ShowCarsToList() { try { DatabaseWrapper wr = new DatabaseWrapper("Data Source=01BIBME14RHJ;Initial Catalog=H2DatabaseRefreshed;Integrated Security=True"); wr.ExecuteReadQuery($"SELECT * FROM dbo.vCarLocation"); foreach (Biler bil in wr.BilListe) { ListViewItem lvi = new ListViewItem(); lvi.SubItems.Add(bil.returnVIN().ToString()); lvi.SubItems.Add(bil.returnFarve()); lvi.SubItems.Add(bil.returnMærke()); lvi.SubItems.Add(bil.returnModel().ToString()); lvi.SubItems.Add(bil.returnID().ToString()); itemsArr.Add(lvi); } } catch (Exception b) { // throw b.Message; } }
public void ShowClients() { try { DatabaseWrapper wr = new DatabaseWrapper("Data Source=01BIBME14RHJ;Initial Catalog=H2DatabaseRefreshed;Integrated Security=True"); wr.ExecuteReadQuery($"SELECT * FROM dbo.vKunder"); foreach (Kunder kunde in wr.Kundeliste) { ListViewItem lvi = new ListViewItem(); lvi.SubItems.Add(kunde.returnKundeID().ToString()); lvi.SubItems.Add(kunde.returnNavn()); lvi.SubItems.Add(kunde.returnEfter()); lvi.SubItems.Add(kunde.returnTlf().ToString()); lvi.SubItems.Add(kunde.returnCity()); lvi.SubItems.Add(kunde.returnAdresse()); itemsArr.Add(lvi); } } catch (Exception b) { // throw b.Message; } }