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
7dd0be7c
Commit
7dd0be7c
authored
Oct 07, 2020
by
tr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、数据库开发工具:配置界面优化
parent
a0fbe3d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
16 deletions
+67
-16
wSysSetting.Designer.cs
Tools/MyUtils/wSysSetting.Designer.cs
+3
-0
wSysSetting.cs
Tools/MyUtils/wSysSetting.cs
+64
-16
No files found.
Tools/MyUtils/wSysSetting.Designer.cs
View file @
7dd0be7c
...
...
@@ -112,6 +112,7 @@
//
this
.
tbDocExportPath
.
Location
=
new
System
.
Drawing
.
Point
(
162
,
90
);
this
.
tbDocExportPath
.
Name
=
"tbDocExportPath"
;
this
.
tbDocExportPath
.
ReadOnly
=
true
;
this
.
tbDocExportPath
.
Size
=
new
System
.
Drawing
.
Size
(
179
,
21
);
this
.
tbDocExportPath
.
TabIndex
=
5
;
//
...
...
@@ -119,6 +120,7 @@
//
this
.
tbSqlExportPath
.
Location
=
new
System
.
Drawing
.
Point
(
162
,
62
);
this
.
tbSqlExportPath
.
Name
=
"tbSqlExportPath"
;
this
.
tbSqlExportPath
.
ReadOnly
=
true
;
this
.
tbSqlExportPath
.
Size
=
new
System
.
Drawing
.
Size
(
179
,
21
);
this
.
tbSqlExportPath
.
TabIndex
=
4
;
//
...
...
@@ -126,6 +128,7 @@
//
this
.
tbModelExportPath
.
Location
=
new
System
.
Drawing
.
Point
(
162
,
34
);
this
.
tbModelExportPath
.
Name
=
"tbModelExportPath"
;
this
.
tbModelExportPath
.
ReadOnly
=
true
;
this
.
tbModelExportPath
.
Size
=
new
System
.
Drawing
.
Size
(
179
,
21
);
this
.
tbModelExportPath
.
TabIndex
=
3
;
//
...
...
Tools/MyUtils/wSysSetting.cs
View file @
7dd0be7c
...
...
@@ -14,11 +14,17 @@ using Tools.MyUtils;
namespace
Tools.MyUtils
{
/// <summary>
/// 系统配置
/// </summary>
public
partial
class
wSysSetting
:
wBasic
{
DataTable
dtSetting
=
null
;
DbItemModel
LinkModel
=
null
;
/// <summary>
/// 系统配置-构造函数
/// </summary>
public
wSysSetting
()
{
InitializeComponent
();
...
...
@@ -26,6 +32,11 @@ namespace Tools.MyUtils
this
.
DialogResult
=
DialogResult
.
None
;
}
/// <summary>
/// 事件:窗体加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private
void
wSysSetting_Load
(
object
sender
,
EventArgs
e
)
{
//读取设置信息
...
...
@@ -46,6 +57,11 @@ namespace Tools.MyUtils
this
.
btnSave
.
Click
+=
BtnSave_Click
;
}
/// <summary>
/// 按钮事件:选择数据库
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private
void
BtnSelectDbLink_Click
(
object
sender
,
EventArgs
e
)
{
var
frm
=
new
wDbSetting
();
...
...
@@ -55,31 +71,38 @@ namespace Tools.MyUtils
this
.
tbDefaultLink
.
Text
=
this
.
LinkModel
.
ToString
();
}
}
/// <summary>
/// 按钮事件:选择Model导出路径
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private
void
BtnSelectModelPath_Click
(
object
sender
,
EventArgs
e
)
{
var
frm
=
new
FolderBrowserDialog
();
if
(
frm
.
ShowDialog
()
==
DialogResult
.
OK
)
{
this
.
tbModelExportPath
.
Text
=
frm
.
SelectedPath
;
}
this
.
SelectPath
(
this
.
tbModelExportPath
);
}
/// <summary>
/// 按钮事件:选择Sql导出路径
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private
void
BtnSelectSqlPath_Click
(
object
sender
,
EventArgs
e
)
{
var
frm
=
new
FolderBrowserDialog
();
if
(
frm
.
ShowDialog
()
==
DialogResult
.
OK
)
{
this
.
tbSqlExportPath
.
Text
=
frm
.
SelectedPath
;
}
this
.
SelectPath
(
this
.
tbSqlExportPath
);
}
/// <summary>
/// 按钮事件:选择Excel/Word导出路径
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private
void
BtnSelectDocPath_Click
(
object
sender
,
EventArgs
e
)
{
var
frm
=
new
FolderBrowserDialog
();
if
(
frm
.
ShowDialog
()
==
DialogResult
.
OK
)
{
this
.
tbDocExportPath
.
Text
=
frm
.
SelectedPath
;
}
this
.
SelectPath
(
this
.
tbDocExportPath
);
}
/// <summary>
/// 按钮事件:保存配置
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private
void
BtnSave_Click
(
object
sender
,
EventArgs
e
)
{
//将设置写入结构表
...
...
@@ -92,6 +115,12 @@ namespace Tools.MyUtils
this
.
DialogResult
=
DialogResult
.
OK
;
}
/// <summary>
/// 获取指定配置值
/// </summary>
/// <param name="dt"></param>
/// <param name="name"></param>
/// <returns></returns>
private
string
GetValue
(
DataTable
dt
,
string
name
)
{
var
result
=
""
;
...
...
@@ -102,6 +131,12 @@ namespace Tools.MyUtils
}
return
result
;
}
/// <summary>
/// 设置指定配置值
/// </summary>
/// <param name="dt"></param>
/// <param name="name"></param>
/// <param name="value"></param>
private
void
SetValue
(
DataTable
dt
,
string
name
,
string
value
)
{
var
rows
=
dt
.
Select
(
$"Name='
{
name
}
'"
);
...
...
@@ -111,6 +146,19 @@ namespace Tools.MyUtils
rows
[
0
].
EndEdit
();
}
}
/// <summary>
/// 选择路径并赋值到文本框
/// </summary>
/// <param name="tb"></param>
private
void
SelectPath
(
TextBox
tb
)
{
var
frm
=
new
FolderBrowserDialog
();
if
(
frm
.
ShowDialog
()
==
DialogResult
.
OK
)
{
tb
.
Text
=
frm
.
SelectedPath
;
}
}
}
}
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