public void Update(String tableName, DBRow row, String filter) { String paramString = row.GenerateParamString(); String statement = "UPDATE " + tableName + " SET " + paramString + " WHERE " + filter; ExecuteWriteStatement(statement); }
public long Insert(String tableName, DBRow row) { String paramString = row.GenerateParamString(); String statement = "INSERT INTO " + tableName + " SET " + paramString; MySqlCommand cmd = ExecuteWriteStatement(statement); return(cmd.LastInsertedId); }
public long Write(String tableName, DBRow row) { if (row.ID == 0) { row.ID = Insert(tableName, row); } else { Update(tableName, row, row.ID); } return(row.ID); }
public void Update(String tableName, DBRow row, long id, String idName = "id") { String filter = tableName + "." + idName + "=" + id; Update(tableName, row, filter); }