C# how to get diagram name of element - Enterprise Architect [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I need to get diagram`s name of specific elements. Is it possible ?
I added elements note with specific stereotypu using profile to EA project. Then i want create a plugin where i find this notes and diagram names where they are located. (i want export notes and diagram names to excel)....PS: Sorry for my bad english

Issue a SQL like
Repository.SQLQuery("SELECT t_diagram.name FROM t_diagramobjects AS dobj INNER JOIN t_diagram ON dobj.diagram_id = t_diagram.diagram_id WHERE t_diagramobjects.Object_ID = <elementID>"
Just replace <elementID> with the element's elementID. You could alternatively retrieve the diagram GUID (t_diagram.ea_guid') and get the diagram details viaRepostory.GetDiagramByGUID`.

Related

Returning a list of objects from a function to a text file C# [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I have a big function that returns a list of objects. I basically need the results to be put in to a text file. The list contains objects of a class with attributes string Index and integer count. I would want it to be written in a textfile like:
Index : Count fe.
BOOK_FROM_STORE : 27
Anybody has some guidance?
Parse the data held by your object to string and then write it to a text file.

How to align content from a lump of data from sql to web? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have a text in SQL like: "I want to eat. I'm hungry."
I use ASP.NET MVC to get data from database:
#Model.content
#Model.content is "I want to eat. I'm hungry."
I want to format text to display, for example, it might come down the line:
I want to eat.
I'm hungry.
Since, you don't prefer saving "\n" in the database, you can just split the entire into an array and loop through each item to display it with breaks. use Split
Something like:
#foreach (var item in Model.content.Split(".")) { #item <br /> }

using SQL SERVER can create xml Document like [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
IN SQL SERVER can create XML Document like following format with every column name come with Datafield FieldName="Batch"
CID,BATCH,EXP_DATE are column names.
enter image description here
Try something like
SELECT 'BATCH' AS [DataField/#fieldName]
,BATCH AS [DataField]
,''
,'EXP_DATE' AS [DataField/#fieldName]
,EXP_Date AS [DataField]
FROM SomeWhere
FOR XML PATH('Memory');
The empty string in the middle is needed to start a new element
And be aware, that the dateformat will be ISO8601 and not 190615 (you should be happy about this!)
If you want to achieve XML document creation from C#, then it can be achieved through ADO.net with Help of DataSet. Method name is DataSet.WriteXml(string Filename).

How do I split a comma-separated string in a SQL Server table using MVC? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a SQL Server table Product with a column ProductAvailableSizes that records the sizes which are currently available for a product.
So I might have ProductAvailableSizes = 38, 39, 40, 41. I want this string to be split in my mvc view and each of these string should be placed in a div without comma.
Anyone who used an online web shop may know what I mean. I haven't tried anything so far as I am very new to the programming. Help please.
You can use Split method, Something like this inside your view:
#{
var ProductAvailableSizes = Model.ProductAvailableSizes.Split(',');
}
foreach(var item in ProductAvailableSizes)
{
<div>#item</div>
}

C# Using regex, how to find a language in url [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a class library to add a customized toolbox to a external IE browser.
I'm using SHDocVw to do the back/forward buttons (e. g.). My question is, sense this is multilingual, how can I change the buttons text...
The url give me "/en/" or "/ar/", how can i catch this?
Thanks
With the Mati Cicero answer I managed to do it.
string page = ie.LocationURL;
Regex rgx = new Regex(#"https?://[a-zA-Z0-9.-_]+(/((?'lang'ar|en)|.*))/?");
var lang = rgx.Match(page).Success ? rgx.Match(page).Groups[1].Value : "ar";
You can try the following regex, I tried to make it as much generic as I could:
https?:\/\/[a-zA-Z0-9\.\-_]+(\/((?'lang'es|en)|.*))\/?
You would then examine the group "lang" to see if a match was made.
You would aso like to add more available languages (Added ch and in):
https?:\/\/[a-zA-Z0-9\.\-_]+(\/((?'lang'es|en|ch|in)|.*))\/?
If its always the first directory;
var lang = new Uri("http://sitename.com/en/pages/default.aspx")
.Segments[1].Replace("/", string.Empty).ToLower();

Categories