public Lijn(int id, Remise remise, int nummer, bool conducteurRijdtMee) { Id = id; Remise = remise; Nummer = nummer; ConducteurRijdtMee = conducteurRijdtMee; }
public Spoor(int id, Remise remise, int nummer, int lengte, bool beschikbaar, bool inUitRijSpoor, List <Sector> sectorList) { this.Id = id; this.Remise = remise; this.Nummer = nummer; this.Lengte = lengte; this.Beschikbaar = beschikbaar; this.InUitRijSpoor = inUitRijSpoor; this.SectorList = sectorList; }
public static List <Tram> LaadTrams() { List <Tram> trams = new List <Tram>(); try { connection.Open(); OracleCommand command = new OracleCommand("SELECT * FROM TRAM"); command.CommandType = CommandType.Text; command.Connection = connection; OracleDataReader reader = command.ExecuteReader(); if (!reader.HasRows) { return(trams); } else { while (reader.Read()) { int id = Convert.ToInt32(reader["ID"]); Tramtype tramtype = (Tramtype)Convert.ToInt32(reader["Tramtype_ID"]) - 1; int nummer = Convert.ToInt32(reader["Nummer"]); int lengte = Convert.ToInt32(reader["Lengte"]); string status = Convert.ToString(reader["Status"]); Remise remise = RemiseManager.remiseViaId(Convert.ToInt32(reader["Remise_ID_Standplaats"])); bool vervuild = convertBool(Convert.ToString(reader["Vervuild"])); bool defect = convertBool(Convert.ToString(reader["Defect"])); bool conducteurGeschikt = convertBool(Convert.ToString(reader["ConducteurGeschikt"])); bool beschikbaar = convertBool(Convert.ToString(reader["Beschikbaar"])); trams.Add(new Tram(id, tramtype, nummer, lengte, status, remise, vervuild, defect, conducteurGeschikt, beschikbaar)); } } } catch (Exception) { throw; } finally { connection.Close(); } return(trams); }
public static List <Spoor> LaadSporen() { List <Spoor> sporen = new List <Spoor>(); try { if (connection.State != ConnectionState.Open) { connection.Open(); } OracleCommand command = new OracleCommand("SELECT * FROM SPOOR"); command.CommandType = CommandType.Text; command.Connection = connection; OracleDataReader reader = command.ExecuteReader(); if (!reader.HasRows) { return(sporen); } else { while (reader.Read()) { int id = Convert.ToInt32(reader["ID"]); Remise remise = RemiseManager.remiseViaId(Convert.ToInt32(reader["Remise_ID"])); int nummer = Convert.ToInt32(reader["Nummer"]); int lengte = Convert.ToInt32(reader["Lengte"]); bool beschikbaar = convertBool(Convert.ToString(reader["Beschikbaar"])); bool inUitrijSpoor = convertBool(Convert.ToString(reader["InUitRijspoor"])); sporen.Add(new Spoor(id, remise, nummer, lengte, beschikbaar, inUitrijSpoor, RemiseManager.sectorenVanSpoor(id))); } } } catch (Exception) { throw; } finally { connection.Close(); } return(sporen); }
public Tram(int id, Tramtype tramtype, int nummer, int lengte, string status, Remise remise, bool vervuild, bool defect, bool conducteurGeschikt, bool beschikbaar) { this.Id = id; this.tramtype = tramtype; this.nummer = nummer; this.lengte = lengte; this.status = status; this.remise = remise; this.vervuild = vervuild; this.defect = defect; this.conducteurGeschikt = conducteurGeschikt; this.beschikbaar = beschikbaar; }