Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
Thick-Common
Commits
682d3e2c
Commit
682d3e2c
authored
Mar 26, 2021
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化 initparam 保存的不再是 数据库文件名路径,而且数据库文件夹路径。 确保数据库名字不会改变
parent
d1eb223d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
25 deletions
+10
-25
PgInitparam.xaml.cs
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgInitparam.xaml.cs
+6
-21
InitParamServiceClient.cs
...hick.Base/FLY.Thick.Base/Client/InitParamServiceClient.cs
+1
-1
IInitParamService.cs
...Y.Thick.Base/FLY.Thick.Base/IService/IInitParamService.cs
+1
-1
InitParam.cs
Project.FLY.Thick.Base/FLY.Thick.Base/Server/InitParam.cs
+2
-2
No files found.
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgInitparam.xaml.cs
View file @
682d3e2c
...
...
@@ -216,7 +216,7 @@ namespace FLY.Thick.Base.UI
Misc
.
BindingOperations
.
SetBinding
(
initParamService
,
nameof
(
initParamService
.
HVelocity1
),
this
,
nameof
(
HVelocity1
));
Misc
.
BindingOperations
.
SetBinding
(
initParamService
,
nameof
(
initParamService
.
HVelocity2
),
this
,
nameof
(
HVelocity2
));
Misc
.
BindingOperations
.
SetBinding
(
initParamService
,
nameof
(
initParamService
.
DBKeepMonth
),
this
,
nameof
(
DBKeepMonth
));
Misc
.
BindingOperations
.
SetBinding
(
initParamService
,
nameof
(
initParamService
.
DbPath
),
this
,
nameof
(
DbPath
));
Misc
.
BindingOperations
.
SetBinding
(
initParamService
,
nameof
(
initParamService
.
Db
Dir
Path
),
this
,
nameof
(
DbPath
));
Misc
.
BindingOperations
.
SetBinding
(
initParamService
,
nameof
(
initParamService
.
PunchOffset
),
this
,
nameof
(
PunchOffset
));
Misc
.
BindingOperations
.
SetBinding
(
initParamService
,
nameof
(
initParamService
.
HasPunch
),
this
,
nameof
(
HasPunch
));
...
...
@@ -256,7 +256,7 @@ namespace FLY.Thick.Base.UI
initParamService
.
HVelocity1
=
this
.
HVelocity1
;
initParamService
.
HVelocity2
=
this
.
HVelocity2
;
initParamService
.
DBKeepMonth
=
this
.
DBKeepMonth
;
initParamService
.
DbPath
=
this
.
DbPath
;
initParamService
.
Db
Dir
Path
=
this
.
DbPath
;
initParamService
.
HasPunch
=
this
.
HasPunch
;
initParamService
.
PunchOffset
=
this
.
PunchOffset
;
...
...
@@ -275,29 +275,14 @@ namespace FLY.Thick.Base.UI
private
void
SelectDbPath
()
{
System
.
Windows
.
Forms
.
FileDialog
open
=
new
System
.
Windows
.
Forms
.
OpenFileDialog
();
open
.
Filter
=
"sqlite3文件|*.sqlite3|所有文件|*.*"
;
open
.
Title
=
"打开音乐文件"
;
if
(
System
.
IO
.
Path
.
IsPathRooted
(
DbPath
))
open
.
InitialDirectory
=
System
.
IO
.
Path
.
GetDirectoryName
(
DbPath
);
else
open
.
InitialDirectory
=
System
.
Environment
.
CurrentDirectory
;
System
.
Windows
.
Forms
.
FolderBrowserDialog
open
=
new
System
.
Windows
.
Forms
.
FolderBrowserDialog
();
open
.
SelectedPath
=
DbPath
;
if
(
open
.
ShowDialog
()
==
System
.
Windows
.
Forms
.
DialogResult
.
OK
)
{
string
currentDirectory
=
System
.
Environment
.
CurrentDirectory
.
ToLower
();
string
filename
=
open
.
FileName
.
ToLower
();
if
(
filename
.
StartsWith
(
currentDirectory
))
{
//CurrentDirectory没有最后的\ 需要+1
DbPath
=
open
.
FileName
.
Substring
(
System
.
Environment
.
CurrentDirectory
.
Length
+
1
);
}
else
{
DbPath
=
open
.
FileName
;
}
DbPath
=
open
.
SelectedPath
;
}
}
}
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Client/InitParamServiceClient.cs
View file @
682d3e2c
...
...
@@ -206,7 +206,7 @@ namespace FLY.Thick.Base.Client
/// <summary>
/// 数据库路径
/// </summary>
public
string
DbPath
{
get
;
set
;
}
public
string
Db
Dir
Path
{
get
;
set
;
}
#
endregion
public
void
Apply
()
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/IService/IInitParamService.cs
View file @
682d3e2c
...
...
@@ -166,7 +166,7 @@ namespace FLY.Thick.Base.IService
/// <summary>
/// 数据库路径
/// </summary>
string
DbPath
{
get
;
set
;
}
string
Db
Dir
Path
{
get
;
set
;
}
/// <summary>
/// 参数应用
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Server/InitParam.cs
View file @
682d3e2c
...
...
@@ -193,7 +193,7 @@ namespace FLY.Thick.Base.Server
/// <summary>
/// 数据库路径
/// </summary>
public
string
Db
Path
{
get
;
set
;
}
=
@"D:\flydata\history.sqlite3
"
;
public
string
Db
DirPath
{
get
;
set
;
}
=
@"D:\flydata
"
;
#
endregion
...
...
@@ -242,7 +242,7 @@ namespace FLY.Thick.Base.Server
/// </summary>
void
Save
()
{
string
json
=
Newtonsoft
.
Json
.
JsonConvert
.
SerializeObject
(
this
);
string
json
=
Newtonsoft
.
Json
.
JsonConvert
.
SerializeObject
(
this
,
Newtonsoft
.
Json
.
Formatting
.
Indented
);
File
.
WriteAllText
(
param_path
,
json
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment