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
65c60631
Commit
65c60631
authored
Oct 13, 2020
by
tr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、系统检查配置工具优化
parent
ff988c8c
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
222 additions
and
114 deletions
+222
-114
Tools.exe
AppHome/Tools.exe
+0
-0
Tools.pdb
AppHome/Tools.pdb
+0
-0
dbtools_help.txt
AppHome/config/dbtools_help.txt
+0
-0
links.xml
AppHome/config/links.xml
+6
-0
syschecker_help.txt
AppHome/config/syschecker_help.txt
+7
-0
Utils.cs
Tools/MyUtils/Utils.cs
+16
-0
Resources.Designer.cs
Tools/Properties/Resources.Designer.cs
+10
-0
Resources.resx
Tools/Properties/Resources.resx
+3
-0
测试.png
Tools/Resources/测试.png
+0
-0
Tools.csproj
Tools/Tools.csproj
+3
-0
wDBTools.cs
Tools/UI/wDBTools.cs
+1
-9
wSysChecker.Designer.cs
Tools/UI/wSysChecker.Designer.cs
+108
-89
wSysChecker.cs
Tools/UI/wSysChecker.cs
+68
-16
No files found.
AppHome/Tools.exe
View file @
65c60631
No preview for this file type
AppHome/Tools.pdb
View file @
65c60631
No preview for this file type
AppHome/config/help.txt
→
AppHome/config/
dbtools_
help.txt
View file @
65c60631
File moved
AppHome/config/links.xml
View file @
65c60631
...
...
@@ -24,4 +24,10 @@
<UserId>
sa
</UserId>
<Pwd>
sa
</Pwd>
</links>
<links>
<Link>
192.168.1.204
</Link>
<DbName>
FTT_MES
</DbName>
<UserId>
sa
</UserId>
<Pwd>
sa
</Pwd>
</links>
</DocumentElement>
\ No newline at end of file
AppHome/config/syschecker_help.txt
0 → 100644
View file @
65c60631
使用说明:
2、操作说明:支持右键増行/删行
3、保存:保存配置信息主表和明细表
4、刷新:刷新配置信息和错误消息
5、服务测试:保存并执行配置信息。因配置信息保存在通用库,所以需重新选择一次目标库
6、数据库:选择系统检查配置的存储数据库,一般是通用库FTT
Tools/MyUtils/Utils.cs
View file @
65c60631
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.Data
;
using
System.Diagnostics
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
...
...
@@ -75,6 +76,21 @@ namespace Tools.MyUtils
new
wMsgBox
().
Show
(
msg
,
width
,
height
);
}
/// <summary>
/// 显示帮助信息
/// </summary>
/// <param name="txtFileName"></param>
public
static
void
ShowHelp
(
string
txtFileName
)
{
var
helpFileName
=
$@"
{
Utils
.
ConfigPath
}
\
{
txtFileName
}
.txt"
;
if
(
File
.
Exists
(
helpFileName
))
{
using
(
var
sr
=
new
StreamReader
(
helpFileName
))
{
Utils
.
Tip
(
sr
.
ReadToEnd
(),
700
,
400
);
}
}
}
/// <summary>
/// 生成定长序号
/// </summary>
/// <param name="seed">序号</param>
...
...
Tools/Properties/Resources.Designer.cs
View file @
65c60631
...
...
@@ -200,6 +200,16 @@ namespace Tools.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal
static
System
.
Drawing
.
Bitmap
测试
{
get
{
object
obj
=
ResourceManager
.
GetObject
(
"测试"
,
resourceCulture
);
return
((
System
.
Drawing
.
Bitmap
)(
obj
));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
...
...
Tools/Properties/Resources.resx
View file @
65c60631
...
...
@@ -160,6 +160,9 @@
<data
name=
"查询"
type=
"System.Resources.ResXFileRef, System.Windows.Forms"
>
<value>
..\Resources\查询.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
</value>
</data>
<data
name=
"测试"
type=
"System.Resources.ResXFileRef, System.Windows.Forms"
>
<value>
..\Resources\测试.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
</value>
</data>
<data
name=
"类"
type=
"System.Resources.ResXFileRef, System.Windows.Forms"
>
<value>
..\Resources\类.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
</value>
</data>
...
...
Tools/Resources/测试.png
0 → 100644
View file @
65c60631
1.02 KB
Tools/Tools.csproj
View file @
65c60631
...
...
@@ -226,5 +226,8 @@
<ItemGroup>
<None
Include=
"Resources\保存.png"
/>
</ItemGroup>
<ItemGroup>
<None
Include=
"Resources\测试.png"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
</Project>
\ No newline at end of file
Tools/UI/wDBTools.cs
View file @
65c60631
...
...
@@ -337,15 +337,7 @@ namespace Tools.UI
private
void
TsbHelp_Click
(
object
sender
,
EventArgs
e
)
{
var
helpFileName
=
$@"
{
Utils
.
ConfigPath
}
\help.txt"
;
if
(
File
.
Exists
(
helpFileName
))
{
using
(
var
sr
=
new
StreamReader
(
helpFileName
))
{
Utils
.
Tip
(
sr
.
ReadToEnd
(),
700
,
300
);
}
}
Utils
.
ShowHelp
(
"dbtools_help"
);
}
#
endregion
...
...
Tools/UI/wSysChecker.Designer.cs
View file @
65c60631
This diff is collapsed.
Click to expand it.
Tools/UI/wSysChecker.cs
View file @
65c60631
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
using
System.Diagnostics
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -96,6 +97,7 @@ namespace Tools.UI
//工具栏-事件
this
.
tsbSave
.
Click
+=
TsbSave_Click
;
this
.
tsbRefresh
.
Click
+=
TsbRefresh_Click
;
this
.
tsbTestService
.
Click
+=
TsbTestService_Click
;
this
.
tsbDB
.
Click
+=
TsbDB_Click
;
this
.
tsbHelp
.
Click
+=
TsbHelp_Click
;
//数据表格-事件
...
...
@@ -116,21 +118,54 @@ namespace Tools.UI
{
if
(!
this
.
CheckDataSource
())
return
;
//结束编辑
this
.
dgvConfig
.
CommitEdit
(
DataGridViewDataErrorContexts
.
Display
);
this
.
dgvConfigDetail
.
CommitEdit
(
DataGridViewDataErrorContexts
.
Display
);
this
.
DataSetEndEdit
(
this
.
_ds
);
//保存配置信息
if
(
this
.
_ds
.
HasChanges
()
)
try
{
this
.
Save
(
);
Utils
.
Tip
(
$"保存成功!"
);
}
catch
(
Exception
ex
)
{
this
.
_db
.
SaveData
(
this
.
_link
,
this
.
_ds
,
this
.
tableList
);
Utils
.
Tip
(
$"保存失败!\r\n
{
ex
.
Message
}
\r\n
{
ex
.
StackTrace
}
"
);
return
;
}
Utils
.
Tip
(
"保存成功!"
);
}
private
void
TsbRefresh_Click
(
object
sender
,
EventArgs
e
)
{
this
.
InitData
();
}
private
void
TsbTestService_Click
(
object
sender
,
EventArgs
e
)
{
//先保存:存储过程内部检查是否启用,需要通过数据库判断
this
.
Save
();
//选择执行库
var
frm
=
new
wDbSetting
();
if
(
frm
.
ShowDialog
()
!=
DialogResult
.
OK
)
return
;
var
localLink
=
frm
.
LinkModel
.
LinkString
;
//生成语句
var
sqlist
=
new
List
<
string
>();
foreach
(
DataRow
r
in
this
.
_ds
.
Tables
[
T_ConfigDetail
].
Rows
)
{
if
(
r
.
RowState
==
DataRowState
.
Deleted
)
continue
;
sqlist
.
Add
(
$"Exec
{
r
[
"ProcName"
]}
@SerialNo=
{
r
[
"SerialNo"
]}
;"
);
}
//计时器
Stopwatch
sw
=
new
Stopwatch
();
sw
.
Start
();
try
{
this
.
_db
.
ExecNonSql
(
localLink
,
sqlist
);
}
catch
(
Exception
ex
)
{
Utils
.
Tip
(
$"测试执行出错!\r\n
{
ex
.
Message
}
\r\n
{
ex
.
StackTrace
}
"
);
return
;
}
sw
.
Stop
();
var
second
=
sw
.
ElapsedMilliseconds
/
1000.0
;
Utils
.
Tip
(
$"测试通过!总耗时
{
second
.
ToString
(
"0.##"
)}
秒"
);
}
private
void
TsbDB_Click
(
object
sender
,
EventArgs
e
)
{
//数据库
...
...
@@ -143,7 +178,7 @@ namespace Tools.UI
}
private
void
TsbHelp_Click
(
object
sender
,
EventArgs
e
)
{
//帮助信息:最后处理
Utils
.
ShowHelp
(
"syschecker_help"
);
}
#
endregion
...
...
@@ -314,26 +349,43 @@ namespace Tools.UI
return
result
;
}
/// <summary>
/// 结束
数据集
编辑
/// 结束编辑
/// </summary>
/// <param name="ds"></param>
private
void
DataSetEndEdit
(
DataSet
ds
)
private
void
EndEdit
(
)
{
if
(
ds
==
null
)
if
(
this
.
_
ds
==
null
)
return
;
foreach
(
DataTable
dt
in
ds
.
Tables
)
//数据表格界面提交
this
.
dgvConfig
.
CommitEdit
(
DataGridViewDataErrorContexts
.
Display
);
this
.
dgvConfigDetail
.
CommitEdit
(
DataGridViewDataErrorContexts
.
Display
);
//数据源结束编辑
foreach
(
DataTable
dt
in
this
.
_ds
.
Tables
)
{
foreach
(
DataRow
r
in
dt
.
Rows
)
{
if
(
r
.
RowState
!=
DataRowState
.
Deleted
&&
r
.
RowState
!=
DataRowState
.
Detached
)
if
(
r
.
RowState
!=
DataRowState
.
Deleted
&&
r
.
RowState
!=
DataRowState
.
Detached
)
{
r
.
EndEdit
();
}
}
}
}
/// <summary>
/// 保存配置信息
/// </summary>
private
bool
Save
()
{
//结束编辑
this
.
EndEdit
();
//保存配置信息
bool
b
=
false
;
if
(
this
.
_ds
.
HasChanges
())
{
b
=
this
.
_db
.
SaveData
(
this
.
_link
,
this
.
_ds
,
this
.
tableList
);
}
return
b
;
}
}
}
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