private Sector CreateSectorFromReader(SqlDataReader reader) { Spoor s = spoorrepo.GetSpoor(Convert.ToInt16(reader["spoorid"])); try { Tram t = tramrepo.GetTram(Convert.ToInt16(reader["tramid"])); return(new Sector(Convert.ToInt32(reader["id"]), t, s, Convert.ToBoolean(reader["blokkade"]), Convert.ToBoolean(reader["beschikbaarheid"]), Convert.ToInt16(reader["rownumber"]) )); } catch { return(new Sector(Convert.ToInt32(reader["id"]), s, Convert.ToBoolean(reader["blokkade"]), Convert.ToBoolean(reader["beschikbaarheid"]), Convert.ToInt16(reader["rownumber"]) )); } }
private void btnInrijden_Click(object sender, EventArgs e) { sectorRepo.TramInrijden(tramrepo.GetTram(Convert.ToInt16(lbTramnr.Text)), spoorRepo.GetSpoor(Convert.ToInt16(lbNaarSpoor.Text)), sectorRepo.GetSector(Convert.ToInt16(lbSector.Text))); }