Book a Demo

Author Topic: Automatically switch on AuditView (Enable) via c#?  (Read 4485 times)

carolin.boeckler

  • EA User
  • **
  • Posts: 34
  • Karma: +0/-0
    • View Profile
Automatically switch on AuditView (Enable) via c#?
« on: October 25, 2012, 12:53:27 am »
Hello

I'd like to know if it is possible to switch on 'Audit View' - Enable Auditing via c# code?
I couldn't find anything. Or is it possible via Rep.Execute('INSERT INTO t_snapshot () VALUES ()';);

Caro

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Automatically switch on AuditView (Enable) via
« Reply #1 on: October 25, 2012, 04:45:58 am »
There's an entry in t_genopt.

q.

carolin.boeckler

  • EA User
  • **
  • Posts: 34
  • Karma: +0/-0
    • View Profile
Re: Automatically switch on AuditView (Enable) via
« Reply #2 on: November 12, 2012, 11:29:27 pm »
Thanks.
Now it works.
If anybody else likes to do this, here some help.

1. "INSERT INTO t_genopt (AppliesTo) VALUES ('auditing');" (I insert only a empty row and update it later, I don't know why it was not possible to insert everything at once)
2. "UPDATE t_genopt SET [Option]='reveng=0;xmiimport=0;xmiexport=0;auditOptions=4;dbtimestamp=0;enabled=1;auditLevel=131072;' WHERE [AppliesTo]='auditing'"
3. EA.Project CurrentProject = (EA.Project)Rep.GetProjectInterface(); CurrentProject.ReloadProject(); (ReloadCurrentProject)

Bye, Caro

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Automatically switch on AuditView (Enable) via
« Reply #3 on: November 13, 2012, 01:36:40 am »
Have you tried
Code: [Select]
INSERT INTO t_genopt (AppliesTo, Option) VALUES ('auditing', '....') after a DELETE? The INSERT only works if there was no 'auditing' beforehand.

q.
« Last Edit: November 13, 2012, 01:37:34 am by qwerty »

carolin.boeckler

  • EA User
  • **
  • Posts: 34
  • Karma: +0/-0
    • View Profile
Re: Automatically switch on AuditView (Enable) via
« Reply #4 on: November 13, 2012, 05:57:04 pm »
You're right, I tried the code:
INSERT INTO t_genopt (AppliesTo, Option) VALUES ('auditing', '....')
BUT NOT after a delete. I always opened a new project. But I have really no idea, why it was not working.

Caro