개정판 81d15568
issue #0000
ID2 프로젝트 정보 조회 진행
Change-Id: I48213e8fd4bb8bb8045e07e7a2f3cbcd5080e92b
ID2.Manager/ID2.Manager.Controller/Controllers/BaseController.cs | ||
---|---|---|
20 | 20 |
{ |
21 | 21 |
this._DbConnectionStr = ConfigurationManager.ConnectionStrings["ID2Manager"].ToString(); |
22 | 22 |
_MarkusConnectionStr = ConfigurationManager.ConnectionStrings["Markus"].ToString(); |
23 |
this._SQLITEDbConnectionStr = ConfigurationManager.AppSettings["ID2"].ToString();
|
|
23 |
this._SQLITEDbConnectionStr = $"Data Source={Environment.GetFolderPath(Environment.SpecialFolder.UserProfile, Environment.SpecialFolderOption.DoNotVerify)}{ConfigurationManager.AppSettings["ID2"]};Version=3;";
|
|
24 | 24 |
} |
25 | 25 |
} |
26 | 26 |
} |
ID2.Manager/ID2.Manager.Controller/Controllers/ID2Controller.cs | ||
---|---|---|
12 | 12 |
{ |
13 | 13 |
public class ID2Controller : BaseController |
14 | 14 |
{ |
15 |
public IEnumerable<ProjectInfo> GetProjectGroupList()
|
|
15 |
public IEnumerable<ID2ProjectInfo> GetID2ProjectList()
|
|
16 | 16 |
{ |
17 | 17 |
using (ID2Repository rep = new ID2Repository(this._SQLITEDbConnectionStr, DatabaseType.SQLITE)) |
18 | 18 |
{ |
ID2.Manager/ID2.Manager.Dapper/Repository/BaseRepository.cs | ||
---|---|---|
86 | 86 |
|
87 | 87 |
public SQLiteConnection SQLiteDBConnection(string connectionStr) |
88 | 88 |
{ |
89 |
if (System.IO.Directory.Exists(connectionStr)) |
|
90 |
{ |
|
91 |
throw new Exception("ID2 db file does not exist."); |
|
92 |
} |
|
93 |
|
|
89 | 94 |
return new SQLiteConnection(connectionStr, true); |
90 | 95 |
} |
91 | 96 |
|
ID2.Manager/ID2.Manager.Dapper/Repository/ID2Repository.cs | ||
---|---|---|
14 | 14 |
{ |
15 | 15 |
public ID2Repository(string connectionStr, DatabaseType databaseType) : base(connectionStr, databaseType) { } |
16 | 16 |
|
17 |
public IEnumerable<ProjectInfo> GetID2ProjectList() |
|
17 |
public IEnumerable<ID2ProjectInfo> GetID2ProjectList()
|
|
18 | 18 |
{ |
19 | 19 |
string query = $@" |
20 |
select * from dbo.Projects";
|
|
21 |
return Query<ProjectInfo>(query); |
|
20 |
SELECT * FROM Projects ORDER BY Id";
|
|
21 |
return Query<ID2ProjectInfo>(query);
|
|
22 | 22 |
} |
23 | 23 |
} |
24 | 24 |
} |
ID2.Manager/ID2.Manager.Data/Models/ProjectInfo.cs | ||
---|---|---|
28 | 28 |
[DataMember] |
29 | 29 |
public int Level { get; set; } |
30 | 30 |
} |
31 |
|
|
32 |
[DataContract] |
|
33 |
public class ID2ProjectInfo |
|
34 |
{ |
|
35 |
[DataMember] |
|
36 |
public int Id { get; set; } |
|
37 |
[DataMember] |
|
38 |
public string ProjectID { get; set; } |
|
39 |
[DataMember] |
|
40 |
public string ProjectNo { get; set; } |
|
41 |
[DataMember] |
|
42 |
public string Name { get; set; } |
|
43 |
[DataMember] |
|
44 |
public string Desc { get; set; } |
|
45 |
[DataMember] |
|
46 |
public string Unit { get; set; } |
|
47 |
[DataMember] |
|
48 |
public string NPSUnit { get; set; } |
|
49 |
[DataMember] |
|
50 |
public string Path { get; set; } |
|
51 |
[DataMember] |
|
52 |
public string AreaNam { get; set; } |
|
53 |
[DataMember] |
|
54 |
public string PlantName { get; set; } |
|
55 |
[DataMember] |
|
56 |
public DateTime CreatedDate { get; set; } |
|
57 |
[DataMember] |
|
58 |
public DateTime UpdatedDate { get; set; } |
|
59 |
} |
|
31 | 60 |
} |
ID2.Manager/ID2.Manager.sln | ||
---|---|---|
1 | 1 |
|
2 | 2 |
Microsoft Visual Studio Solution File, Format Version 12.00 |
3 |
# Visual Studio Version 17
|
|
4 |
VisualStudioVersion = 17.6.33513.286
|
|
3 |
# Visual Studio Version 16
|
|
4 |
VisualStudioVersion = 16.0.31624.102
|
|
5 | 5 |
MinimumVisualStudioVersion = 10.0.40219.1 |
6 | 6 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ID2.Manager", "ID2.Manager\ID2.Manager.csproj", "{226CE2A3-DD88-4C99-A8E6-FAC5A4D78C71}" |
7 | 7 |
EndProject |
ID2.Manager/ID2.Manager/App.config | ||
---|---|---|
17 | 17 |
</connectionStrings> |
18 | 18 |
<appSettings> |
19 | 19 |
<!--add key="ID2" value="%USERNAME%\Digital PID\Project.db" /--> |
20 |
<add key="ID2" value="c:\Digital PID\Project.db" />
|
|
20 |
<add key="ID2" value="\Digital PID\Project.db" /> |
|
21 | 21 |
</appSettings> |
22 | 22 |
<userSettings> |
23 | 23 |
<ID2.Manager.Properties.Settings> |
내보내기 Unified diff