개정판 4622d687
dev issue #1230 : set mapping info
Change-Id: I164bc1d6e35560ab97dcf2afd1da03f9b658a447
DTI_PID/APIDConverter/DB/Project_DB.cs | ||
---|---|---|
375 | 375 |
|
376 | 376 |
return dt; |
377 | 377 |
} |
378 |
public static DataTable SelectID2SymbolTable()
|
|
378 |
public static DataTable GetID2SymbolTable()
|
|
379 | 379 |
{ |
380 | 380 |
DataTable dt = new DataTable(); |
381 | 381 |
Project_Info projectInfo = Project_Info.GetInstance(); |
... | ... | |
435 | 435 |
|
436 | 436 |
return dt; |
437 | 437 |
} |
438 |
public static DataTable SelectSymbolType()
|
|
438 |
public static DataTable GetSymbolType()
|
|
439 | 439 |
{ |
440 | 440 |
DataTable dt = new DataTable(); |
441 | 441 |
Project_Info projectInfo = Project_Info.GetInstance(); |
... | ... | |
495 | 495 |
|
496 | 496 |
return dt; |
497 | 497 |
} |
498 |
public static DataTable SelectDrawings()
|
|
498 |
public static DataTable GetDrawings()
|
|
499 | 499 |
{ |
500 | 500 |
DataTable dt = new DataTable(); |
501 | 501 |
Project_Info projectInfo = Project_Info.GetInstance(); |
... | ... | |
863 | 863 |
|
864 | 864 |
return true; |
865 | 865 |
} |
866 |
public static DataTable SelectProjectAttribute()
|
|
866 |
public static DataTable GetProjectAttribute()
|
|
867 | 867 |
{ |
868 | 868 |
DataTable dt = new DataTable(); |
869 | 869 |
Project_Info projectInfo = Project_Info.GetInstance(); |
... | ... | |
940 | 940 |
|
941 | 941 |
return dt; |
942 | 942 |
} |
943 |
public static DataTable SelectProjectLineProperties()
|
|
943 |
public static DataTable GetProjectLineProperties()
|
|
944 | 944 |
{ |
945 | 945 |
DataTable dt = new DataTable(); |
946 | 946 |
Project_Info projectInfo = Project_Info.GetInstance(); |
... | ... | |
1012 | 1012 |
|
1013 | 1013 |
return dt; |
1014 | 1014 |
} |
1015 |
public static DataTable GetSymbolMappingTableOnlySymbol() |
|
1016 |
{ |
|
1017 |
DataTable dt = new DataTable(); |
|
1018 |
Project_Info projectInfo = Project_Info.GetInstance(); |
|
1019 |
if (projectInfo.DBType == ID2DB_Type.SQLite) |
|
1020 |
{ |
|
1021 |
using (SQLiteConnection connection = new SQLiteConnection(string.Format(CultureInfo.CurrentCulture, "Data Source = {0}", projectInfo.DBFilePath))) |
|
1022 |
{ |
|
1023 |
try |
|
1024 |
{ |
|
1025 |
connection.Open(); |
|
1026 |
using (SQLiteCommand cmd = connection.CreateCommand()) |
|
1027 |
{ |
|
1028 |
cmd.CommandText = string.Format("SELECT * FROM {0}", APID_SYMBOL_MAPPING_TABLE); |
|
1029 |
using (SQLiteDataReader dr = cmd.ExecuteReader()) |
|
1030 |
dt.Load(dr); |
|
1031 |
} |
|
1032 |
connection.Close(); |
|
1033 |
} |
|
1034 |
catch (Exception ex) |
|
1035 |
{ |
|
1036 |
Log.Write(ex.Message + "\r\n" + ex.StackTrace); |
|
1037 |
} |
|
1038 |
finally |
|
1039 |
{ |
|
1040 |
connection.Dispose(); |
|
1041 |
} |
|
1042 |
} |
|
1043 |
} |
|
1044 |
else if (projectInfo.DBType == ID2DB_Type.MSSQL) |
|
1045 |
{ |
|
1046 |
using (SqlConnection connection = GetSqlConnection()) |
|
1047 |
{ |
|
1048 |
try |
|
1049 |
{ |
|
1050 |
if (connection != null && connection.State == ConnectionState.Open) |
|
1051 |
{ |
|
1052 |
using (SqlCommand cmd = connection.CreateCommand()) |
|
1053 |
{ |
|
1054 |
cmd.CommandText = string.Format("SELECT * FROM {0}", APID_SYMBOL_MAPPING_TABLE); |
|
1055 |
using (SqlDataReader dr = cmd.ExecuteReader()) |
|
1056 |
dt.Load(dr); |
|
1057 |
} |
|
1058 |
connection.Close(); |
|
1059 |
} |
|
1060 |
} |
|
1061 |
catch (Exception ex) |
|
1062 |
{ |
|
1063 |
Log.Write(ex.Message + "\r\n" + ex.StackTrace); |
|
1064 |
} |
|
1065 |
finally |
|
1066 |
{ |
|
1067 |
if (connection != null) |
|
1068 |
connection.Dispose(); |
|
1069 |
} |
|
1070 |
} |
|
1071 |
} |
|
1072 |
|
|
1073 |
return dt; |
|
1074 |
} |
|
1075 |
public static DataTable GetAttributeMappingTableOnlyAttribute() |
|
1076 |
{ |
|
1077 |
DataTable dt = new DataTable(); |
|
1078 |
Project_Info projectInfo = Project_Info.GetInstance(); |
|
1079 |
if (projectInfo.DBType == ID2DB_Type.SQLite) |
|
1080 |
{ |
|
1081 |
using (SQLiteConnection connection = new SQLiteConnection(string.Format(CultureInfo.CurrentCulture, "Data Source = {0}", projectInfo.DBFilePath))) |
|
1082 |
{ |
|
1083 |
try |
|
1084 |
{ |
|
1085 |
connection.Open(); |
|
1086 |
using (SQLiteCommand cmd = connection.CreateCommand()) |
|
1087 |
{ |
|
1088 |
cmd.CommandText = string.Format("SELECT * FROM {0}", APID_ATTRIBUTE_MAPPING_TABLE); |
|
1089 |
using (SQLiteDataReader dr = cmd.ExecuteReader()) |
|
1090 |
dt.Load(dr); |
|
1091 |
} |
|
1092 |
connection.Close(); |
|
1093 |
} |
|
1094 |
catch (Exception ex) |
|
1095 |
{ |
|
1096 |
Log.Write(ex.Message + "\r\n" + ex.StackTrace); |
|
1097 |
} |
|
1098 |
finally |
|
1099 |
{ |
|
1100 |
connection.Dispose(); |
|
1101 |
} |
|
1102 |
} |
|
1103 |
} |
|
1104 |
else if (projectInfo.DBType == ID2DB_Type.MSSQL) |
|
1105 |
{ |
|
1106 |
using (SqlConnection connection = GetSqlConnection()) |
|
1107 |
{ |
|
1108 |
try |
|
1109 |
{ |
|
1110 |
if (connection != null && connection.State == ConnectionState.Open) |
|
1111 |
{ |
|
1112 |
using (SqlCommand cmd = connection.CreateCommand()) |
|
1113 |
{ |
|
1114 |
cmd.CommandText = string.Format("SELECT * FROM {0}", APID_ATTRIBUTE_MAPPING_TABLE); |
|
1115 |
using (SqlDataReader dr = cmd.ExecuteReader()) |
|
1116 |
dt.Load(dr); |
|
1117 |
} |
|
1118 |
connection.Close(); |
|
1119 |
} |
|
1120 |
} |
|
1121 |
catch (Exception ex) |
|
1122 |
{ |
|
1123 |
Log.Write(ex.Message + "\r\n" + ex.StackTrace); |
|
1124 |
} |
|
1125 |
finally |
|
1126 |
{ |
|
1127 |
if (connection != null) |
|
1128 |
connection.Dispose(); |
|
1129 |
} |
|
1130 |
} |
|
1131 |
} |
|
1132 |
|
|
1133 |
return dt; |
|
1134 |
} |
|
1015 | 1135 |
#endregion |
1016 | 1136 |
|
1017 | 1137 |
#region AVEVA |
내보내기 Unified diff