Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
Ftt_Common
Project
Project
Details
Activity
Releases
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
Administrator
Ftt_Common
Commits
6fe49ab4
Commit
6fe49ab4
authored
Feb 10, 2022
by
段廷瑞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、更新日期记录逻辑优化
parent
0922e5ac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
16 deletions
+10
-16
Program.cs
Tools/Program.cs
+9
-2
wMain.cs
Tools/wMain.cs
+1
-14
No files found.
Tools/Program.cs
View file @
6fe49ab4
...
...
@@ -24,8 +24,15 @@ namespace Tools
Application
.
EnableVisualStyles
();
Application
.
SetCompatibleTextRenderingDefault
(
false
);
bool
isUpdated
=
args
.
Length
>
0
&&
args
[
0
]
==
"1"
;
Application
.
Run
(
new
wMain
(
isUpdated
));
//自动更新重启后,记录更新日期
if
(
args
.
Length
>
0
&&
args
[
0
]
==
"1"
)
{
var
m
=
Utils
.
GetJsonConfig
<
LoginMemory
>();
m
.
UpdateTime
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss.fff"
);
Utils
.
SaveJsonConfig
(
m
);
}
Application
.
Run
(
new
wMain
());
}
//UI未处理异常
...
...
Tools/wMain.cs
View file @
6fe49ab4
...
...
@@ -32,20 +32,14 @@ namespace Tools
/// 数据库访问对象
/// </summary>
DBHelper
_db
=
null
;
/// <summary>
/// 是否更新后启动
/// </summary>
bool
IsUpdated
=
false
;
public
wMain
(
bool
isUpdated
)
public
wMain
()
{
InitializeComponent
();
//基础属性设置
this
.
IsMdiContainer
=
true
;
//重置窗体大小
this
.
SetWinMinimized
();
//
this
.
IsUpdated
=
isUpdated
;
//窗体基本事件
this
.
Load
+=
WMain_Load
;
this
.
Shown
+=
WMain_Shown
;
...
...
@@ -269,13 +263,6 @@ namespace Tools
private
void
CheckUpdate
(
bool
IsSilentWhenNotFound
=
false
)
{
var
m
=
Utils
.
GetJsonConfig
<
LoginMemory
>();
//更新后打开,记录更新日期,并返回
if
(
IsUpdated
)
{
m
.
UpdateTime
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss.fff"
);
Utils
.
SaveJsonConfig
(
m
);
return
;
}
//检查更新
var
updateTime
=
m
.
UpdateTime
;
var
dt
=
this
.
_db
.
GetDataTable
(
$"SELECT TOP 1 UDate, URemark FROM dbo.FTT_AutoUpdate WHERE UDate > '
{
updateTime
}
' ORDER BY UDate DESC"
,
"FTT_AutoUpdate"
);
...
...
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