개정판 685855be
Fix: ID2 Project DB 경로를 찾아 appSetting에 저장한다.
Change-Id: Id316be9cd91db1895c153eb43ad6500e18c1afa8
ID2.Manager/ID2.Manager/Forms/Login.cs | ||
---|---|---|
14 | 14 |
|
15 | 15 |
using Telerik.WinControls; |
16 | 16 |
using Telerik.WinControls.UI; |
17 |
using System.Configuration; |
|
17 | 18 |
|
18 | 19 |
namespace ID2.Manager.Forms |
19 | 20 |
{ |
... | ... | |
82 | 83 |
{ |
83 | 84 |
if (!IsValidatioin()) return; |
84 | 85 |
|
86 |
|
|
87 |
#region ID2 Project DB 경로를 찾아 appSetting에 저장한다. |
|
88 |
Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); |
|
89 |
string ID2SQLiteInfo = configuration.AppSettings.Settings["ID2SQLiteInfo"].Value; |
|
90 |
if (!System.IO.File.Exists(ID2SQLiteInfo)) |
|
91 |
{ |
|
92 |
ID2SQLiteInfo = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Digital PID", "Project.db"); |
|
93 |
if (!System.IO.File.Exists(ID2SQLiteInfo)) |
|
94 |
{ |
|
95 |
Telerik.WinControls.RadMessageBox.Show($"Can't find {ID2SQLiteInfo} file."); |
|
96 |
|
|
97 |
Telerik.WinControls.UI.RadOpenFileDialog openFileDialog = new Telerik.WinControls.UI.RadOpenFileDialog(); |
|
98 |
openFileDialog.Filter = "SQLite|*.db|"; |
|
99 |
if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) |
|
100 |
{ |
|
101 |
configuration.AppSettings.Settings["ID2SQLiteInfo"].Value = openFileDialog.FileName; |
|
102 |
configuration.Save(); |
|
103 |
ConfigurationManager.RefreshSection("appSettings"); |
|
104 |
} |
|
105 |
} |
|
106 |
else |
|
107 |
{ |
|
108 |
configuration.AppSettings.Settings["ID2SQLiteInfo"].Value = ID2SQLiteInfo; |
|
109 |
configuration.Save(); |
|
110 |
ConfigurationManager.RefreshSection("appSettings"); |
|
111 |
} |
|
112 |
} |
|
113 |
#endregion |
|
114 |
|
|
85 | 115 |
//DB연결해서 체크로직추가 |
86 | 116 |
UserInfo userInfo = new UserController().GetUserInfo(this.radTextBoxID.Text, Globals.EncryptionSHA256(this.radTextBoxPW.Text)); |
87 | 117 |
|
내보내기 Unified diff