Esempio n. 1
0
 public Lijn(int id, Remise remise, int nummer, bool conducteurRijdtMee)
 {
     Id                 = id;
     Remise             = remise;
     Nummer             = nummer;
     ConducteurRijdtMee = conducteurRijdtMee;
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 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;
 }