private void Counter() { lock(this) { opRecordId = opRecordIdCount++; if (opRecordIdCount > 1000) opRecordIdCount = 1; } }