C# Класс EAAddinFramework.Utils.Model

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ClipboardClear ( ) : void

Expose Clipboard.Clear()

ClipboardGetText ( ) : string

Expose Clipboard.SetText()

ClipboardGetText ( int textDataType ) : string

Exposes ClipboardGetText(TestDataFormat); 0=TextDataFormat.CommaSeparatedValue; 1=TextDataFormat.Html; 2=TextDataFormat.Rtf; 3=TextDataFormat.Text; 4=TextDataFormat.UnicodeText;

ClipboardSetText ( object text ) : void

Expose Clipboard.SetText()

ClipboardSetText ( object text, object textDataType ) : void

Exposes ClipboardSetText(text, TestDataFormat); 0=TextDataFormat.CommaSeparatedValue; 1=TextDataFormat.Html; 2=TextDataFormat.Rtf; 3=TextDataFormat.Text; 4=TextDataFormat.UnicodeText;

EscapeSqlString ( string sqlString ) : string

escapes a literal string so it can be inserted using sql

ExecuteSql ( string sqlString ) : bool

Execute SQL and catch Exception

FormatXPath ( string xpath ) : string

formats an xpath according to the type of database. For Oracle and Firebird it should be ALL CAPS

GetRepositoryType ( ) : RepositoryType

Gets the rep type for this model

Initialize ( EA rep ) : void

Initialize an rep Model object Intended to use from a scripting environment

MakeEaItemListFromQuery ( System.Xml.Linq.XDocument x ) : List

Make EA XML output format from EA SQLQuery XDocument format (LINQ to XML)

MakeEaXmlOutput ( System.Xml.Linq.XDocument x ) : string

Make EA XML output format from EA SQLQuery XDocument format (LINQ to XML). If nothing found or an error has occurred nothing is displayed.

MakeEaXmlOutput ( string x ) : string

Make EA XML output format from EA SQLQuery format (string)

Model ( ) : System

Create a model on the first running EA instance

Model ( EA repository ) : System

Create a Model

SearchRun ( string searchName, string searchTerm ) : void

Runs the search (EA search or hoTools SQL file if it's a *.sql file). It handles the exceptions. It converts wild cards of the <Search Term>.

SqlExecuteNative ( string sqlExecute ) : bool

EA Execute SQL: - formatSQL - runSQL - return SQL string

SqlExecuteWithException ( string sql ) : bool

Run EA SQL Query with Exception handling return null if error, it also displays the error message in MessageBox return "" if nothing found return xml string if ok

SqlQuery ( string sqlQuery ) : XmlDocument

EA SQL Query with: - formatSQL - runSQL - return SQL string as XmlDocument

SqlQueryNative ( string sqlQuery ) : string

EA SQL Query native with: - formatSQL - runSQL - return SQL string

SqlQueryWithException ( string query ) : string

Run EA SQL Query with Exception handling. It deletes the error file and reads it back to detect errors. return null if error, it also displays the error message in MessageBox return "" if nothing found return xml string if ok

SqlRun ( string sql, string searchText ) : void

Run an SQL string and if query output the result in EA Search Window. If update, insert, delete execute SQL. - replacement of macros - run query - format to output

Приватные методы

Метод Описание
EmptyQueryResult ( ) : string

Empty Query Result

FormatSql ( string sqlQuery ) : string

sets the correct wild cards depending on the database type. changes '%' into '*' if on ms access and _ into ? on msAccess

FormatSqlFunctions ( string sqlQuery ) : string

Operation to translate SQL functions in there equivalents in different sql syntaxes supported functions: - lcase -> lower in T-SQL (SqlSvr and Asa)

FormatSqlTop ( string sqlQuery ) : string

limiting the number of results in an sql query is different on different platforms.

This operation will replace the SELECT TOP N by the appropriate sql syntax depending on the repository type

FormatSqldBspecific ( string sql ) : string

Format DB specific by removing unnecessary DB specific string parts.

ReplaceSqlWildCards ( string sqlQuery ) : string

Replace the wild cards in the given sql query string to match either MSAccess or ANSI syntax. It works for: % or * or #WC# Any character _ or ? a single character '^' or '!' a shortcut for XOR

Описание методов

ClipboardClear() публичный Метод

Expose Clipboard.Clear()
public ClipboardClear ( ) : void
Результат void

ClipboardGetText() публичный Метод

Expose Clipboard.SetText()
public ClipboardGetText ( ) : string
Результат string

ClipboardGetText() публичный Метод

Exposes ClipboardGetText(TestDataFormat); 0=TextDataFormat.CommaSeparatedValue; 1=TextDataFormat.Html; 2=TextDataFormat.Rtf; 3=TextDataFormat.Text; 4=TextDataFormat.UnicodeText;
public ClipboardGetText ( int textDataType ) : string
textDataType int
Результат string

ClipboardSetText() публичный Метод

Expose Clipboard.SetText()
public ClipboardSetText ( object text ) : void
text object
Результат void

ClipboardSetText() публичный Метод

Exposes ClipboardSetText(text, TestDataFormat); 0=TextDataFormat.CommaSeparatedValue; 1=TextDataFormat.Html; 2=TextDataFormat.Rtf; 3=TextDataFormat.Text; 4=TextDataFormat.UnicodeText;
public ClipboardSetText ( object text, object textDataType ) : void
text object
textDataType object
Результат void

EscapeSqlString() публичный Метод

escapes a literal string so it can be inserted using sql
public EscapeSqlString ( string sqlString ) : string
sqlString string the string to be escaped
Результат string

ExecuteSql() публичный Метод

Execute SQL and catch Exception
public ExecuteSql ( string sqlString ) : bool
sqlString string
Результат bool

FormatXPath() публичный Метод

formats an xpath according to the type of database. For Oracle and Firebird it should be ALL CAPS
public FormatXPath ( string xpath ) : string
xpath string the xpath to format
Результат string

GetRepositoryType() публичный Метод

Gets the rep type for this model
public GetRepositoryType ( ) : RepositoryType
Результат RepositoryType

Initialize() публичный Метод

Initialize an rep Model object Intended to use from a scripting environment
public Initialize ( EA rep ) : void
rep EA
Результат void

MakeEaItemListFromQuery() публичный Метод

Make EA XML output format from EA SQLQuery XDocument format (LINQ to XML)
public MakeEaItemListFromQuery ( System.Xml.Linq.XDocument x ) : List
x System.Xml.Linq.XDocument Output from EA SQLQuery
Результат List

MakeEaXmlOutput() публичный Метод

Make EA XML output format from EA SQLQuery XDocument format (LINQ to XML). If nothing found or an error has occurred nothing is displayed.
public MakeEaXmlOutput ( System.Xml.Linq.XDocument x ) : string
x System.Xml.Linq.XDocument Output from EA SQLQuery
Результат string

MakeEaXmlOutput() публичный Метод

Make EA XML output format from EA SQLQuery format (string)
public MakeEaXmlOutput ( string x ) : string
x string
Результат string

Model() публичный Метод

Create a model on the first running EA instance
public Model ( ) : System
Результат System

Model() публичный Метод

Create a Model
public Model ( EA repository ) : System
repository EA
Результат System

SearchRun() публичный Метод

Runs the search (EA search or hoTools SQL file if it's a *.sql file). It handles the exceptions. It converts wild cards of the <Search Term>.
public SearchRun ( string searchName, string searchTerm ) : void
searchName string EA Search name or SQL file name (uses path to find absolute path)
searchTerm string
Результат void

SqlExecuteNative() публичный Метод

EA Execute SQL: - formatSQL - runSQL - return SQL string
public SqlExecuteNative ( string sqlExecute ) : bool
sqlExecute string
Результат bool

SqlExecuteWithException() публичный Метод

Run EA SQL Query with Exception handling return null if error, it also displays the error message in MessageBox return "" if nothing found return xml string if ok
public SqlExecuteWithException ( string sql ) : bool
sql string
Результат bool

SqlQuery() публичный Метод

EA SQL Query with: - formatSQL - runSQL - return SQL string as XmlDocument
public SqlQuery ( string sqlQuery ) : XmlDocument
sqlQuery string
Результат System.Xml.XmlDocument

SqlQueryNative() публичный Метод

EA SQL Query native with: - formatSQL - runSQL - return SQL string
public SqlQueryNative ( string sqlQuery ) : string
sqlQuery string
Результат string

SqlQueryWithException() публичный Метод

Run EA SQL Query with Exception handling. It deletes the error file and reads it back to detect errors. return null if error, it also displays the error message in MessageBox return "" if nothing found return xml string if ok
public SqlQueryWithException ( string query ) : string
query string
Результат string

SqlRun() публичный Метод

Run an SQL string and if query output the result in EA Search Window. If update, insert, delete execute SQL. - replacement of macros - run query - format to output
public SqlRun ( string sql, string searchText ) : void
sql string
searchText string Search Text to replace 'Search Term' macro
Результат void