Ejemplo n.º 1
0
        private void readDatabaseLocations()
        {   //Create list and fill from database
            objDb = new DatabaseManager();
            locationsList = new List<ClassLocations>();

            locationsList = objDb.readLocations();
        }
Ejemplo n.º 2
0
 private void writeDatabaseLocation()
 {   //Udate the current location from GPS services to database for future use (eg on no GPS fix)
     SQLQuery = "UPDATE locations SET country = 'Current Location', town = 'Current Location', latitude = '" + 
         currentLat + "', longitude = '" + currentLong + "' WHERE  rowid = 1";
     objDb = new DatabaseManager();
     objDb.runQuery(SQLQuery);
 }
Ejemplo n.º 3
0
        private void writeDatabaseLocation(int xPosition)
        {   //Send SQLite query to write to database

            //Construct query to insert new entry into database
            //Entry values from returned GeoCoder location in position of which item clicked in the list
            SQLQuery = "INSERT INTO locations (country, town, latitude, longitude) VALUES ('" +
                locationsList[xPosition].country + "','" + locationsList[xPosition].town + "','" +
                locationsList[xPosition].latitude + "','" + locationsList[xPosition].longitude + "')";
            //Send query to database manager
            objDb = new DatabaseManager();
            objDb.runQuery(SQLQuery);
        }