Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - jan.izyk

Pages: [1]
1
Hi Ian,

your code has just two small mistakes.
The first has been answered by Uffe.
The AddNew-function returns an object which will be your new tagged-value.

The second is, that you have not to call the Update-function of collection. You have to call the Update-function of your new tagged value.

Also the parameter of the AddNew-function are wrong. The first parameter is the name of the tagged-value (this is correct) but he second parameter is the type of your tagged-value not the value.

When I change your code, it should be corrected look like this
Code: [Select]
EA.TaggedValue newValue=(EA.TaggedValue)theElements.TaggedValues.AddNew("MyTagName", "string");
newValue.Value="MyTagValue";
newValue.Update()
theElements.TaggedValues.Refresh();

Jan

2
Outsch. Now I've got it.

In the autocompletition-window in Visual Studio, the function isn't seen.

I have to execute it with MY repository and not as a static function Execute of the Namespace Repository.

As a small example-function for everyone who doesn't have a clue like me
Code: [Select]
void executeSqlStatement(EA.Repository myRepository, string mySqlStatement)
{
  myRepository.Execute(mySqlStatement);
}

Thanks to you q and Uffe.

3
Hi querty,

thanks for your reply.

Now I have seen the Execute-function in the interface  IDualRepository.
But I can't get access to this function when myRepository is from type
EA.Repository.

So do you know, how I can get access to this function?

And thanks for the hint. I know, that it is dangerous to change the database directly. But sometimes it has to be done by this way.

4
Hi all,

I've got again a question about the C# API of EA.

With the command
Code: [Select]
myRepository.SQLQuery(...)I can execute select-statements to the database.
But with this function I can't execute something like insert-into statements.

But at the scripting-interface there is the function Repository.Execute which can execute insert-into statements.

So my question is:
Is there any possibility to execute insert-into/update/... statements via the C# API like in the scripts?

Regards
Jan

5
Automation Interface, Add-Ins and Tools / Re: Import rtf template via AddIn
« on: November 05, 2015, 08:31:50 pm »
Thanks for your fast replies.

OK then in case that the templates will change or a new document will be add to the list of documents, then I have to import them manually.
But because of that every other steps can be done automatically, this is a solution with which I can live.

Thanks again

6
Dear all,

first, hello to all this is my first post in this forum.

second, in parallel I have asked this question to the support of sparx systems. But they said, that they have to investigate my problem. So maybe some one of you has allready solved this problem.

So what I want to do:
I want to set the default behaviour of document generation in EA via an AddIn written in C#.

For this I am creating a virtual document with 1 master-document, several model-documents for each kind of document which shall be generated.

This step is done and works.

Each model-document will be connected with the packages, which shall be documented with this template.

This step is also done and works.

The next step is to import the created rtf-templates into the document generator and connect the templates with the model-documents.

And here is my problem.

First Problem:
I have found that via the command
Code: [Select]
repository.CreateDocumentGenerator()I can have access to the document generator. But I can't find the
method to import a rtf-file (e.g. from the local harddrive) as a new template.

Second Problem:
In EA12 I can connect the rtf-template with a model-document by right clicking on the model-document->Properties->Tags->RTFTemplate and choose there one rtf-template.
But when I have a look on the sql-database of this project, I can't find this link between the rtf-template and the model-document.

I hope this long explanation clarrifies where currently my problems are  ;).

Pages: [1]