개정판 d7341835
dev issue #000 : For GS
DTI_PID/SPPIDConverter_AutoModeling/DB/DB.cs | ||
---|---|---|
424 | 424 |
|
425 | 425 |
return attributes.Distinct().ToList(); |
426 | 426 |
} |
427 |
|
|
428 |
public static bool CheckFluidCode(string value, out string code) |
|
429 |
{ |
|
430 |
bool bResult = false; |
|
431 |
code = ""; |
|
432 |
|
|
433 |
DBInformation dbInfo = DBInformation.GetInstance(); |
|
434 |
try |
|
435 |
{ |
|
436 |
if (dbInfo.DBType == "ORACLE") |
|
437 |
{ |
|
438 |
string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service); |
|
439 |
connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword; |
|
440 |
|
|
441 |
using (OracleConnection conn = new OracleConnection(connString)) |
|
442 |
{ |
|
443 |
conn.Open(); |
|
444 |
if (conn.State == System.Data.ConnectionState.Open) |
|
445 |
{ |
|
446 |
using (OracleCommand cmd = new OracleCommand()) |
|
447 |
{ |
|
448 |
cmd.Connection = conn; |
|
449 |
cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT CODELIST_INDEX FROM {0}.CODELISTS WHERE CODELIST_NUMBER = 19 AND CODELIST_TEXT = '{1}'", dbInfo.PlantPIDDic, value); |
|
450 |
|
|
451 |
using (OracleDataReader reader = cmd.ExecuteReader()) |
|
452 |
{ |
|
453 |
while (reader.Read()) |
|
454 |
{ |
|
455 |
code = reader["CODELIST_INDEX"].ToString(); |
|
456 |
bResult = true; |
|
457 |
break; |
|
458 |
} |
|
459 |
} |
|
460 |
} |
|
461 |
} |
|
462 |
} |
|
463 |
} |
|
464 |
else |
|
465 |
{ |
|
466 |
|
|
467 |
} |
|
468 |
} |
|
469 |
catch (Exception ex) |
|
470 |
{ |
|
471 |
|
|
472 |
} |
|
473 |
|
|
474 |
return bResult; |
|
475 |
} |
|
427 | 476 |
} |
428 | 477 |
} |
내보내기 Unified diff