개정판 fe57f64a
issue #0000
ID2 DB 별 접속을 위한 BaseController 수정
Document 의 ID2 수정날짜 조회 적용(수정필요) - Main 화면에 ID2 ID2 완료일 적용버튼 추가
ID2 DB 별 접속 조회 개발
ID2 Drawings 모델 생성
Change-Id: I2e2a6dd06fec30688dce33f0c4d25f3d0385fa8c
ID2.Manager/ID2.Manager.Controller/Controllers/BaseController.cs | ||
---|---|---|
6 | 6 |
|
7 | 7 |
using System.Configuration; |
8 | 8 |
|
9 |
using ID2.Manager.Dapper; |
|
10 |
using ID2.Manager.Data.Models; |
|
11 |
|
|
9 | 12 |
namespace ID2.Manager.Controller.Controllers |
10 | 13 |
{ |
11 | 14 |
public class BaseController |
12 | 15 |
{ |
13 | 16 |
public Exception Exception; |
14 | 17 |
|
15 |
public string _DbConnectionStr = string.Empty; |
|
16 |
public string _MarkusConnectionStr = string.Empty; |
|
17 |
public string _SQLITEDbConnectionStr = string.Empty; |
|
18 |
public readonly string _MSSQLCONNSTR; |
|
19 |
public readonly string _SQLITECONNSTR; |
|
20 |
public readonly string _MARKUSCONNSTR; |
|
21 |
public readonly string _ID2CONNSTR; |
|
22 |
|
|
23 |
public BaseController() : this(null) { } |
|
18 | 24 |
|
19 |
public BaseController() |
|
25 |
public BaseController(ID2ProjectInfo id2Info)
|
|
20 | 26 |
{ |
21 |
this._DbConnectionStr = ConfigurationManager.ConnectionStrings["ID2Manager"].ToString(); |
|
22 |
_MarkusConnectionStr = ConfigurationManager.ConnectionStrings["Markus"].ToString(); |
|
23 |
this._SQLITEDbConnectionStr = $"Data Source={Environment.GetFolderPath(Environment.SpecialFolder.UserProfile, Environment.SpecialFolderOption.DoNotVerify)}{ConfigurationManager.AppSettings["ID2"]};Version=3;"; |
|
27 |
this._MSSQLCONNSTR = ConfigurationManager.ConnectionStrings["ID2Manager"].ConnectionString; |
|
28 |
this._SQLITECONNSTR = String.Format(ConfigurationManager.AppSettings["ID2SQLite"], System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ConfigurationManager.AppSettings["ID2SQLiteInfo"])); |
|
29 |
this._MARKUSCONNSTR = ConfigurationManager.ConnectionStrings["Markus"].ToString(); |
|
30 |
|
|
31 |
if (id2Info != null) |
|
32 |
{ |
|
33 |
DatabaseType DBType = (DatabaseType)Enum.Parse(typeof(DatabaseType), id2Info.DBTypeName.ToUpper()); |
|
34 |
switch (DBType) |
|
35 |
{ |
|
36 |
case DatabaseType.MSSQL: |
|
37 |
this._ID2CONNSTR = String.Format(ConfigurationManager.ConnectionStrings["ID2Project"].ConnectionString, id2Info.Host, id2Info.DBPath, id2Info.User, id2Info.Password); |
|
38 |
break; |
|
39 |
case DatabaseType.SQLITE: |
|
40 |
this._ID2CONNSTR = String.Format(ConfigurationManager.AppSettings["ID2SQLite"], id2Info.DBPath); |
|
41 |
break; |
|
42 |
default: |
|
43 |
this._ID2CONNSTR = string.Empty; |
|
44 |
break; |
|
45 |
} |
|
46 |
} |
|
24 | 47 |
} |
25 | 48 |
} |
26 | 49 |
} |
내보내기 Unified diff