Example #1
0
 public int SignalLevelUpdate(SignalLevelDesignator sd)
 {
     lock (db.DBCommand)
     {
         db.DBCommand.CommandText = "UPDATE " + SignalLevelDesignator.TableName + " SET Level = @Level, LastUpdated = @LastUpdated WHERE LastUpdated = @LastUpdated";
         db.DBCommand.Parameters.Clear();
         db.DBCommand.Parameters.Add(sd.AsDouble("Level"));
         db.DBCommand.Parameters.Add(sd.AsUNIXTime("LastUpdated"));
         return(db.ExecuteNonQuery(db.DBCommand));
     }
 }
Example #2
0
 public int SignalLevelInsert(SignalLevelDesignator sd)
 {
     lock (db.DBCommand)
     {
         db.DBCommand.CommandText = "INSERT INTO " + SignalLevelDesignator.TableName + " (Level, LastUpdated) VALUES (@Level, @LastUpdated)";
         db.DBCommand.Parameters.Clear();
         db.DBCommand.Parameters.Add(sd.AsDouble("Level"));
         db.DBCommand.Parameters.Add(sd.AsUNIXTime("LastUpdated"));
         return(db.ExecuteNonQuery(db.DBCommand));
     }
 }