Example #1
0
        public void Update(String tableName, DBRow row, String filter)
        {
            String paramString = row.GenerateParamString();
            String statement   = "UPDATE " + tableName + " SET " + paramString + " WHERE " + filter;

            ExecuteWriteStatement(statement);
        }
Example #2
0
        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);
        }
Example #3
0
 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);
 }
Example #4
0
        public void Update(String tableName, DBRow row, long id, String idName = "id")
        {
            String filter = tableName + "." + idName + "=" + id;

            Update(tableName, row, filter);
        }