Commit 7dd0be7c authored by tr's avatar tr

1、数据库开发工具:配置界面优化

parent a0fbe3d3
...@@ -112,6 +112,7 @@ ...@@ -112,6 +112,7 @@
// //
this.tbDocExportPath.Location = new System.Drawing.Point(162, 90); this.tbDocExportPath.Location = new System.Drawing.Point(162, 90);
this.tbDocExportPath.Name = "tbDocExportPath"; this.tbDocExportPath.Name = "tbDocExportPath";
this.tbDocExportPath.ReadOnly = true;
this.tbDocExportPath.Size = new System.Drawing.Size(179, 21); this.tbDocExportPath.Size = new System.Drawing.Size(179, 21);
this.tbDocExportPath.TabIndex = 5; this.tbDocExportPath.TabIndex = 5;
// //
...@@ -119,6 +120,7 @@ ...@@ -119,6 +120,7 @@
// //
this.tbSqlExportPath.Location = new System.Drawing.Point(162, 62); this.tbSqlExportPath.Location = new System.Drawing.Point(162, 62);
this.tbSqlExportPath.Name = "tbSqlExportPath"; this.tbSqlExportPath.Name = "tbSqlExportPath";
this.tbSqlExportPath.ReadOnly = true;
this.tbSqlExportPath.Size = new System.Drawing.Size(179, 21); this.tbSqlExportPath.Size = new System.Drawing.Size(179, 21);
this.tbSqlExportPath.TabIndex = 4; this.tbSqlExportPath.TabIndex = 4;
// //
...@@ -126,6 +128,7 @@ ...@@ -126,6 +128,7 @@
// //
this.tbModelExportPath.Location = new System.Drawing.Point(162, 34); this.tbModelExportPath.Location = new System.Drawing.Point(162, 34);
this.tbModelExportPath.Name = "tbModelExportPath"; this.tbModelExportPath.Name = "tbModelExportPath";
this.tbModelExportPath.ReadOnly = true;
this.tbModelExportPath.Size = new System.Drawing.Size(179, 21); this.tbModelExportPath.Size = new System.Drawing.Size(179, 21);
this.tbModelExportPath.TabIndex = 3; this.tbModelExportPath.TabIndex = 3;
// //
......
...@@ -14,11 +14,17 @@ using Tools.MyUtils; ...@@ -14,11 +14,17 @@ using Tools.MyUtils;
namespace Tools.MyUtils namespace Tools.MyUtils
{ {
/// <summary>
/// 系统配置
/// </summary>
public partial class wSysSetting : wBasic public partial class wSysSetting : wBasic
{ {
DataTable dtSetting = null; DataTable dtSetting = null;
DbItemModel LinkModel = null; DbItemModel LinkModel = null;
/// <summary>
/// 系统配置-构造函数
/// </summary>
public wSysSetting() public wSysSetting()
{ {
InitializeComponent(); InitializeComponent();
...@@ -26,6 +32,11 @@ namespace Tools.MyUtils ...@@ -26,6 +32,11 @@ namespace Tools.MyUtils
this.DialogResult = DialogResult.None; this.DialogResult = DialogResult.None;
} }
/// <summary>
/// 事件:窗体加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void wSysSetting_Load(object sender, EventArgs e) private void wSysSetting_Load(object sender, EventArgs e)
{ {
//读取设置信息 //读取设置信息
...@@ -46,6 +57,11 @@ namespace Tools.MyUtils ...@@ -46,6 +57,11 @@ namespace Tools.MyUtils
this.btnSave.Click += BtnSave_Click; this.btnSave.Click += BtnSave_Click;
} }
/// <summary>
/// 按钮事件:选择数据库
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtnSelectDbLink_Click(object sender, EventArgs e) private void BtnSelectDbLink_Click(object sender, EventArgs e)
{ {
var frm = new wDbSetting(); var frm = new wDbSetting();
...@@ -55,31 +71,38 @@ namespace Tools.MyUtils ...@@ -55,31 +71,38 @@ namespace Tools.MyUtils
this.tbDefaultLink.Text = this.LinkModel.ToString(); 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) private void BtnSelectModelPath_Click(object sender, EventArgs e)
{ {
var frm = new FolderBrowserDialog(); this.SelectPath(this.tbModelExportPath);
if (frm.ShowDialog() == DialogResult.OK)
{
this.tbModelExportPath.Text = frm.SelectedPath;
}
} }
/// <summary>
/// 按钮事件:选择Sql导出路径
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtnSelectSqlPath_Click(object sender, EventArgs e) private void BtnSelectSqlPath_Click(object sender, EventArgs e)
{ {
var frm = new FolderBrowserDialog(); this.SelectPath(this.tbSqlExportPath);
if (frm.ShowDialog() == DialogResult.OK)
{
this.tbSqlExportPath.Text = frm.SelectedPath;
}
} }
/// <summary>
/// 按钮事件:选择Excel/Word导出路径
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtnSelectDocPath_Click(object sender, EventArgs e) private void BtnSelectDocPath_Click(object sender, EventArgs e)
{ {
var frm = new FolderBrowserDialog(); this.SelectPath(this.tbDocExportPath);
if (frm.ShowDialog() == DialogResult.OK)
{
this.tbDocExportPath.Text = frm.SelectedPath;
}
} }
/// <summary>
/// 按钮事件:保存配置
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtnSave_Click(object sender, EventArgs e) private void BtnSave_Click(object sender, EventArgs e)
{ {
//将设置写入结构表 //将设置写入结构表
...@@ -92,6 +115,12 @@ namespace Tools.MyUtils ...@@ -92,6 +115,12 @@ namespace Tools.MyUtils
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
} }
/// <summary>
/// 获取指定配置值
/// </summary>
/// <param name="dt"></param>
/// <param name="name"></param>
/// <returns></returns>
private string GetValue(DataTable dt, string name) private string GetValue(DataTable dt, string name)
{ {
var result = ""; var result = "";
...@@ -102,6 +131,12 @@ namespace Tools.MyUtils ...@@ -102,6 +131,12 @@ namespace Tools.MyUtils
} }
return result; 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) private void SetValue(DataTable dt, string name, string value)
{ {
var rows = dt.Select($"Name='{name}'"); var rows = dt.Select($"Name='{name}'");
...@@ -111,6 +146,19 @@ namespace Tools.MyUtils ...@@ -111,6 +146,19 @@ namespace Tools.MyUtils
rows[0].EndEdit(); 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;
}
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment