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)); } }
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)); } }