public bool UpdateField(string tableName, Database.TableField pKey, Database.TableField update) { string command = $"UPDATE {tableName} SET {update.Column.Text} = {update.FormattedValue()} WHERE {pKey.Column.Text} == {pKey.FormattedValue()}"; this.Db.Open(); int rowsImpacted = new SqliteCommand(command, this.Db).ExecuteNonQuery(); this.Db.Close(); return(rowsImpacted == 1); }
public bool Remove(string tableName, Database.TableField pKey) { string command = $"DELETE FROM {tableName} WHERE {pKey.Column.Text} == {pKey.FormattedValue()}"; this.Db.Open(); int rowsImpacted = new SqliteCommand(command, this.Db).ExecuteNonQuery(); this.Db.Close(); return(rowsImpacted == 1); }
protected bool Update(string key, Database.TableField field) { return(this.db.UpdateField(this.TableName, this.CreatePrimaryKeyField(key), field)); }
public List <string[]> Get(string tableName, Database.Comparison op, Database.TableField field) { return(this.Get(tableName, op, field, null)); }
protected List <T> Get(Database.Comparison op, Database.TableField field) { return(this.Get(op, field, null)); }