Exemplo n.º 1
0
 public static int GetRevision(SQLiteDatabase db)
 {
     if (db.Execute("SELECT DATEINFO FROM NAMES WHERE 0") == null)
         return (int)PcdbRevision.Rev0;
     if (db.Execute("SELECT 1 FROM DBVERSION WHERE 0") == null)
         return (int)PcdbRevision.Rev1;
     return Convert.ToInt32(db.Execute("SELECT VERSION FROM DBVERSION").Rows[0][0]);
 }
Exemplo n.º 2
0
 public void PropagationHorizonCreateTable(ELEVATIONMODEL model, string tablename = "")
 {
     System.Data.SQLite.SQLiteDatabase db = GetPropagationDatabase(model);
     lock (db.DBCommand)
     {
         // check for table name is null or empty --> use default tablename from type instead
         string tn = tablename;
         if (String.IsNullOrEmpty(tn))
         {
             tn = PropagationHorizonDesignator.TableName;
         }
         db.DBCommand.CommandText = "CREATE TABLE " + tn + " (Lat DOUBLE NOT NULL DEFAULT 0, Lon DOUBLE NOT NULL DEFAULT 0, h DOUBLE NOT NULL DEFAULT 0, Dist DOUBLE NOT NULL DEFAULT 0, QRG DOUBLE NOT NULL DEFAULT 0, Radius DOUBLE NOT NULL DEFAULT 0, F1_Clearance DOUBLE NOT NULL DEFAULT 0, StepWidth DOUBLE NOT NULL DEFAULT 0, Horizon BLOB, LastUpdated INT32, PRIMARY KEY (Lat, Lon, h, Dist, QRG, Radius, F1_Clearance, StepWidth))";
         db.DBCommand.Parameters.Clear();
         db.Execute(db.DBCommand);
     }
 }
Exemplo n.º 3
0
 public static PcdbGameVersion GetGameVersion(SQLiteDatabase db)
 {
     return (PcdbGameVersion)Convert.ToInt32(db.Execute("SELECT TYPEID FROM DBTYPE").Rows[0][0]);
 }