From 03baff4e343fadfe3a7c43d453b1e5ea40061d2e Mon Sep 17 00:00:00 2001
From: misdaigs <964384769@qq.com>
Date: Tue, 16 May 2023 16:21:44 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A7=E5=88=B6=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E5=A4=87=E6=B3=A8=E6=98=AF=E5=90=A6=E5=BC=B9=E5=87=BA?=
=?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=AF=B9=E8=AF=9D=E6=A1=86=E6=8F=90=E7=A4=BA?=
=?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
SmartSQL/SmartSQL.Framework/Const/SysConst.cs | 1 +
SmartSQL/SmartSQL.Framework/SQLiteHelper.cs | 1 +
.../UserControl/Main/UcMainColumns.xaml.cs | 15 +++++++++++----
SmartSQL/SmartSQL/Views/SettingWindow.xaml | 7 +++++++
SmartSQL/SmartSQL/Views/SettingWindow.xaml.cs | 11 ++++++++++-
5 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/SmartSQL/SmartSQL.Framework/Const/SysConst.cs b/SmartSQL/SmartSQL.Framework/Const/SysConst.cs
index 930047d..0556494 100644
--- a/SmartSQL/SmartSQL.Framework/Const/SysConst.cs
+++ b/SmartSQL/SmartSQL.Framework/Const/SysConst.cs
@@ -15,5 +15,6 @@ namespace SmartSQL.Framework.Const
public static readonly string Sys_LeftMenuType = "LeftMenuType";
public static readonly string Sys_SelectedConnection = "SelectedConnection";
public static readonly string Sys_SelectedDataBase = "SelectedDataBase";
+ public static readonly string Sys_IsShowSaveWin = "IsShowSaveWin";
}
}
diff --git a/SmartSQL/SmartSQL.Framework/SQLiteHelper.cs b/SmartSQL/SmartSQL.Framework/SQLiteHelper.cs
index 14f17e0..4389111 100644
--- a/SmartSQL/SmartSQL.Framework/SQLiteHelper.cs
+++ b/SmartSQL/SmartSQL.Framework/SQLiteHelper.cs
@@ -60,6 +60,7 @@ namespace SmartSQL.Framework
new SystemSet{Name = SysConst.Sys_IsMultipleTab,Type = 1,Value = "false"},
new SystemSet{Name = SysConst.Sys_IsLikeSearch,Type = 1,Value = "false"},
new SystemSet{Name = SysConst.Sys_IsContainsObjName,Type = 1,Value = "false"},
+ new SystemSet{Name = SysConst.Sys_IsShowSaveWin,Type = 1,Value = "true"},
new SystemSet{Name = SysConst.Sys_LeftMenuType,Type = 2,Value = "1"},
new SystemSet{Name = SysConst.Sys_SelectedConnection,Type = 3,Value = ""},
new SystemSet{Name = SysConst.Sys_SelectedDataBase,Type = 3,Value = ""},
diff --git a/SmartSQL/SmartSQL/UserControl/Main/UcMainColumns.xaml.cs b/SmartSQL/SmartSQL/UserControl/Main/UcMainColumns.xaml.cs
index ed89e3c..10319b8 100644
--- a/SmartSQL/SmartSQL/UserControl/Main/UcMainColumns.xaml.cs
+++ b/SmartSQL/SmartSQL/UserControl/Main/UcMainColumns.xaml.cs
@@ -24,6 +24,7 @@ using TextBox = System.Windows.Controls.TextBox;
using MessageBox = HandyControl.Controls.MessageBox;
using DbType = SqlSugar.DbType;
using SmartSQL.DocUtils;
+using SmartSQL.Framework.Const;
namespace SmartSQL.UserControl
{
@@ -316,12 +317,18 @@ namespace SmartSQL.UserControl
return;
}
var selectItem = (Column)e.Row.Item;
- var msgResult = MessageBox.Show($"确认修改{SelectedObject.DisplayName}的备注为{newValue}?", "温馨提示", MessageBoxButton.OKCancel, MessageBoxImage.Question);
- if (msgResult != MessageBoxResult.OK)
+
+ var isShowSaveWin = new SQLiteHelper().GetSysBool(SysConst.Sys_IsShowSaveWin);
+ if (isShowSaveWin)
{
- ((TextBox)e.EditingElement).Text = _cellEditValue;
- return;
+ var msgResult = MessageBox.Show($"确认修改{SelectedObject.DisplayName}的备注为{newValue}?", "温馨提示", MessageBoxButton.OKCancel, MessageBoxImage.Question);
+ if (msgResult != MessageBoxResult.OK)
+ {
+ ((TextBox)e.EditingElement).Text = _cellEditValue;
+ return;
+ }
}
+
var dbConnectionString = SelectedConnection.SelectedDbConnectString(SelectedDataBase.DbName);
try
{
diff --git a/SmartSQL/SmartSQL/Views/SettingWindow.xaml b/SmartSQL/SmartSQL/Views/SettingWindow.xaml
index b9fcd32..b71b5e1 100644
--- a/SmartSQL/SmartSQL/Views/SettingWindow.xaml
+++ b/SmartSQL/SmartSQL/Views/SettingWindow.xaml
@@ -97,6 +97,13 @@
VerticalAlignment="Top"
Content="左侧表、视图菜单包含表备注说明"
IsChecked="True" />
+
diff --git a/SmartSQL/SmartSQL/Views/SettingWindow.xaml.cs b/SmartSQL/SmartSQL/Views/SettingWindow.xaml.cs
index 2d9b746..43b1579 100644
--- a/SmartSQL/SmartSQL/Views/SettingWindow.xaml.cs
+++ b/SmartSQL/SmartSQL/Views/SettingWindow.xaml.cs
@@ -41,11 +41,13 @@ namespace SmartSQL.Views
ChkIsLikeSearch.IsChecked = value; break;
case "IsContainsObjName":
ChkIsContainsObjName.IsChecked = value; break;
+ case "IsShowSaveWin":
+ ChkIsShowSaveWin.IsChecked = value; break;
}
});
}
- private readonly List KeyList = new List { SysConst.Sys_IsMultipleTab, SysConst.Sys_IsLikeSearch, SysConst.Sys_IsContainsObjName };
+ private readonly List KeyList = new List { SysConst.Sys_IsMultipleTab, SysConst.Sys_IsLikeSearch, SysConst.Sys_IsContainsObjName,SysConst.Sys_IsShowSaveWin };
///
/// 保存
///
@@ -56,8 +58,11 @@ namespace SmartSQL.Views
var isMultipleTab = ChkIsMultipleTab.IsChecked == true;
var isLikeSearch = ChkIsLikeSearch.IsChecked == true;
var isContainsObjName = ChkIsContainsObjName.IsChecked == true;
+ var isShowSaveWin = ChkIsShowSaveWin.IsChecked == true;
+
var sqLiteHelper = new SQLiteHelper();
var sysSets = sqLiteHelper.db.Table().Where(x => KeyList.Contains(x.Name)).ToList();
+
sysSets.ForEach(x =>
{
if (x.Name == SysConst.Sys_IsMultipleTab)
@@ -72,6 +77,10 @@ namespace SmartSQL.Views
{
x.Value = isContainsObjName.ToString();
}
+ if (x.Name == SysConst.Sys_IsShowSaveWin)
+ {
+ x.Value = isShowSaveWin.ToString();
+ }
});
sqLiteHelper.db.UpdateAll(sysSets);
this.Close();
--
Gitee