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
5d4df8c6
Commit
5d4df8c6
authored
Nov 20, 2021
by
段廷瑞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、增加操作日志及细节优化
parent
76443dc3
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
90 additions
and
16 deletions
+90
-16
Tools.exe.config
AppHome/Tools.exe.config
+1
-1
Log.cs
Tools/Log.cs
+49
-0
Common.cs
Tools/MyCommon/Common.cs
+6
-1
TabControlEx.Designer.cs
Tools/MyCommon/controls/TabControlEx.Designer.cs
+1
-1
TabControlEx.cs
Tools/MyCommon/controls/TabControlEx.cs
+1
-1
TabControlEx.resx
Tools/MyCommon/controls/TabControlEx.resx
+0
-0
Tools.csproj
Tools/Tools.csproj
+4
-3
wDbLinkMngr.Designer.cs
Tools/UI/wDbLinkMngr.Designer.cs
+5
-5
wDbLinkMngr.resx
Tools/UI/wDbLinkMngr.resx
+9
-0
wFlowShare.Designer.cs
Tools/UI/wFlowShare.Designer.cs
+1
-1
wSysChecker.cs
Tools/UI/wSysChecker.cs
+1
-1
wMain.Designer.cs
Tools/wMain.Designer.cs
+2
-2
wMain.cs
Tools/wMain.cs
+10
-0
No files found.
AppHome/Tools.exe.config
View file @
5d4df8c6
...
...
@@ -3,7 +3,7 @@
<
appSettings
>
<
add
key
=
"LoginInfo"
value
=
"wwF/xpBzWek="
/>
<
add
key
=
"LoginVerify"
value
=
"v86f5Q3Xa7U="
/>
<
add
key
=
"UpdateTime"
value
=
"2021-11-
11 16:09:54.74
3"
/>
<
add
key
=
"UpdateTime"
value
=
"2021-11-
20 16:38:06.27
3"
/>
</
appSettings
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.8"
/>
...
...
Tools/Log.cs
0 → 100644
View file @
5d4df8c6
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
//
using
Tools.MyCommon
;
using
Tools.MyData
;
using
Tools.MyUtils
;
namespace
Tools
{
/// <summary>
/// 日志
/// </summary>
public
class
Log
{
/// <summary>
/// 数据库访问对象
/// </summary>
private
static
DBHelper
_db
=
new
DBHelper
(
Utils
.
GetDbLinkString204
(
"FTT_Work"
));
/// <summary>
/// 锁
/// </summary>
private
static
object
_locker
=
new
object
();
/// <summary>
/// 记录操作日志
/// </summary>
/// <param name="action"></param>
public
static
void
Write
(
string
action
)
{
lock
(
_locker
)
{
try
{
var
sql
=
$@"
INSERT INTO dbo.FTT_ToolPlatformLog ( UserName, ActionName, OccurTime, TOKEN )
VALUES ( '
{
LoginInfo
.
UserName
}
', '
{
action
}
', GETDATE(), '
{
APP
.
TOKEN
}
')"
;
_db
?.
ExecNonSql
(
sql
);
}
finally
{
Monitor
.
Pulse
(
_locker
);
//释放锁
}
}
}
}
}
Tools/MyCommon/Common.cs
View file @
5d4df8c6
...
...
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace
Tools.MyCommon
{
/*
*
Global Readonly Feilds : 全局只读字段
*
应用静态信息
*/
/// <summary>
...
...
@@ -27,6 +27,11 @@ namespace Tools.MyCommon
/// 更新时间
/// </summary>
public
static
string
UPDATE_TIME
=>
"UpdateTime"
;
/// <summary>
/// 操作标识
/// </summary>
public
static
string
TOKEN
{
get
;
set
;
}
}
...
...
Tools/MyControls/TabControlEx.Designer.cs
→
Tools/MyCo
mmon/co
ntrols/TabControlEx.Designer.cs
View file @
5d4df8c6
namespace
Tools.MyControls
namespace
Tools.MyCo
mmon.co
ntrols
{
partial
class
TabControlEx
{
...
...
Tools/MyControls/TabControlEx.cs
→
Tools/MyCo
mmon/co
ntrols/TabControlEx.cs
View file @
5d4df8c6
...
...
@@ -8,7 +8,7 @@ using System.Text;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
namespace
Tools.MyControls
namespace
Tools.MyCo
mmon.co
ntrols
{
/// <summary>
/// Tab控件扩展
...
...
Tools/MyControls/TabControlEx.resx
→
Tools/MyCo
mmon/co
ntrols/TabControlEx.resx
View file @
5d4df8c6
File moved
Tools/Tools.csproj
View file @
5d4df8c6
...
...
@@ -74,6 +74,7 @@
<Reference
Include=
"System.Xml"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Log.cs"
/>
<Compile
Include=
"MyCommon\controls\MyTreeView.cs"
>
<SubType>
Component
</SubType>
</Compile>
...
...
@@ -99,10 +100,10 @@
<Compile
Include=
"MyCommon\wEditBasic.Designer.cs"
>
<DependentUpon>
wEditBasic.cs
</DependentUpon>
</Compile>
<Compile
Include=
"MyControls\TabControlEx.cs"
>
<Compile
Include=
"MyCo
mmon\co
ntrols\TabControlEx.cs"
>
<SubType>
Component
</SubType>
</Compile>
<Compile
Include=
"MyControls\TabControlEx.Designer.cs"
>
<Compile
Include=
"MyCo
mmon\co
ntrols\TabControlEx.Designer.cs"
>
<DependentUpon>
TabControlEx.cs
</DependentUpon>
</Compile>
<Compile
Include=
"MyData\AnlysisHelper.cs"
/>
...
...
@@ -324,7 +325,7 @@
<EmbeddedResource
Include=
"MyCommon\wEditBasic.resx"
>
<DependentUpon>
wEditBasic.cs
</DependentUpon>
</EmbeddedResource>
<EmbeddedResource
Include=
"MyControls\TabControlEx.resx"
>
<EmbeddedResource
Include=
"MyCo
mmon\co
ntrols\TabControlEx.resx"
>
<DependentUpon>
TabControlEx.cs
</DependentUpon>
</EmbeddedResource>
<EmbeddedResource
Include=
"MyUtils\wDbSetting.resx"
>
...
...
Tools/UI/wDbLinkMngr.Designer.cs
View file @
5d4df8c6
...
...
@@ -120,7 +120,7 @@
this
.
label2
.
Name
=
"label2"
;
this
.
label2
.
Size
=
new
System
.
Drawing
.
Size
(
65
,
12
);
this
.
label2
.
TabIndex
=
1
;
this
.
label2
.
Text
=
"
链 接
:"
;
this
.
label2
.
Text
=
"
内 容
:"
;
//
// label1
//
...
...
@@ -129,7 +129,7 @@
this
.
label1
.
Name
=
"label1"
;
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
65
,
12
);
this
.
label1
.
TabIndex
=
0
;
this
.
label1
.
Text
=
"
描 述
:"
;
this
.
label1
.
Text
=
"
标 题
:"
;
//
// dgvDetail
//
...
...
@@ -158,7 +158,7 @@
// Column1
//
this
.
Column1
.
DataPropertyName
=
"Note"
;
this
.
Column1
.
HeaderText
=
"
描述
"
;
this
.
Column1
.
HeaderText
=
"
标题
"
;
this
.
Column1
.
Name
=
"Column1"
;
this
.
Column1
.
ReadOnly
=
true
;
this
.
Column1
.
Width
=
200
;
...
...
@@ -166,7 +166,7 @@
// Column2
//
this
.
Column2
.
DataPropertyName
=
"Link"
;
this
.
Column2
.
HeaderText
=
"
链接
"
;
this
.
Column2
.
HeaderText
=
"
内容
"
;
this
.
Column2
.
Name
=
"Column2"
;
this
.
Column2
.
ReadOnly
=
true
;
this
.
Column2
.
Width
=
400
;
...
...
@@ -180,7 +180,7 @@
this
.
Controls
.
Add
(
this
.
panel1
);
this
.
Controls
.
Add
(
this
.
toolStrip1
);
this
.
Name
=
"wDbLinkMngr"
;
this
.
Text
=
"
数据库链接管理
"
;
this
.
Text
=
"
共享信息(标题+内容)
"
;
this
.
Load
+=
new
System
.
EventHandler
(
this
.
wEvaluationOfEmployee_Load
);
this
.
toolStrip1
.
ResumeLayout
(
false
);
this
.
toolStrip1
.
PerformLayout
();
...
...
Tools/UI/wDbLinkMngr.resx
View file @
5d4df8c6
...
...
@@ -129,4 +129,13 @@
<metadata
name=
"Column2.UserAddedColumn"
type=
"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>
<value>
True
</value>
</metadata>
<metadata
name=
"Column4.UserAddedColumn"
type=
"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>
<value>
True
</value>
</metadata>
<metadata
name=
"Column1.UserAddedColumn"
type=
"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>
<value>
True
</value>
</metadata>
<metadata
name=
"Column2.UserAddedColumn"
type=
"System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
>
<value>
True
</value>
</metadata>
</root>
\ No newline at end of file
Tools/UI/wFlowShare.Designer.cs
View file @
5d4df8c6
...
...
@@ -133,7 +133,7 @@
this
.
Controls
.
Add
(
this
.
dgvDetail
);
this
.
Controls
.
Add
(
this
.
toolStrip1
);
this
.
Name
=
"wFlowShare"
;
this
.
Text
=
"
wFlowShare
"
;
this
.
Text
=
"
共享文件(上传+更新+下载)
"
;
this
.
Load
+=
new
System
.
EventHandler
(
this
.
wFlowShare_Load
);
this
.
toolStrip1
.
ResumeLayout
(
false
);
this
.
toolStrip1
.
PerformLayout
();
...
...
Tools/UI/wSysChecker.cs
View file @
5d4df8c6
...
...
@@ -114,7 +114,7 @@ namespace Tools.UI
this
.
EndEdit
();
//保存配置信息
bool
b
=
false
;
if
(
this
.
_ds
.
HasChanges
())
if
(
this
.
_ds
!=
null
&&
this
.
_ds
.
HasChanges
())
{
b
=
this
.
_db
.
SaveData
(
this
.
_ds
,
this
.
tableList
);
}
...
...
Tools/wMain.Designer.cs
View file @
5d4df8c6
...
...
@@ -34,7 +34,7 @@
this
.
splitContainer1
=
new
System
.
Windows
.
Forms
.
SplitContainer
();
this
.
listView1
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
imageList1
=
new
System
.
Windows
.
Forms
.
ImageList
(
this
.
components
);
this
.
tabControl1
=
new
Tools
.
MyControls
.
TabControlEx
();
this
.
tabControl1
=
new
Tools
.
MyCo
mmon
.
co
ntrols
.
TabControlEx
();
this
.
HomePage
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
label5
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
menuStrip1
=
new
System
.
Windows
.
Forms
.
MenuStrip
();
...
...
@@ -521,7 +521,7 @@
private
System
.
Windows
.
Forms
.
Label
label3
;
private
System
.
Windows
.
Forms
.
Timer
timer1
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
tsmiSysUpdateLog
;
private
Tools
.
MyControls
.
TabControlEx
tabControl1
;
private
Tools
.
MyCo
mmon
.
co
ntrols
.
TabControlEx
tabControl1
;
private
System
.
Windows
.
Forms
.
TabPage
HomePage
;
private
System
.
Windows
.
Forms
.
Label
label5
;
}
...
...
Tools/wMain.cs
View file @
5d4df8c6
...
...
@@ -47,6 +47,8 @@ namespace Tools
private
void
WMain_Load
(
object
sender
,
EventArgs
e
)
{
//生成标识
APP
.
TOKEN
=
Guid
.
NewGuid
().
ToString
();
//初始化数据库链接
var
link
=
Utils
.
GetDbLinkString204
(
"FTT_Work"
);
this
.
_db
=
new
DBHelper
(
link
);
...
...
@@ -94,9 +96,12 @@ namespace Tools
ORDER BY DATENAME(YEAR, UDate) DESC, DATENAME(MONTH, UDate) DESC"
,
"version"
,
false
);
this
.
lbSysVersion
.
Text
=
dt
.
DefaultView
.
Count
==
0
?
$"2021.0.1"
:
$"
{
dt
.
DefaultView
[
0
][
0
]}
"
;
}));
//日志记录
Log
.
Write
(
"打开系统"
);
}
private
void
WMain_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
{
this
.
_db
=
null
;
//this.webBrowser1.Hide();
//this.webBrowser1.Dispose();
...
...
@@ -317,6 +322,8 @@ namespace Tools
if
(
result
==
DialogResult
.
No
)
return
;
}
//日志记录
Log
.
Write
(
"退出系统"
);
//关闭窗体
this
.
Close
();
}
...
...
@@ -390,6 +397,8 @@ namespace Tools
frm
.
Dock
=
DockStyle
.
Fill
;
frm
.
Show
();
}
//日志记录
Log
.
Write
(
$"打开模块:
{
page
.
Text
}
"
);
//选中标签页
this
.
tabControl1
.
SelectedTab
=
page
;
page
.
Refresh
();
...
...
@@ -402,6 +411,7 @@ namespace Tools
{
if
(
page
.
Name
!=
nameof
(
HomePage
))
{
Log
.
Write
(
$"关闭模块:
{
page
.
Text
}
"
);
//日志记录
this
.
OpenedList
.
Remove
(
page
.
Text
);
//移除列表
this
.
tabControl1
.
TabPages
.
Remove
(
page
);
//移除页面
page
.
Dispose
();
//释放页面
...
...
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