Esempio n. 1
0
    public Store(string fname, string cachedir)
    {
        updates = new ArrayList ();
        newchans = new ArrayList ();
        connection = new SqliteConnection ("URI=file:" + fname);
        connection.Open ();

        IDbCommand dbcmd = connection.CreateCommand ();
        // setting encoding only works on sqlite3
        //dbcmd.CommandText = "PRAGMA encoding = \"UTF-8\";";
        //if (dbcmd.ExecuteNonQuery () != 0) {
        //	throw new Exception ("Couldn't set encoding");
        //}
        string sql = "PRAGMA table_info(channel)";
        dbcmd = connection.CreateCommand ();
        dbcmd.CommandText = sql;
        try {
            IDataReader result = dbcmd.ExecuteReader ();
         			if (!result.Read ()) {
         				// schema doesn't exist.
         				System.Console.WriteLine ("Creating new database schema");
         				CreateSchema ();
            }
            result.Close ();
        } catch (Exception e) {
            // TODO: catch further exceptions here.
            System.Console.WriteLine ("Error executing reader: {0}", e.ToString ());
        }
        _cachedir = cachedir;
        InitializeCache ();
        // TODO: catch problems making the cache dir
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {

        //E:\Etude\Projet\Projet_4e_semestre\GITHUB\New_Unity_Project\Assets


        const string connectionString = "URI=file:E://Etude/Projet/Projet_4e_semestre/GITHUB/New_Unity_Project/Assets/testbdd.s3db";
        IDbConnection dbcon = new SqliteConnection(connectionString);
        IDbCommand dbcmd = dbcon.CreateCommand();
        try
        {
            dbcon.Open();

            const string sql = "select nomcarte from carte";
            dbcmd.CommandText = sql;
            IDataReader reader = dbcmd.ExecuteReader();
            while (reader.Read())
            {
                string NomCarte = reader.GetString(0);
                Debug.Log("Carte: " + NomCarte + "\n");
            }
            reader.Dispose();

        }
        catch (Exception ex)
        {
            Debug.Log(ex.Message);
        }
        dbcmd.Dispose();
        dbcon.Close();

    }
Esempio n. 3
0
    // Use this for initialization
    void Start () {
        const string connectionString = "URI=file:E://Etude/Projet/Projet_4e_semestre/GITHUB/New_Unity_Project/Assets/testbdd.s3db";
        IDbConnection dbcon = new SqliteConnection(connectionString);
        IDbCommand dbcmd = dbcon.CreateCommand();
        try
        {
            dbcon.Open();

            const string sql = "SELECT DISTINCT nomcarte, puisscrea, vitcrea, typecrea, pvcrea, nomatk, dommatk, vitatk FROM carte INNER JOIN creature ON creature.IDCARTE = carte.IDCARTE INNER JOIN j_crea_atk On j_crea_atk.IDCREA = creature.IDCARTE INNER JOIN atk On atk.IDATK = j_crea_atk.IDATK WHERE carte.IDCARTE = '1' AND atk.IDATK='1'";
            dbcmd.CommandText = sql;
            IDataReader reader = dbcmd.ExecuteReader();
            while (reader.Read())
            {
                IDCARTE = reader.GetInt32(0);
            }
            reader.Dispose();

        }
        catch (Exception ex)
        {
            Debug.Log(ex.Message);
        }
        dbcmd.Dispose();
        dbcon.Close();
    }
Esempio n. 4
0
    public void init(int idcarte, string numserie, int idatk, int idatk2)
    {
        this.idcarte = idcarte;
        this.numserie = numserie;

        xdeck = this.transform.position.x;
        ydeck = this.transform.position.y;
        zdeck = this.transform.position.z;
        ObservJ1 = false;
        ObservJ2 = false;

        mettredsdeck = false;

        const string connectionString = "URI=file:E://Etude/Projet/Projet_4e_semestre/GITHUB/New_Unity_Project/Assets/testbdd.s3db";

        IDbConnection dbcon = new SqliteConnection(connectionString);
        IDbCommand dbcmd = dbcon.CreateCommand();
        try
        {
            dbcon.Open();

            string sql = "SELECT DISTINCT nomcarte, puisscrea, vitcrea, typecrea, pvcrea, nomatk, dommatk, vitatk FROM carte INNER JOIN creature ON creature.IDCARTE = carte.IDCARTE INNER JOIN j_crea_atk On j_crea_atk.IDCREA = creature.IDCARTE INNER JOIN atk On atk.IDATK = j_crea_atk.IDATK WHERE carte.NUMSERIE = '" + this.numserie + "' AND atk.IDATK=" + this.idatk + "";

            dbcmd.CommandText = sql;
            IDataReader reader = dbcmd.ExecuteReader();
            while (reader.Read())
            {
                NomCarte = reader.GetString(0);
                puisscrea = reader.GetInt32(1);
                vitcrea = reader.GetInt32(2);
                typecrea = reader.GetString(3);
                pvcrea = reader.GetInt32(4);
                nomatk = reader.GetString(5);
                dommatk = reader.GetInt32(6);
                vitatk = reader.GetInt32(7);
            }
            reader.Dispose();

            string sql2 = "SELECT DISTINCT nomcarte, puisscrea, vitcrea, typecrea, pvcrea, nomatk, dommatk, vitatk FROM carte INNER JOIN creature ON creature.IDCARTE = carte.IDCARTE INNER JOIN j_crea_atk On j_crea_atk.IDCREA = creature.IDCARTE INNER JOIN atk On atk.IDATK = j_crea_atk.IDATK WHERE carte.NUMSERIE = '" + this.numserie + "' AND atk.IDATK=" + this.idatk2 + "";
            dbcmd.CommandText = sql2;

            IDataReader reader2 = dbcmd.ExecuteReader();
            while (reader2.Read())
            {
                nomatk2 = reader2.GetString(5);
                dommatk2 = reader2.GetInt32(6);
                vitatk2 = reader2.GetInt32(7);
            }
            reader2.Dispose();
        }
        catch (Exception ex)
        {
            Debug.Log(ex.Message);
        }
        dbcmd.Dispose();
        dbcon.Close();

    }
 public static IDataReader ExecuteSQL(string db, string sql)
 {
     var connection = new SqliteConnection(db);
     connection.Open();
     var command = connection.CreateCommand();
     command.CommandText = sql;
     var result = command.ExecuteReader();
     connection.Close();
     return result;
 }
Esempio n. 6
0
    public Database(string file)
    {
        bool create = false;
        if (!File.Exists (file)) {
            create = true;
        }

        try {
            StreamReader srVersion = new StreamReader (file+".version");
            dbVersion = srVersion.ReadToEnd ();
            if (dbVersion != null) {
                dbVersion = dbVersion.Trim();
            }
            srVersion.Close();
        }
        catch {
            dbVersion = null;
        }

        string connectionString = "URI=file:"+file;
        connection = new SqliteConnection(connectionString);
        connection.Open();
        command = connection.CreateCommand();

        if (create) {
            Conf.EmptyCache();
            Assembly thisAssembly = Assembly.GetEntryAssembly ();
            Stream stream = thisAssembly.GetManifestResourceStream("Database.sql");
            if (stream != null) {
                StreamReader sr = new StreamReader (stream);
                string sql = sr.ReadToEnd();
                command.CommandText = sql;
                command.ExecuteNonQuery();

                StreamWriter swVersion = new StreamWriter (file+".version", false);
                swVersion.Write (Defines.VERSION);
                swVersion.Close();

                dbVersion = Defines.VERSION;
            }
            else {
                System.Console.WriteLine("Error creating the database");
            }
        }

        if (dbVersion == null || !dbVersion.Equals (Defines.VERSION)) {
            UpdateDatabase(file, dbVersion);
        }
    }
Esempio n. 7
0
    // Hier wird eine gegebene Drone in die Tabelle DRONEN eingefüllt
    public void addDrone(Drone drone)
    {
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;

        _connection .Open();

        sql = "INSERT INTO DRONEN (DRONENNAME,AKTUELLERKNOTEN,HOMEPUNKTID, STATUS,CARTOSHOW) Values ('"+ drone.getName()+"','2','2','0','ef')";
        _command.CommandText = sql;
        _command.ExecuteNonQuery();

        _command.Dispose();
        _command = null;
        _connection .Close();
        _connection.Dispose ();
        _connection = null;
        sql = null;
    }
Esempio n. 8
0
    //Diese Methode Schreibt ein Gegebenes Auto in die Datenbank.
    // Das Auto wird als Parameter gegeben
    public void addauto(Autos autodaten)
    {
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;

        _connection .Open();

        sql = "INSERT INTO AUTOS (KENNZEICHEN, STATUS) Values ('"+ autodaten.getKennzeichen ()+"','"+autodaten.getStatus ()+"')";
        _command.CommandText = sql;
        _command.ExecuteNonQuery();

        _command.Dispose();
        _command = null;
        _connection .Close();
        _connection.Dispose ();
        _connection = null;
        //Debug.Log (autodaten.getKennzeichen ());
    }
Esempio n. 9
0
    public ArrayList Select(string quer)
    {
        Resultd = new ArrayList();
        string connectionString = "URI=file:" + Application.dataPath + "/Qjournaldb.s3db";
        IDbConnection dbcon = new SqliteConnection(connectionString);
        dbcon.Open();
        IDbCommand dbcmd = dbcon.CreateCommand();
        dbcmd.CommandText = quer;
        IDataReader reader = dbcmd.ExecuteReader();
        while (reader.Read())
        {
            Resultd.Add(reader.GetString(2));
            //Debug.Log(reader.GetString(2));
        }

        // clean up
        reader.Dispose();
        dbcmd.Dispose();
        dbcon.Close();
        return Resultd;
    }
Esempio n. 10
0
 // Hier wird überprüft ob eine bestimmte Tabelle in der Datenbank existieren. Die Anzahl der Funde wird Zurückgegeben. 1=Existiert; 0=Gibt es nicht
 public int abfrageexisttabelle(string Tabellenname)
 {
     IDbConnection _connection = new SqliteConnection(_strDBName);
     IDbCommand _command = _connection .CreateCommand();
     string sql;
     IDataReader _reader;
     _connection .Open();
     sql = "SELECT count(name) as Count FROM sqlite_master WHERE type='table' AND name='"+Tabellenname+"'";
     _command.CommandText = sql;
     _reader = _command.ExecuteReader();
     _reader.Read ();
     _connection .Close();
     _connection.Dispose ();
     _connection = null;
     _command.Dispose ();
     _command = null;
     int anzahl = System.Convert.ToInt32 (_reader ["Count"]);
     _reader.Close();
     _reader.Dispose ();
     _reader = null;
     return anzahl;
 }
Esempio n. 11
0
    // Hier wird ein zufälliges PArkendes Auto zurückgesendet
    public Autos getrandomparkingcar()
    {
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        IDataReader _reader;

        _connection .Open();
        sql = "SELECT Count(KENNZEICHEN) as COUNT FROM AUTOS WHERE STATUS='2' ";
        _command.CommandText = sql;
        _reader = _command.ExecuteReader();
        _reader.Read ();
        int zufall = UnityEngine.Random.Range (1, System.Convert.ToInt32(_reader ["COUNT"]));
        _reader.Close ();
        sql = "SELECT * FROM AUTOS WHERE STATUS = '2' LIMIT "+ zufall;
        _command.CommandText = sql;
        _reader = _command.ExecuteReader();

        // Hier wird ein zufälliges Auto gesucht
        for (int i=0; i<zufall; i++) {
            _reader.Read();
                }
        Autos car = new Autos ();
        //Debug.Log (_reader ["KENNZEICHEN"]);
        car.setKennzeichen (System.Convert.ToString (_reader ["KENNZEICHEN"]));
        car.setStatus("2");
        _command.Dispose();
        _command = null;
        _connection .Close();
        _connection.Dispose ();
        _connection = null;
        _reader.Close ();
        _reader.Dispose ();
        _reader = null;
        return car;
    }
Esempio n. 12
0
    //Hier wird die Datenbank wieder auf Anfang gesetzt. Alle Änderungen beim Letzten Ausführen des Programms werden gelöst
    public void allesaufanfang()
    {
        Debug.Log ("delete Car");
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        _connection.Open();
        sql = " Delete From AUTOS ";
        _command.CommandText = sql;
        _command.ExecuteNonQuery ();

        sql=" UPDATE PARKPLATZ SET KENNZEICHENFAHRZEUG='', FREI='1' WHERE FREI='0'";
        _command.CommandText = sql;
        _command.ExecuteNonQuery ();

        sql=" UPDATE DRONEN SET STATUS='0' WHERE STATUS > 0 ";
        _command.CommandText = sql;
        _command.ExecuteNonQuery ();

        _command.Dispose();
        _command = null;
        _connection .Close();
        _connection.Dispose ();
        _connection = null;
    }
Esempio n. 13
0
    // Hier wird die Tabelle Drone gefüllt
    // Zurzeit ist es nur eine Drone
    public void fillTableDronen()
    {
        Debug.Log ("Dronen");
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        _connection.Open();
        sql = " Delete From DRONEN";
        _command.CommandText = sql;
        _command.ExecuteNonQuery ();

        _connection.Close ();
        _connection.Dispose ();
        _connection = null;
        _command.Dispose ();
        _command = null;

        Drone drone = new Drone ();
        drone.setName ("QuadCopter");drone.setStatus ("0");this.addDrone (drone);
        drone = null;
    }
Esempio n. 14
0
    /// <summary>
    /// ////////////////////////////////////////Les fonctions liées aux gui
    /// </summary>

    void OnGUI()
    {
        //Debug.Log(idcarte);
        if (ObservJ1 == true)
        {
            if (GUI.Button(new Rect(710, 50, 200, 100), "Mettre dans le Deck"))
            {
                const string connectionString = "URI=file:E://Etude/Projet/Projet_4e_semestre/GITHUB/New_Unity_Project/Assets/testbdd.s3db";
                IDbConnection dbcon = new SqliteConnection(connectionString);
                IDbCommand dbcmd = dbcon.CreateCommand();
                try
                {
                    dbcon.Open();
                    string sql5 = "INSERT INTO j_deck_carte (IDDECK,IDCARTE) VALUES ('1'," + this.idcarte + ")";
                    dbcmd.CommandText = sql5;
                    IDataReader reader5 = dbcmd.ExecuteReader();
                    while (reader5.Read())
                    {
                    }
                    reader5.Dispose();
                }
                catch (Exception ex)
                {
                    Debug.Log(ex.Message);
                }
                dbcmd.Dispose();
                dbcon.Close();
            }
            if (GUI.Button(new Rect(710, 270, 200, 100), "Enlever du Deck"))
            {
                idcartebddJ1 = 0;
                const string connectionString = "URI=file:E://Etude/Projet/Projet_4e_semestre/GITHUB/New_Unity_Project/Assets/testbdd.s3db";
                IDbConnection dbcon = new SqliteConnection(connectionString);
                IDbCommand dbcmd = dbcon.CreateCommand();
                try
                {
                    dbcon.Open();
                    string sql6 = "DELETE FROM j_deck_carte WHERE IDDECK='1' AND IDCARTE='" + this.idcarte + "'";
                    dbcmd.CommandText = sql6;
                    IDataReader reader6 = dbcmd.ExecuteReader();
                    while (reader6.Read())
                    {
                    }
                    reader6.Dispose();
                }
                catch (Exception ex)
                {
                    Debug.Log(ex.Message);
                }
                dbcmd.Dispose();
                dbcon.Close();
            }
            if (GUI.Button(new Rect(710, 490, 200, 100), "Reposer"))
            {
                this.gameObject.transform.position = new Vector3(xdeck, ydeck, zdeck);
                ObservJ1 = false;
            }

        }


        if (ObservJ2 == true)
        {
            if (GUI.Button(new Rect(710, 50, 200, 100), "Mettre dans le Deck"))
            {
                const string connectionString = "URI=file:E://Etude/Projet/Projet_4e_semestre/GITHUB/New_Unity_Project/Assets/testbdd.s3db";
                IDbConnection dbcon = new SqliteConnection(connectionString);
                IDbCommand dbcmd = dbcon.CreateCommand();
                try
                {
                    dbcon.Open();
                    string sql7 = "INSERT INTO j_deck_carte (IDDECK,IDCARTE) VALUES ('2','" + this.idcarte + "')";
                    dbcmd.CommandText = sql7;
                    IDataReader reader7 = dbcmd.ExecuteReader();
                    while (reader7.Read())
                    {
                    }
                    reader7.Dispose();
                }
                catch (Exception ex)
                {
                    Debug.Log(ex.Message);
                }
                dbcmd.Dispose();
                dbcon.Close();
            }
            if (GUI.Button(new Rect(710, 270, 200, 100), "Enlever du Deck"))
            {
                idcartebddJ2 = 0;
                const string connectionString = "URI=file:E://Etude/Projet/Projet_4e_semestre/GITHUB/New_Unity_Project/Assets/testbdd.s3db";
                IDbConnection dbcon = new SqliteConnection(connectionString);
                IDbCommand dbcmd = dbcon.CreateCommand();
                try
                {
                    dbcon.Open();
                    string sql8 = "DELETE FROM j_deck_carte WHERE IDDECK='2' AND IDCARTE='" + this.idcarte + "'";
                    dbcmd.CommandText = sql8;
                    IDataReader reader8 = dbcmd.ExecuteReader();
                    while (reader8.Read())
                    {
                    }
                    reader8.Dispose();
                }
                catch (Exception ex)
                {
                    Debug.Log(ex.Message);
                }
                dbcmd.Dispose();
                dbcon.Close();
            }
            if (GUI.Button(new Rect(710, 490, 200, 100), "Reposer"))
            {
                this.gameObject.transform.position = new Vector3(xdeck, ydeck, zdeck);
                ObservJ2 = false;
            }
        }
    }
Esempio n. 15
0
    /// <summary>Creates the database if necessary and returns the current
    /// iteration.</summary>
    protected int InitializeDatabase()
    {
      IDbConnection dbcon = new SqliteConnection(_db_con);
      dbcon.Open();
      IDbCommand dbcmd = dbcon.CreateCommand();
      string sql = "CREATE TABLE crawl (iter INTEGER, Address TEXT, Hits INTEGER, " +
        "Rtt REAL, Hops REAL)";
      dbcmd.CommandText = sql;
      try {
        dbcmd.ExecuteNonQuery();
      } catch {
      }

      sql = "CREATE TABLE iterations (iter INTEGER, time INTEGER)";
      dbcmd.CommandText = sql;
      try {
        dbcmd.ExecuteNonQuery();
      } catch {
      }

      // Set _current_iter to how many iterations there exist already
      sql = "SELECT iter FROM iterations";
      dbcmd.CommandText = sql;
      int current_iter = dbcmd.ExecuteNonQuery();
      dbcmd.Dispose();

      dbcon.Close();
      return current_iter;
    }
Esempio n. 16
0
    // Hier wird die Tabelle Parkplatz mit den nötigen Werten gefüllt.
    // Es wurde nur am anfang benötigt um Änderungen bei jedem Start zu übernehmen
    // Wird zurzeit nicht mehr genutzt
    public void filltableParkplatz()
    {
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        _connection.Open();
        sql = " Delete From PARKPLATZ";
        _command.CommandText = sql;
        _command.ExecuteNonQuery ();

        _connection.Close ();
        _connection.Dispose ();
        _connection = null;
        _command.Dispose ();
        _command = null;
        Parkplatz park = new Parkplatz ();

        for (int i=1; i<=46; i++) {
            String iasStr=System.Convert.ToString(i);
            RoutenPunkte Point= this.getRoutePointPKviaNumber(iasStr);
            park.setROUTENID (iasStr);park.setPARKPLATZNUMMER (iasStr);park.setXKOORD (System.Convert.ToString(Point.getX()));park.setZKOORD (System.Convert.ToString(Point.getZ()));this.addParkPlatz (park);
        }
    }
Esempio n. 17
0
 //Hier wird angegeben ob es Mindestens Ein Freies Parkplatz gibt
 public int getanzahlfreeparkplaetzelimit1()
 {
     IDbConnection _connection = new SqliteConnection(_strDBName);
     IDbCommand _command = _connection .CreateCommand();
     string sql;
     IDataReader _reader;
     _connection .Open();
     sql = "SELECT count(PARKPLATZNUMMER) as Count FROM PARKPLATZ WHERE FREI='1' ";
     _command.CommandText = sql;
     _reader = _command.ExecuteReader();
     _reader.Read ();
     _connection .Close();
     _connection.Dispose ();
     _connection = null;
     _command.Dispose ();
     _command = null;
     int wert = System.Convert.ToInt32(_reader ["Count"]);
     _reader.Close();
     _reader.Dispose ();
     _reader = null;
     return wert;
 }
Esempio n. 18
0
    // Hier wird die Tabelle TypPunkte mit den nötigen Werten gefüllt.
    // Es wurde nur am anfang benötigt um Änderungen bei jedem Start zu übernehmen
    // Wird zurzeit nicht mehr genutzt
    public void fillTypPunkt()
    {
        Debug.Log ("fillTypPunkte");
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        _connection.Open();
        sql = " Delete From TYPPUNKTE";
        _command.CommandText = sql;
        _command.ExecuteNonQuery ();

        _command.Dispose ();
        _command = null;
        _connection.Close ();
        _connection.Dispose ();
        _connection = null;

        TypPunkte typen = new TypPunkte ();
        typen.setID ("1"); typen.setTypbezeichnung ("Abzweigung"); this.addTypforPunkt (typen);
        typen.setID ("2"); typen.setTypbezeichnung ("ParkPlatzFront"); this.addTypforPunkt (typen);
        typen.setID ("3"); typen.setTypbezeichnung ("Parkplatz"); this.addTypforPunkt (typen);
        typen.setID ("4"); typen.setTypbezeichnung ("Start"); this.addTypforPunkt (typen);
    }
Esempio n. 19
0
    // Hier wird die Tabelle RoutenPunkte mit den nötigen Werten gefüllt.
    // Es wurde nur am anfang benötigt um Änderungen bei jedem Start zu übernehmen
    // Wird zurzeit nicht mehr genutzt
    public void filltableRoutenPunkte()
    {
        Debug.Log ("RoutePoints");
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        _connection.Open();

        //Leeren der Tabelle
        sql = " Delete From Routenpunkte";
        _command.CommandText = sql;
        _command.ExecuteNonQuery ();

        _command.Dispose ();
        _command = null;
        _connection.Close ();
        _connection.Dispose ();
        _connection = null;

        RoutenPunkte Punkt = new RoutenPunkte ();

        Punkt.setID ("1");Punkt.setKNOTENNAME ("FirstKnotR");Punkt.setX ("-5.31386"); Punkt.setZ ("-11.65559");Punkt.setTYPID("1");this.addRoutenPunkte (Punkt);

        Punkt.setID ("2");Punkt.setKNOTENNAME ("FrontPK1");Punkt.setX ("-5.31386"); Punkt.setZ ("-19.48297");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("3");Punkt.setKNOTENNAME ("PK1");Punkt.setX ("-6.37327"); Punkt.setZ ("-19.48297");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("4");Punkt.setKNOTENNAME ("FrontPK2");Punkt.setX ("-5.31386"); Punkt.setZ ("-18.87943");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("5");Punkt.setKNOTENNAME ("PK2");Punkt.setX ("-6.37327"); Punkt.setZ ("-18.87943");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("6");Punkt.setKNOTENNAME ("FrontPK3");Punkt.setX ("-5.31386"); Punkt.setZ ("-18.20297");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("7");Punkt.setKNOTENNAME ("PK3");Punkt.setX ("-6.37327"); Punkt.setZ ("-18.20297");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("8");Punkt.setKNOTENNAME ("FrontPK4-PK5");Punkt.setX ("-5.31386"); Punkt.setZ ("-17.58915");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("9");Punkt.setKNOTENNAME ("PK4");Punkt.setX ("-6.37327"); Punkt.setZ ("-17.58915");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("10");Punkt.setKNOTENNAME ("PK5");Punkt.setX ("-3.698879"); Punkt.setZ ("-17.58915");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("11");Punkt.setKNOTENNAME ("FrontPK6-PK7");Punkt.setX ("-5.31386"); Punkt.setZ ("-16.93814");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("12");Punkt.setKNOTENNAME ("PK6");Punkt.setX ("-6.37327"); Punkt.setZ ("-16.93814");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("13");Punkt.setKNOTENNAME ("PK7");Punkt.setX ("-3.698879"); Punkt.setZ ("-16.93814");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("14");Punkt.setKNOTENNAME ("FrontPK8-PK9");Punkt.setX ("-5.31386"); Punkt.setZ ("-16.28712");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("15");Punkt.setKNOTENNAME ("PK8");Punkt.setX ("-6.37327"); Punkt.setZ ("-16.28712");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("16");Punkt.setKNOTENNAME ("PK9");Punkt.setX ("-3.698879"); Punkt.setZ ("-16.28712");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("17");Punkt.setKNOTENNAME ("FrontPK10-PK11");Punkt.setX ("-5.31386"); Punkt.setZ ("-15.6175");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("18");Punkt.setKNOTENNAME ("PK10");Punkt.setX ("-6.37327"); Punkt.setZ ("-15.6175");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("19");Punkt.setKNOTENNAME ("PK11");Punkt.setX ("-3.698879"); Punkt.setZ ("-15.6175");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("20");Punkt.setKNOTENNAME ("FrontPK12-PK13");Punkt.setX ("-5.31386"); Punkt.setZ ("-14.98962");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("21");Punkt.setKNOTENNAME ("PK12");Punkt.setX ("-6.37327"); Punkt.setZ ("-14.98962");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("22");Punkt.setKNOTENNAME ("PK13");Punkt.setX ("-3.698879"); Punkt.setZ ("-14.98962");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("23");Punkt.setKNOTENNAME ("FrontPK14-PK15");Punkt.setX ("-5.31386"); Punkt.setZ ("-14.35225");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("24");Punkt.setKNOTENNAME ("PK14");Punkt.setX ("-6.37327"); Punkt.setZ ("-14.35225");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("25");Punkt.setKNOTENNAME ("PK15");Punkt.setX ("-3.698879"); Punkt.setZ ("-14.35225");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("26");Punkt.setKNOTENNAME ("FrontPK16-PK17");Punkt.setX ("-5.31386"); Punkt.setZ ("-13.71087");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("27");Punkt.setKNOTENNAME ("PK16");Punkt.setX ("-6.37327"); Punkt.setZ ("-13.71087");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("28");Punkt.setKNOTENNAME ("PK17");Punkt.setX ("-3.698879"); Punkt.setZ ("-13.71087");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("29");Punkt.setKNOTENNAME ("FrontPK18-PK19");Punkt.setX ("-5.31386"); Punkt.setZ ("-13.06949");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("30");Punkt.setKNOTENNAME ("PK18");Punkt.setX ("-6.37327"); Punkt.setZ ("-13.06949");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("31");Punkt.setKNOTENNAME ("PK19");Punkt.setX ("-3.698879"); Punkt.setZ ("-13.06949");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);

        Punkt.setID ("56");Punkt.setKNOTENNAME ("FirstKnotL");Punkt.setX ("-4.642091"); Punkt.setZ ("-10.48455");Punkt.setTYPID("1");this.addRoutenPunkte (Punkt);

        Punkt.setID ("57");Punkt.setKNOTENNAME ("FrontPK35-PK36");Punkt.setX ("-4.642091"); Punkt.setZ ("-9.18896");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("58");Punkt.setKNOTENNAME ("PK35");Punkt.setX ("-3.707438"); Punkt.setZ ("-9.18896");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("59");Punkt.setKNOTENNAME ("PK36");Punkt.setX ("-6.395954"); Punkt.setZ ("-9.18896");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("60");Punkt.setKNOTENNAME ("FrontPK37-PK38");Punkt.setX ("-4.642091"); Punkt.setZ ("-8.533358");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("61");Punkt.setKNOTENNAME ("PK37");Punkt.setX ("-3.707438"); Punkt.setZ ("-8.533358");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("62");Punkt.setKNOTENNAME ("PK38");Punkt.setX ("-6.395954"); Punkt.setZ ("-8.533358");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("63");Punkt.setKNOTENNAME ("FrontPK39-PK40");Punkt.setX ("-4.642091"); Punkt.setZ ("-7.890867");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("64");Punkt.setKNOTENNAME ("PK39");Punkt.setX ("-3.707438"); Punkt.setZ ("-7.890867");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("65");Punkt.setKNOTENNAME ("PK40");Punkt.setX ("-6.395954"); Punkt.setZ ("-7.890867");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("66");Punkt.setKNOTENNAME ("FrontPK41-PK42");Punkt.setX ("-4.642091"); Punkt.setZ ("-7.261488");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("67");Punkt.setKNOTENNAME ("PK41");Punkt.setX ("-3.707438"); Punkt.setZ ("-7.261488");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("68");Punkt.setKNOTENNAME ("PK42");Punkt.setX ("-6.395954"); Punkt.setZ ("-7.261488");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("69");Punkt.setKNOTENNAME ("FrontPK43-PK44");Punkt.setX ("-4.642091"); Punkt.setZ ("-6.632109");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("70");Punkt.setKNOTENNAME ("PK43");Punkt.setX ("-3.707438"); Punkt.setZ ("-6.632109");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("71");Punkt.setKNOTENNAME ("PK44");Punkt.setX ("-6.395954"); Punkt.setZ ("-6.632109");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("72");Punkt.setKNOTENNAME ("FrontPK45-PK46");Punkt.setX ("-4.642091"); Punkt.setZ ("-5.989618");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("73");Punkt.setKNOTENNAME ("PK45");Punkt.setX ("-3.707438"); Punkt.setZ ("-5.989618");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("74");Punkt.setKNOTENNAME ("PK46");Punkt.setX ("-6.395954"); Punkt.setZ ("-5.989618");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);

        Punkt.setID ("32");Punkt.setKNOTENNAME ("SecondKnot");Punkt.setX ("-0.8945427"); Punkt.setZ ("-11.58572");Punkt.setTYPID("1");this.addRoutenPunkte (Punkt);

        Punkt.setID ("33");Punkt.setKNOTENNAME ("FrontPK20");Punkt.setX ("-0.8945427"); Punkt.setZ ("-17.57712");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("34");Punkt.setKNOTENNAME ("PK20");Punkt.setX ("-1.8369"); Punkt.setZ ("-17.57712");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("35");Punkt.setKNOTENNAME ("FrontPK21-PK22");Punkt.setX ("-0.8945427"); Punkt.setZ ("-16.93082");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("36");Punkt.setKNOTENNAME ("PK21");Punkt.setX ("-1.8369"); Punkt.setZ ("-16.93082");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("37");Punkt.setKNOTENNAME ("PK22");Punkt.setX ("0.8356519"); Punkt.setZ ("-16.93082");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("38");Punkt.setKNOTENNAME ("FrontPK23-PK24");Punkt.setX ("-0.8945427"); Punkt.setZ ("-16.30198");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("39");Punkt.setKNOTENNAME ("PK23");Punkt.setX ("-1.8369"); Punkt.setZ ("-16.30198");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("40");Punkt.setKNOTENNAME ("PK24");Punkt.setX ("0.8356519"); Punkt.setZ ("-16.30198");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("41");Punkt.setKNOTENNAME ("FrontPK25-PK26");Punkt.setX ("-0.8945427"); Punkt.setZ ("-15.63583");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("42");Punkt.setKNOTENNAME ("PK25");Punkt.setX ("-1.8369"); Punkt.setZ ("-15.63583");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("43");Punkt.setKNOTENNAME ("PK26");Punkt.setX ("0.8356519"); Punkt.setZ ("-15.63583");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("44");Punkt.setKNOTENNAME ("FrontPK27-PK28");Punkt.setX ("-0.8945427"); Punkt.setZ ("-14.97135");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("45");Punkt.setKNOTENNAME ("PK27");Punkt.setX ("-1.8369"); Punkt.setZ ("-14.97135");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("46");Punkt.setKNOTENNAME ("PK28");Punkt.setX ("0.8356519"); Punkt.setZ ("-14.97135");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("47");Punkt.setKNOTENNAME ("FrontPK29-PK30");Punkt.setX ("-0.8945427"); Punkt.setZ ("-14.36225");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("48");Punkt.setKNOTENNAME ("PK29");Punkt.setX ("-1.8369"); Punkt.setZ ("-14.36225");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("49");Punkt.setKNOTENNAME ("PK30");Punkt.setX ("0.8356519"); Punkt.setZ ("-14.36225");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("50");Punkt.setKNOTENNAME ("FrontPK31-PK32");Punkt.setX ("-0.8945427"); Punkt.setZ ("-13.71623");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("51");Punkt.setKNOTENNAME ("PK31");Punkt.setX ("-1.8369"); Punkt.setZ ("-13.71623");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("52");Punkt.setKNOTENNAME ("PK32");Punkt.setX ("0.8356519"); Punkt.setZ ("-13.71623");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("53");Punkt.setKNOTENNAME ("FrontPK33-PK34");Punkt.setX ("-0.8945427"); Punkt.setZ ("-13.08867");Punkt.setTYPID("2");this.addRoutenPunkte (Punkt);
        Punkt.setID ("54");Punkt.setKNOTENNAME ("PK33");Punkt.setX ("-1.8369"); Punkt.setZ ("-13.08867");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);
        Punkt.setID ("55");Punkt.setKNOTENNAME ("PK34");Punkt.setX ("0.8356519"); Punkt.setZ ("-13.08867");Punkt.setTYPID("3");this.addRoutenPunkte (Punkt);

        Punkt.setID ("75");Punkt.setKNOTENNAME ("ThirdKnot");Punkt.setX ("3.582275"); Punkt.setZ ("-11.58572");Punkt.setTYPID("1");this.addRoutenPunkte (Punkt);
    }
Esempio n. 20
0
    // Hier wird die Tabelle Route mit den nötigen Werten gefüllt.
    // Es wurde nur am anfang benötigt um Änderungen bei jedem Start zu übernehmen
    // Wird zurzeit nicht mehr genutzt
    public void filltableRoute()
    {
        Debug.Log ("RoutePoints");
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        _connection.Open();

        // Leeren der Tabelle
        sql = " Delete From ROUTE";
        _command.CommandText = sql;
        _command.ExecuteNonQuery ();

        _command.Dispose ();
        _command = null;
        _connection.Close ();
        _connection.Dispose ();
        _connection = null;

        Route PointstoRoute = new Route ();
        //First Route
        PointstoRoute.setRoutenID ("1");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("1");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("2");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("1");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("3");this.addRoute (PointstoRoute);
        //Second Route
        PointstoRoute.setRoutenID ("2");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("2");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("4");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("2");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("5");this.addRoute (PointstoRoute);
        //Third Route
        PointstoRoute.setRoutenID ("3");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("3");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("6");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("3");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("7");this.addRoute (PointstoRoute);
        //Fourth Route
        PointstoRoute.setRoutenID ("4");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("4");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("8");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("4");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("9");this.addRoute (PointstoRoute);
        //Fifth Route
        PointstoRoute.setRoutenID ("5");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("5");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("8");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("5");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("10");this.addRoute (PointstoRoute);
        //Six Route
        PointstoRoute.setRoutenID ("6");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("6");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("11");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("6");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("12");this.addRoute (PointstoRoute);
        //Seven Route
        PointstoRoute.setRoutenID ("7");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("7");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("11");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("7");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("13");this.addRoute (PointstoRoute);
        //eight Route
        PointstoRoute.setRoutenID ("8");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("8");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("14");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("8");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("15");this.addRoute (PointstoRoute);
        //nine Route
        PointstoRoute.setRoutenID ("9");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("9");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("14");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("9");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("16");this.addRoute (PointstoRoute);
        //ten Route
        PointstoRoute.setRoutenID ("10");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("10");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("17");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("10");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("18");this.addRoute (PointstoRoute);
        //eleven Route
        PointstoRoute.setRoutenID ("11");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("11");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("17");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("11");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("19");this.addRoute (PointstoRoute);
        //12 Route
        PointstoRoute.setRoutenID ("12");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("12");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("20");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("12");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("21");this.addRoute (PointstoRoute);
        //13 Route
        PointstoRoute.setRoutenID ("13");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("13");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("20");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("13");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("22");this.addRoute (PointstoRoute);
        //14 Route
        PointstoRoute.setRoutenID ("14");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("14");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("23");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("14");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("24");this.addRoute (PointstoRoute);
        //15 Route
        PointstoRoute.setRoutenID ("15");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("15");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("23");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("15");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("25");this.addRoute (PointstoRoute);
        //16 Route
        PointstoRoute.setRoutenID ("16");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("16");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("26");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("16");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("27");this.addRoute (PointstoRoute);
        //17 Route
        PointstoRoute.setRoutenID ("17");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("17");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("26");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("17");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("28");this.addRoute (PointstoRoute);
        //18 Route
        PointstoRoute.setRoutenID ("18");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("18");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("29");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("18");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("30");this.addRoute (PointstoRoute);
        //19 Route
        PointstoRoute.setRoutenID ("19");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("1");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("19");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("29");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("19");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("31");this.addRoute (PointstoRoute);

        //20 Route
        PointstoRoute.setRoutenID ("20");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("20");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("33");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("20");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("34");this.addRoute (PointstoRoute);

        //21 Route
        PointstoRoute.setRoutenID ("21");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("21");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("35");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("21");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("36");this.addRoute (PointstoRoute);
        //22 Route
        PointstoRoute.setRoutenID ("22");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("22");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("35");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("22");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("37");this.addRoute (PointstoRoute);
        //23 Route
        PointstoRoute.setRoutenID ("23");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("23");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("38");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("23");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("39");this.addRoute (PointstoRoute);
        //24 Route
        PointstoRoute.setRoutenID ("24");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("24");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("38");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("24");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("40");this.addRoute (PointstoRoute);
        //25 Route
        PointstoRoute.setRoutenID ("25");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("25");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("41");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("25");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("42");this.addRoute (PointstoRoute);
        //26 Route
        PointstoRoute.setRoutenID ("26");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("26");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("41");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("26");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("43");this.addRoute (PointstoRoute);
        //27 Route
        PointstoRoute.setRoutenID ("27");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("27");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("44");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("27");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("45");this.addRoute (PointstoRoute);
        //28 Route
        PointstoRoute.setRoutenID ("28");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("28");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("44");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("28");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("46");this.addRoute (PointstoRoute);
        //29 Route
        PointstoRoute.setRoutenID ("29");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("29");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("47");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("29");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("48");this.addRoute (PointstoRoute);
        //30 Route
        PointstoRoute.setRoutenID ("30");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("30");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("47");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("30");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("49");this.addRoute (PointstoRoute);
        //31 Route
        PointstoRoute.setRoutenID ("31");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("31");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("50");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("31");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("51");this.addRoute (PointstoRoute);
        //32 Route
        PointstoRoute.setRoutenID ("32");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("32");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("50");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("32");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("52");this.addRoute (PointstoRoute);
        //33 Route
        PointstoRoute.setRoutenID ("33");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("33");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("53");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("33");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("54");this.addRoute (PointstoRoute);
        //34 Route
        PointstoRoute.setRoutenID ("34");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("32");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("34");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("53");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("34");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("55");this.addRoute (PointstoRoute);

        //35 Route
        PointstoRoute.setRoutenID ("35");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("56");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("35");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("57");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("35");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("58");this.addRoute (PointstoRoute);
        //36 Route
        PointstoRoute.setRoutenID ("36");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("56");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("36");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("57");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("36");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("59");this.addRoute (PointstoRoute);
        //37 Route
        PointstoRoute.setRoutenID ("37");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("56");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("37");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("60");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("37");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("61");this.addRoute (PointstoRoute);
        //38 Route
        PointstoRoute.setRoutenID ("38");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("56");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("38");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("60");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("38");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("62");this.addRoute (PointstoRoute);
        //39 Route
        PointstoRoute.setRoutenID ("39");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("56");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("39");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("63");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("39");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("64");this.addRoute (PointstoRoute);
        //40 Route
        PointstoRoute.setRoutenID ("40");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("56");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("40");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("63");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("40");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("65");this.addRoute (PointstoRoute);
        //41 Route
        PointstoRoute.setRoutenID ("41");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("56");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("41");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("66");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("41");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("67");this.addRoute (PointstoRoute);
        //42 Route
        PointstoRoute.setRoutenID ("42");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("56");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("42");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("66");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("42");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("68");this.addRoute (PointstoRoute);
        //43 Route
        PointstoRoute.setRoutenID ("43");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("56");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("43");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("69");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("43");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("70");this.addRoute (PointstoRoute);
        //44 Route
        PointstoRoute.setRoutenID ("44");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("56");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("44");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("69");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("44");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("71");this.addRoute (PointstoRoute);
        //45 Route
        PointstoRoute.setRoutenID ("45");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("56");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("45");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("72");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("45");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("73");this.addRoute (PointstoRoute);
        //46 Route
        PointstoRoute.setRoutenID ("46");PointstoRoute.setPositionID ("1");PointstoRoute.setKnotenID ("56");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("46");PointstoRoute.setPositionID ("2");PointstoRoute.setKnotenID ("72");this.addRoute (PointstoRoute);
        PointstoRoute.setRoutenID ("46");PointstoRoute.setPositionID ("3");PointstoRoute.setKnotenID ("74");this.addRoute (PointstoRoute);
    }
		/// <summary>
		/// Initializes a new instance of the <see cref="SqliteDataAdapter">SqliteDataAdapter</see> class 
		/// with a SelectCommand and a SqliteConnection object.
		/// </summary>
		/// <param name="selectCommandText"></param>
		/// <param name="connection"></param>
		public SqliteDataAdapter(string selectCommandText, SqliteConnection connection)
		{
#if NET_2_0
			DbCommand cmd;
#else
			IDbCommand cmd;
#endif

			cmd = connection.CreateCommand();
			cmd.CommandText = selectCommandText;
			SelectCommand = cmd;
		}
Esempio n. 22
0
    // Hier wird Ein Auto aus der Datenbank genommen mit einem als Parameter gegebenem Kennzeichen
    // Die Rückgabe ist eine Object der Klasse Autos
    public Autos getAutoViaKennzeichen(String Kennzeichen)
    {
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        IDataReader _reader;
        _connection .Open();
        sql = "SELECT * FROM AUTOS WHERE KENNZEICHEN='"+Kennzeichen+"' ";
        _command.CommandText = sql;
        _reader = _command.ExecuteReader();

        Autos auto = new Autos ();
        _reader.Read ();

        auto.setKennzeichen (System.Convert.ToString(_reader ["KENNZEICHEN"]));
        auto.setStatus (System.Convert.ToString(_reader ["STATUS"]));
        _command.Dispose ();
        _command = null;
        _connection.Close ();
        _connection.Dispose ();
        _connection = null;
        _reader.Close ();
        _reader.Dispose ();
        _reader = null;
        return auto;
    }
Esempio n. 23
0
    /// <summary>The test is finished, write the results to the DB</summary>
    protected void Finished()
    {
      IDbConnection dbcon = new SqliteConnection(_db_con);
      dbcon.Open();
      IDbCommand dbcmd = dbcon.CreateCommand();

      string sql = "INSERT INTO iterations (iter, time) VALUES ( " +
        _current_iter + ", datetime())";
      dbcmd.CommandText = sql;
      dbcmd.ExecuteNonQuery();

      foreach(ResultState rs in _results.Values) {
        int hits = 0;
        double rtt = 0;
        double hops = 0;

        for(int i = 0; i < 3; i++) {
          if(rs.RTTs[i] == TimeSpan.MinValue) {
            continue;
          }
          hits++;
          rtt += rs.RTTs[i].TotalSeconds;
          hops += rs.Hops[i];
        }

        if(hits > 0) {
          rtt /= hits;
          hops /= hits;
        } else {
          rtt = -1;
          hops = -1;
        }

        sql = "INSERT INTO crawl (iter, Address, Hits, Rtt, Hops) " +
          " VALUES ( " + _current_iter + ", \"" + GetAddress(rs.Target) + "\", " +
          hits + ", " + rtt + ", " + hops + ")";
        dbcmd.CommandText = sql;
        dbcmd.ExecuteNonQuery();
      }
      dbcmd.Dispose();
      dbcon.Close();

      _results = null;
      _outstanding = null;
      _current_iter++;
      Interlocked.Exchange(ref _running, 0);
    }
Esempio n. 24
0
    // Hier wird nur der Erste freie Parkplatz zurückgeschickt
    public Parkplatz getfreeParkplatzlimit1()
    {
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        IDataReader _reader;
        _connection .Open();
        sql = "SELECT * FROM PARKPLATZ WHERE FREI=1 LIMIT 1 ";
        _command.CommandText = sql;
        _reader = _command.ExecuteReader();

        _reader.Read ();
            Parkplatz platz=new Parkplatz();
            platz.setPARKPLATZNUMMER(System.Convert.ToString(_reader["PARKPLATZNUMMER"]));
            platz.setFREI(System.Convert.ToString(_reader["FREI"]));
            platz.setKENNZEICHEN(System.Convert.ToString(_reader["KENNZEICHENFAHRZEUG"]));
            platz.setROUTENID(System.Convert.ToString(_reader["ROUTENID"] ));
            platz.setXKOORD(System.Convert.ToString(_reader["XKOORD"] ));
            platz.setZKOORD(System.Convert.ToString(_reader["ZKOORD"]));

        _command.Dispose();
        _command = null;
        _connection .Close();
        _connection.Dispose ();
        _connection = null;
        _reader.Close();
        _reader.Dispose ();
        _reader = null;
        return platz;
    }
Esempio n. 25
0
    /// <summary>
    /// ////////////////////////////////////////voir si la carte est dans le 2e deck
    /// </summary>
    public void voirsidsdeck2(int idcarte)
    {
        const string connectionString = "URI=file:E://Etude/Projet/Projet_4e_semestre/GITHUB/New_Unity_Project/Assets/testbdd.s3db";
        IDbConnection dbcon = new SqliteConnection(connectionString);
        IDbCommand dbcmd = dbcon.CreateCommand();
        try
        {
            dbcon.Open();
            string sql4 = "SELECT DISTINCT j_deck_carte.idcarte,j_deck_carte.IDDECK, nomcarte FROM JOUEUR INNER JOIN DECK ON joueur.IDJ = deck.IDJ INNER JOIN j_deck_carte ON j_deck_carte.IDDECK = deck.IDDECK INNER JOIN carte ON carte.IDCARTE = j_deck_carte.IDCARTE INNER JOIN creature ON creature.IDCARTE = carte.IDCARTE INNER JOIN j_crea_atk On j_crea_atk.IDCREA = creature.IDCARTE INNER JOIN atk On atk.IDATK = j_crea_atk.IDATK where j_deck_carte.iddeck = '2' and j_deck_carte.IDCARTE =" + this.idcarte + "";

            dbcmd.CommandText = sql4;


            IDataReader reader4 = dbcmd.ExecuteReader();
            while (reader4.Read())
            {
                this.idcartebddJ2 = reader4.GetInt32(0);
            }
            reader4.Dispose();

        }
        catch (Exception ex)
        {
            Debug.Log(ex.Message);
        }
        dbcmd.Dispose();
        dbcon.Close();
    }
Esempio n. 26
0
    //Hier wird geguckt ob überhaupt ein aktives auto existiert
    // ein Boolwert wird zurückgeschickt
    public bool getifactiveCarExists()
    {
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        IDataReader _reader;
        _connection .Open();
        sql = "SELECT COUNT(KENNZEICHEN) AS Count FROM AUTOS WHERE STATUS='1' Limit 1 ";
        _command.CommandText = sql;
        _reader = _command.ExecuteReader();

        _reader.Read ();

        // Wenn ein oder mehr Active Autos existieren wirt ein True gegeben sonst ein false
        if (0 < System.Convert.ToInt32 (_reader ["Count"]))
        {	_command.Dispose();
            _command=null;
            _connection .Close();
            _connection.Dispose();
            _connection = null;
            _reader.Close();
            _reader.Dispose();
            _reader=null;
            return true;
                }
        else{
            _command.Dispose();
            _command=null;
            _connection .Close();
            _connection.Dispose();
            _connection = null;
            _reader.Close();
            _reader.Dispose();
            _reader=null;
            return false;
        }
    }
Esempio n. 27
0
    // Hier wird ein Auto gelöscht
    public void deletecar(String Kennzeichen)
    {
        //Debug.Log ("delete Car");
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        _connection.Open();
        sql = " Delete From AUTOS WHERE KENNZEICHEN= '"+Kennzeichen+"'";
        _command.CommandText = sql;
        _command.ExecuteNonQuery ();

        _connection.Close ();
        _connection.Dispose ();
        _connection = null;
        _command.Dispose();
        _command = null;
    }
Esempio n. 28
0
    // Diese Wurde als Test benutzt um zu gucken ob eine Änderung an der Tabelle vorgenommen worden ist.
    // Problem war Kennzeichen wurden nicht beim einfahren eines Neuen Autos nich zu einem Parkplatz zugewiesen
    // Wird nicht mehr Verwendet
    public void getParkplatzViaKennzeichencount(String Kennzeichen)
    {
        IDbConnection _connection = new SqliteConnection (_strDBName);
                IDbCommand _command = _connection .CreateCommand ();
                string sql;
                IDataReader _reader;
                _connection .Open ();

                sql = "SELECT * FROM PARKPLATZ WHERE FREI='0' ";
                _command.CommandText = sql;
                _reader = _command.ExecuteReader ();
                while (_reader.Read ()){
            //Debug.Log ("ParkplatzNummer " + _reader["PARKPLATZNUMMER"]+"   Kennzeichen   "+_reader["KENNZEICHENFAHRZEUG"]);
        }
        _command.Dispose ();
        _command = null;
        _connection.Close ();
        _connection.Dispose ();
        _connection = null;
        _reader.Close ();
        _reader.Dispose ();
        _reader = null;
    }
Esempio n. 29
0
    // Hier wird nach dem Parkplatz gesucht der zu einem Als Parameter gegbenem PKW-Kennzeichen gehört.
    // Die Rückgabe ist von der Klasse PArkplatz
    public Parkplatz getParkplatzViaKennzeichen(String Kennzeichen)
    {
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        IDataReader _reader;
        _connection .Open();
        sql = "SELECT * FROM PARKPLATZ WHERE KENNZEICHENFAHRZEUG='"+Kennzeichen+"' ";
        _command.CommandText = sql;
        _reader = _command.ExecuteReader();

        Parkplatz parkplatz = new Parkplatz ();
        _reader.Read ();
        // Hier werden die Gefundenen werte in das objekt PArkplatz geschrieben
        parkplatz.setFREI(System.Convert.ToString(_reader["FREI"]));
        parkplatz.setPARKPLATZNUMMER(System.Convert.ToString(_reader["PARKPLATZNUMMER"]));
        parkplatz.setROUTENID(System.Convert.ToString(_reader["ROUTENID"]));
        parkplatz.setKENNZEICHEN(System.Convert.ToString(_reader["KENNZEICHENFAHRZEUG"]));
        parkplatz.setXKOORD(System.Convert.ToString(_reader["XKOORD"]));
        parkplatz.setZKOORD(System.Convert.ToString(_reader["ZKOORD"]));

        _command.Dispose ();
        _command = null;
        _connection.Close ();
        _connection.Dispose ();
        _connection = null;
        _reader.Close ();
        _reader.Dispose ();
        _reader = null;
        return parkplatz;
    }
Esempio n. 30
0
    // Diese Methode wird benutzt um die gegebene Tabelle (als String) wenn es Exsistiert zu lösen
    // TabellenName wird per Parameter gegeben
    public void deleteTabelle(string Tabelle)
    {
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        _connection .Open();
        sql = "DROP TABLE IF EXISTS "+Tabelle+" ";
        _command.CommandText = sql;
        _command.ExecuteNonQuery ();

        _command.Dispose();
        _command = null;
        _connection .Close();
        _connection.Dispose ();
        _connection = null;
    }