개정판 e9ed6b7b
dev issue #1227 : mapping 화면 및 Default symbol modeling
Change-Id: I21818ac2905647092cf2dafc46a8e7663346512c
DTI_PID/APIDConverter/DB/Project_DB.cs | ||
---|---|---|
299 | 299 |
|
300 | 300 |
return dt; |
301 | 301 |
} |
302 |
|
|
303 |
|
|
304 |
#region AVEVA |
|
305 |
private static string GetAvevaConnectionString() |
|
306 |
{ |
|
307 |
string strConn = string.Empty; |
|
308 |
if (Utilities.strSQLWinAuthentication.ToUpper() == "YES") |
|
309 |
{ |
|
310 |
strConn = String.Format("Data Source=" + Utilities.strSQLServerName + ";Integrated Security=SSPI;Initial Catalog={0};", Utilities.strSQLDatabaseName); |
|
311 |
} |
|
312 |
else if (Utilities.strSQLWinAuthentication.ToUpper() == "NO") |
|
313 |
{ |
|
314 |
string strAccessString = "User ID=" + Utilities.strSQLUserName + ";Password=" + Utilities.strSQLPassword; |
|
315 |
strConn = String.Format("Data Source=" + Utilities.strSQLServerName + ";Initial Catalog=" + Utilities.strSQLDatabaseName + ";" + strAccessString); |
|
316 |
} |
|
317 |
|
|
318 |
return strConn; |
|
319 |
} |
|
320 |
|
|
321 |
private static string GetAvevaConnectionString_Reports() |
|
322 |
{ |
|
323 |
string strConn = string.Empty; |
|
324 |
if (Utilities.strSQLWinAuthentication.ToUpper() == "YES") |
|
325 |
{ |
|
326 |
strConn = String.Format("Data Source=" + Utilities.strSQLServerName + ";Integrated Security=SSPI;Initial Catalog={0};", Utilities.strSQLReportsDatabaseName); |
|
327 |
} |
|
328 |
else if (Utilities.strSQLWinAuthentication.ToUpper() == "NO") |
|
329 |
{ |
|
330 |
string strAccessString = "User ID=" + Utilities.strSQLUserName + ";Password=" + Utilities.strSQLPassword; |
|
331 |
strConn = String.Format("Data Source=" + Utilities.strSQLServerName + ";Initial Catalog=" + Utilities.strSQLReportsDatabaseName + ";" + strAccessString); |
|
332 |
} |
|
333 |
|
|
334 |
return strConn; |
|
335 |
} |
|
336 |
|
|
337 |
private static string GetAvevaConnectionString_Admin() |
|
338 |
{ |
|
339 |
string strConn = string.Empty; |
|
340 |
if (Utilities.strSQLWinAuthentication.ToUpper() == "YES") |
|
341 |
{ |
|
342 |
strConn = String.Format("Data Source=" + Utilities.strSQLServerName + ";Integrated Security=SSPI;Initial Catalog={0};", Utilities.strSQLAdminDatabaseName); |
|
343 |
} |
|
344 |
else if (Utilities.strSQLWinAuthentication.ToUpper() == "NO") |
|
345 |
{ |
|
346 |
string strAccessString = "User ID=" + Utilities.strSQLUserName + ";Password=" + Utilities.strSQLPassword; |
|
347 |
strConn = String.Format("Data Source=" + Utilities.strSQLServerName + ";Initial Catalog=" + Utilities.strSQLAdminDatabaseName + ";" + strAccessString); |
|
348 |
} |
|
349 |
|
|
350 |
return strConn; |
|
351 |
} |
|
352 |
|
|
353 |
public static DataTable SelectSymbolTable() |
|
354 |
{ |
|
355 |
DataTable dt = new DataTable(); |
|
356 |
|
|
357 |
using (SqlConnection connection = new SqlConnection()) |
|
358 |
{ |
|
359 |
connection.ConnectionString = GetAvevaConnectionString_Admin(); |
|
360 |
connection.Open(); |
|
361 |
using (SqlCommand cmd = connection.CreateCommand()) |
|
362 |
{ |
|
363 |
cmd.CommandText = string.Format("SELECT * FROM {0}", "SYMBOLS"); |
|
364 |
using (SqlDataReader dr = cmd.ExecuteReader()) |
|
365 |
dt.Load(dr); |
|
366 |
} |
|
367 |
connection.Close(); |
|
368 |
} |
|
369 |
|
|
370 |
return dt; |
|
371 |
} |
|
372 |
|
|
373 |
#endregion |
|
374 |
|
|
302 | 375 |
} |
303 | 376 |
} |
내보내기 Unified diff